import * as pulumi from "@pulumi/pulumi"; /** * Provides a Datadog tag rule resource. This can be used to create and manage Datadog governance tag rules. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as datadog from "@pulumi/datadog"; * * // Create a surfacing tag rule, which highlights non-compliant telemetry * // without rejecting it. * const env = new datadog.TagRule("env", { * name: "env must be a known environment", * source: "logs", * scope: "org", * tagKey: "env", * tagValuePatterns: [ * "prod", * "staging", * "dev", * ], * ruleType: "surfacing", * required: true, * }); * // Require the tag to be present with any value. A bare `*` accepts every * // value, so it must be paired with `required = true` (or with `negated = true` * // to require the tag to be absent instead). * const team = new datadog.TagRule("team", { * name: "team must be set", * source: "logs", * scope: "org", * tagKey: "team", * tagValuePatterns: ["*"], * ruleType: "surfacing", * required: true, * }); * // Create a blocking tag rule, which rejects telemetry that violates it. * // The Datadog API only accepts `surfacing` at creation time, so the provider * // creates the rule and then immediately updates it to `blocking`. Because that * // makes the create non-atomic, it has to be opted into explicitly. * const service = new datadog.TagRule("service", { * name: "service must be lowercase and hyphenated", * source: "spans", * scope: "org", * tagKey: "service", * tagValuePatterns: ["web-*"], * ruleType: "blocking", * forceBlockingOnCreate: true, * hardDelete: false, * }); * ``` * * ## Import * * The `pulumi import` command can be used, for example: * * ```sh * $ pulumi import datadog:index/tagRule:TagRule env "" * ``` */ export declare class TagRule extends pulumi.CustomResource { /** * Get an existing TagRule resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: TagRuleState, opts?: pulumi.CustomResourceOptions): TagRule; /** * Check whether an existing TagRule resource with the given ID exists. * * @param id The _unique_ provider ID of the resource to check. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static exists(id: pulumi.Input, state?: TagRuleState, opts?: pulumi.CustomResourceOptions): pulumi.Output; /** * Returns true if the given object is an instance of TagRule. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is TagRule; /** * The RFC 3339 timestamp at which the rule was created. */ readonly createdAt: pulumi.Output; /** * The identifier of the user who created the rule. */ readonly createdBy: pulumi.Output; /** * Whether the rule is currently enforced. Defaults to `true`. */ readonly enabled: pulumi.Output; /** * Set to `true` to allow creating a rule with `ruleType` set to `blocking`. The Datadog API only accepts `surfacing` at creation time, so the provider creates the rule as `surfacing` and then immediately updates it to `blocking`, which makes the create non-atomic: if the update fails, a `surfacing` rule is left behind and the resource is marked tainted. This field is only read during creation and is not sent to the API; changing it afterwards produces a diff that has no effect. */ readonly forceBlockingOnCreate: pulumi.Output; /** * Whether destroying this resource permanently deletes the tag rule. When set to `false` the rule is soft-deleted instead, which keeps it recoverable and preserves its historical compliance score data. This field is only read during deletion and is not sent to the API on create or update. Defaults to `true`. */ readonly hardDelete: pulumi.Output; /** * The RFC 3339 timestamp at which the rule was last modified. */ readonly modifiedAt: pulumi.Output; /** * The identifier of the user who last modified the rule. */ readonly modifiedBy: pulumi.Output; /** * Human-readable name for the tag rule. */ readonly name: pulumi.Output; /** * When `true`, the rule matches tag values that do NOT match any of the supplied patterns. Defaults to `false`. */ readonly negated: pulumi.Output; /** * When `true`, telemetry without this tag is treated as a violation. Defaults to `false`. */ readonly required: pulumi.Output; /** * How the rule is enforced. `surfacing` only highlights non-compliant telemetry, while `blocking` rejects telemetry that violates the rule. The API only accepts `surfacing` at creation time, so creating a rule directly as `blocking` requires `forceBlockingOnCreate` to be set to `true`. Using `blocking` at all requires blocking tag rules to be enabled for your organization; otherwise the API returns `403 permission denied`. Valid values are `blocking`, `surfacing`. */ readonly ruleType: pulumi.Output; /** * The scope the rule applies within. Typically an environment, team, or organization-level identifier used to limit where the rule is enforced. */ readonly scope: pulumi.Output; /** * The telemetry source that the tag rule applies to. This field cannot be updated after creation; changing it forces a new resource. Valid values are `logs`, `spans`, `metrics`, `rum`, `feed`. */ readonly source: pulumi.Output; /** * The tag key that the rule governs (for example, `service`). */ readonly tagKey: pulumi.Output; /** * One or more patterns that valid values for the tag key must match. At least one pattern is required. These are not regular expressions: the API restricts pattern characters to `A-Za-z0-9_:-.,/*`, with `*` acting as a wildcard. A bare `*` accepts any value, so `["*"]` with `required = true` means the tag must be present with any value, and `["*"]` with `negated = true` means the tag must be absent. A bare `*` cannot be combined with `required` and `negated` both `false` (the rule would have no effect) or both `true` (no value could comply). */ readonly tagValuePatterns: pulumi.Output; /** * A monotonically increasing version counter that is incremented on each update. */ readonly version: pulumi.Output; /** * Create a TagRule resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: TagRuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering TagRule resources. */ export interface TagRuleState { /** * The RFC 3339 timestamp at which the rule was created. */ createdAt?: pulumi.Input; /** * The identifier of the user who created the rule. */ createdBy?: pulumi.Input; /** * Whether the rule is currently enforced. Defaults to `true`. */ enabled?: pulumi.Input; /** * Set to `true` to allow creating a rule with `ruleType` set to `blocking`. The Datadog API only accepts `surfacing` at creation time, so the provider creates the rule as `surfacing` and then immediately updates it to `blocking`, which makes the create non-atomic: if the update fails, a `surfacing` rule is left behind and the resource is marked tainted. This field is only read during creation and is not sent to the API; changing it afterwards produces a diff that has no effect. */ forceBlockingOnCreate?: pulumi.Input; /** * Whether destroying this resource permanently deletes the tag rule. When set to `false` the rule is soft-deleted instead, which keeps it recoverable and preserves its historical compliance score data. This field is only read during deletion and is not sent to the API on create or update. Defaults to `true`. */ hardDelete?: pulumi.Input; /** * The RFC 3339 timestamp at which the rule was last modified. */ modifiedAt?: pulumi.Input; /** * The identifier of the user who last modified the rule. */ modifiedBy?: pulumi.Input; /** * Human-readable name for the tag rule. */ name?: pulumi.Input; /** * When `true`, the rule matches tag values that do NOT match any of the supplied patterns. Defaults to `false`. */ negated?: pulumi.Input; /** * When `true`, telemetry without this tag is treated as a violation. Defaults to `false`. */ required?: pulumi.Input; /** * How the rule is enforced. `surfacing` only highlights non-compliant telemetry, while `blocking` rejects telemetry that violates the rule. The API only accepts `surfacing` at creation time, so creating a rule directly as `blocking` requires `forceBlockingOnCreate` to be set to `true`. Using `blocking` at all requires blocking tag rules to be enabled for your organization; otherwise the API returns `403 permission denied`. Valid values are `blocking`, `surfacing`. */ ruleType?: pulumi.Input; /** * The scope the rule applies within. Typically an environment, team, or organization-level identifier used to limit where the rule is enforced. */ scope?: pulumi.Input; /** * The telemetry source that the tag rule applies to. This field cannot be updated after creation; changing it forces a new resource. Valid values are `logs`, `spans`, `metrics`, `rum`, `feed`. */ source?: pulumi.Input; /** * The tag key that the rule governs (for example, `service`). */ tagKey?: pulumi.Input; /** * One or more patterns that valid values for the tag key must match. At least one pattern is required. These are not regular expressions: the API restricts pattern characters to `A-Za-z0-9_:-.,/*`, with `*` acting as a wildcard. A bare `*` accepts any value, so `["*"]` with `required = true` means the tag must be present with any value, and `["*"]` with `negated = true` means the tag must be absent. A bare `*` cannot be combined with `required` and `negated` both `false` (the rule would have no effect) or both `true` (no value could comply). */ tagValuePatterns?: pulumi.Input[] | undefined>; /** * A monotonically increasing version counter that is incremented on each update. */ version?: pulumi.Input; } /** * The set of arguments for constructing a TagRule resource. */ export interface TagRuleArgs { /** * Whether the rule is currently enforced. Defaults to `true`. */ enabled?: pulumi.Input; /** * Set to `true` to allow creating a rule with `ruleType` set to `blocking`. The Datadog API only accepts `surfacing` at creation time, so the provider creates the rule as `surfacing` and then immediately updates it to `blocking`, which makes the create non-atomic: if the update fails, a `surfacing` rule is left behind and the resource is marked tainted. This field is only read during creation and is not sent to the API; changing it afterwards produces a diff that has no effect. */ forceBlockingOnCreate?: pulumi.Input; /** * Whether destroying this resource permanently deletes the tag rule. When set to `false` the rule is soft-deleted instead, which keeps it recoverable and preserves its historical compliance score data. This field is only read during deletion and is not sent to the API on create or update. Defaults to `true`. */ hardDelete?: pulumi.Input; /** * Human-readable name for the tag rule. */ name: pulumi.Input; /** * When `true`, the rule matches tag values that do NOT match any of the supplied patterns. Defaults to `false`. */ negated?: pulumi.Input; /** * When `true`, telemetry without this tag is treated as a violation. Defaults to `false`. */ required?: pulumi.Input; /** * How the rule is enforced. `surfacing` only highlights non-compliant telemetry, while `blocking` rejects telemetry that violates the rule. The API only accepts `surfacing` at creation time, so creating a rule directly as `blocking` requires `forceBlockingOnCreate` to be set to `true`. Using `blocking` at all requires blocking tag rules to be enabled for your organization; otherwise the API returns `403 permission denied`. Valid values are `blocking`, `surfacing`. */ ruleType: pulumi.Input; /** * The scope the rule applies within. Typically an environment, team, or organization-level identifier used to limit where the rule is enforced. */ scope: pulumi.Input; /** * The telemetry source that the tag rule applies to. This field cannot be updated after creation; changing it forces a new resource. Valid values are `logs`, `spans`, `metrics`, `rum`, `feed`. */ source: pulumi.Input; /** * The tag key that the rule governs (for example, `service`). */ tagKey: pulumi.Input; /** * One or more patterns that valid values for the tag key must match. At least one pattern is required. These are not regular expressions: the API restricts pattern characters to `A-Za-z0-9_:-.,/*`, with `*` acting as a wildcard. A bare `*` accepts any value, so `["*"]` with `required = true` means the tag must be present with any value, and `["*"]` with `negated = true` means the tag must be absent. A bare `*` cannot be combined with `required` and `negated` both `false` (the rule would have no effect) or both `true` (no value could comply). */ tagValuePatterns: pulumi.Input[]>; } //# sourceMappingURL=tagRule.d.ts.map