1. Packages
  2. Datadog
  3. API Docs
  4. MonitorConfigPolicy
Datadog v4.30.0 published on Wednesday, Jul 17, 2024 by Pulumi

datadog.MonitorConfigPolicy

Explore with Pulumi AI

datadog logo
Datadog v4.30.0 published on Wednesday, Jul 17, 2024 by Pulumi

    Provides a Datadog monitor config policy resource. This can be used to create and manage Datadog monitor config policies.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as datadog from "@pulumi/datadog";
    
    const test = new datadog.MonitorConfigPolicy("test", {
        policyType: "tag",
        tagPolicy: {
            tagKey: "env",
            tagKeyRequired: false,
            validTagValues: [
                "staging",
                "prod",
            ],
        },
    });
    
    import pulumi
    import pulumi_datadog as datadog
    
    test = datadog.MonitorConfigPolicy("test",
        policy_type="tag",
        tag_policy=datadog.MonitorConfigPolicyTagPolicyArgs(
            tag_key="env",
            tag_key_required=False,
            valid_tag_values=[
                "staging",
                "prod",
            ],
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-datadog/sdk/v4/go/datadog"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := datadog.NewMonitorConfigPolicy(ctx, "test", &datadog.MonitorConfigPolicyArgs{
    			PolicyType: pulumi.String("tag"),
    			TagPolicy: &datadog.MonitorConfigPolicyTagPolicyArgs{
    				TagKey:         pulumi.String("env"),
    				TagKeyRequired: pulumi.Bool(false),
    				ValidTagValues: pulumi.StringArray{
    					pulumi.String("staging"),
    					pulumi.String("prod"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Datadog = Pulumi.Datadog;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Datadog.MonitorConfigPolicy("test", new()
        {
            PolicyType = "tag",
            TagPolicy = new Datadog.Inputs.MonitorConfigPolicyTagPolicyArgs
            {
                TagKey = "env",
                TagKeyRequired = false,
                ValidTagValues = new[]
                {
                    "staging",
                    "prod",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.datadog.MonitorConfigPolicy;
    import com.pulumi.datadog.MonitorConfigPolicyArgs;
    import com.pulumi.datadog.inputs.MonitorConfigPolicyTagPolicyArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var test = new MonitorConfigPolicy("test", MonitorConfigPolicyArgs.builder()
                .policyType("tag")
                .tagPolicy(MonitorConfigPolicyTagPolicyArgs.builder()
                    .tagKey("env")
                    .tagKeyRequired(false)
                    .validTagValues(                
                        "staging",
                        "prod")
                    .build())
                .build());
    
        }
    }
    
    resources:
      test:
        type: datadog:MonitorConfigPolicy
        properties:
          policyType: tag
          tagPolicy:
            tagKey: env
            tagKeyRequired: false
            validTagValues:
              - staging
              - prod
    

    Create MonitorConfigPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new MonitorConfigPolicy(name: string, args: MonitorConfigPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def MonitorConfigPolicy(resource_name: str,
                            args: MonitorConfigPolicyArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def MonitorConfigPolicy(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            policy_type: Optional[str] = None,
                            tag_policy: Optional[MonitorConfigPolicyTagPolicyArgs] = None)
    func NewMonitorConfigPolicy(ctx *Context, name string, args MonitorConfigPolicyArgs, opts ...ResourceOption) (*MonitorConfigPolicy, error)
    public MonitorConfigPolicy(string name, MonitorConfigPolicyArgs args, CustomResourceOptions? opts = null)
    public MonitorConfigPolicy(String name, MonitorConfigPolicyArgs args)
    public MonitorConfigPolicy(String name, MonitorConfigPolicyArgs args, CustomResourceOptions options)
    
    type: datadog:MonitorConfigPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args MonitorConfigPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args MonitorConfigPolicyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args MonitorConfigPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MonitorConfigPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MonitorConfigPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var monitorConfigPolicyResource = new Datadog.MonitorConfigPolicy("monitorConfigPolicyResource", new()
    {
        PolicyType = "string",
        TagPolicy = new Datadog.Inputs.MonitorConfigPolicyTagPolicyArgs
        {
            TagKey = "string",
            TagKeyRequired = false,
            ValidTagValues = new[]
            {
                "string",
            },
        },
    });
    
    example, err := datadog.NewMonitorConfigPolicy(ctx, "monitorConfigPolicyResource", &datadog.MonitorConfigPolicyArgs{
    	PolicyType: pulumi.String("string"),
    	TagPolicy: &datadog.MonitorConfigPolicyTagPolicyArgs{
    		TagKey:         pulumi.String("string"),
    		TagKeyRequired: pulumi.Bool(false),
    		ValidTagValues: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    })
    
    var monitorConfigPolicyResource = new MonitorConfigPolicy("monitorConfigPolicyResource", MonitorConfigPolicyArgs.builder()
        .policyType("string")
        .tagPolicy(MonitorConfigPolicyTagPolicyArgs.builder()
            .tagKey("string")
            .tagKeyRequired(false)
            .validTagValues("string")
            .build())
        .build());
    
    monitor_config_policy_resource = datadog.MonitorConfigPolicy("monitorConfigPolicyResource",
        policy_type="string",
        tag_policy=datadog.MonitorConfigPolicyTagPolicyArgs(
            tag_key="string",
            tag_key_required=False,
            valid_tag_values=["string"],
        ))
    
    const monitorConfigPolicyResource = new datadog.MonitorConfigPolicy("monitorConfigPolicyResource", {
        policyType: "string",
        tagPolicy: {
            tagKey: "string",
            tagKeyRequired: false,
            validTagValues: ["string"],
        },
    });
    
    type: datadog:MonitorConfigPolicy
    properties:
        policyType: string
        tagPolicy:
            tagKey: string
            tagKeyRequired: false
            validTagValues:
                - string
    

    MonitorConfigPolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The MonitorConfigPolicy resource accepts the following input properties:

    PolicyType string
    The monitor config policy type Valid values are tag.
    TagPolicy MonitorConfigPolicyTagPolicy
    Config for a tag policy. Only set if policy_type is tag.
    PolicyType string
    The monitor config policy type Valid values are tag.
    TagPolicy MonitorConfigPolicyTagPolicyArgs
    Config for a tag policy. Only set if policy_type is tag.
    policyType String
    The monitor config policy type Valid values are tag.
    tagPolicy MonitorConfigPolicyTagPolicy
    Config for a tag policy. Only set if policy_type is tag.
    policyType string
    The monitor config policy type Valid values are tag.
    tagPolicy MonitorConfigPolicyTagPolicy
    Config for a tag policy. Only set if policy_type is tag.
    policy_type str
    The monitor config policy type Valid values are tag.
    tag_policy MonitorConfigPolicyTagPolicyArgs
    Config for a tag policy. Only set if policy_type is tag.
    policyType String
    The monitor config policy type Valid values are tag.
    tagPolicy Property Map
    Config for a tag policy. Only set if policy_type is tag.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the MonitorConfigPolicy resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing MonitorConfigPolicy Resource

    Get an existing MonitorConfigPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: MonitorConfigPolicyState, opts?: CustomResourceOptions): MonitorConfigPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            policy_type: Optional[str] = None,
            tag_policy: Optional[MonitorConfigPolicyTagPolicyArgs] = None) -> MonitorConfigPolicy
    func GetMonitorConfigPolicy(ctx *Context, name string, id IDInput, state *MonitorConfigPolicyState, opts ...ResourceOption) (*MonitorConfigPolicy, error)
    public static MonitorConfigPolicy Get(string name, Input<string> id, MonitorConfigPolicyState? state, CustomResourceOptions? opts = null)
    public static MonitorConfigPolicy get(String name, Output<String> id, MonitorConfigPolicyState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    PolicyType string
    The monitor config policy type Valid values are tag.
    TagPolicy MonitorConfigPolicyTagPolicy
    Config for a tag policy. Only set if policy_type is tag.
    PolicyType string
    The monitor config policy type Valid values are tag.
    TagPolicy MonitorConfigPolicyTagPolicyArgs
    Config for a tag policy. Only set if policy_type is tag.
    policyType String
    The monitor config policy type Valid values are tag.
    tagPolicy MonitorConfigPolicyTagPolicy
    Config for a tag policy. Only set if policy_type is tag.
    policyType string
    The monitor config policy type Valid values are tag.
    tagPolicy MonitorConfigPolicyTagPolicy
    Config for a tag policy. Only set if policy_type is tag.
    policy_type str
    The monitor config policy type Valid values are tag.
    tag_policy MonitorConfigPolicyTagPolicyArgs
    Config for a tag policy. Only set if policy_type is tag.
    policyType String
    The monitor config policy type Valid values are tag.
    tagPolicy Property Map
    Config for a tag policy. Only set if policy_type is tag.

    Supporting Types

    MonitorConfigPolicyTagPolicy, MonitorConfigPolicyTagPolicyArgs

    TagKey string
    The key of the tag
    TagKeyRequired bool
    If a tag key is required for monitor creation
    ValidTagValues List<string>
    Valid values for the tag
    TagKey string
    The key of the tag
    TagKeyRequired bool
    If a tag key is required for monitor creation
    ValidTagValues []string
    Valid values for the tag
    tagKey String
    The key of the tag
    tagKeyRequired Boolean
    If a tag key is required for monitor creation
    validTagValues List<String>
    Valid values for the tag
    tagKey string
    The key of the tag
    tagKeyRequired boolean
    If a tag key is required for monitor creation
    validTagValues string[]
    Valid values for the tag
    tag_key str
    The key of the tag
    tag_key_required bool
    If a tag key is required for monitor creation
    valid_tag_values Sequence[str]
    Valid values for the tag
    tagKey String
    The key of the tag
    tagKeyRequired Boolean
    If a tag key is required for monitor creation
    validTagValues List<String>
    Valid values for the tag

    Package Details

    Repository
    Datadog pulumi/pulumi-datadog
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the datadog Terraform Provider.
    datadog logo
    Datadog v4.30.0 published on Wednesday, Jul 17, 2024 by Pulumi