1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cms
  5. MonitorGroup
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.cms.MonitorGroup

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides a Cloud Monitor Service Monitor Group resource.

    For information about Cloud Monitor Service Monitor Group and how to use it, see What is Monitor Group.

    NOTE: Available since v1.113.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = new alicloud.cms.MonitorGroup("example", {monitorGroupName: "tf-example-accmonitorgroup"});
    const default2 = new alicloud.cms.MonitorGroup("default2", {
        contactGroups: ["your_contact_groups"],
        resourceGroupId: "your_resource_group_id",
        resourceGroupName: "resource_group_name",
        tags: {
            Created: "TF",
            For: "Acceptance-example",
        },
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.cms.MonitorGroup("example", monitor_group_name="tf-example-accmonitorgroup")
    default2 = alicloud.cms.MonitorGroup("default2",
        contact_groups=["your_contact_groups"],
        resource_group_id="your_resource_group_id",
        resource_group_name="resource_group_name",
        tags={
            "Created": "TF",
            "For": "Acceptance-example",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cms"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cms.NewMonitorGroup(ctx, "example", &cms.MonitorGroupArgs{
    			MonitorGroupName: pulumi.String("tf-example-accmonitorgroup"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cms.NewMonitorGroup(ctx, "default2", &cms.MonitorGroupArgs{
    			ContactGroups: pulumi.StringArray{
    				pulumi.String("your_contact_groups"),
    			},
    			ResourceGroupId:   pulumi.String("your_resource_group_id"),
    			ResourceGroupName: pulumi.String("resource_group_name"),
    			Tags: pulumi.Map{
    				"Created": pulumi.Any("TF"),
    				"For":     pulumi.Any("Acceptance-example"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AliCloud.Cms.MonitorGroup("example", new()
        {
            MonitorGroupName = "tf-example-accmonitorgroup",
        });
    
        var default2 = new AliCloud.Cms.MonitorGroup("default2", new()
        {
            ContactGroups = new[]
            {
                "your_contact_groups",
            },
            ResourceGroupId = "your_resource_group_id",
            ResourceGroupName = "resource_group_name",
            Tags = 
            {
                { "Created", "TF" },
                { "For", "Acceptance-example" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.cms.MonitorGroup;
    import com.pulumi.alicloud.cms.MonitorGroupArgs;
    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 example = new MonitorGroup("example", MonitorGroupArgs.builder()
                .monitorGroupName("tf-example-accmonitorgroup")
                .build());
    
            var default2 = new MonitorGroup("default2", MonitorGroupArgs.builder()
                .contactGroups("your_contact_groups")
                .resourceGroupId("your_resource_group_id")
                .resourceGroupName("resource_group_name")
                .tags(Map.ofEntries(
                    Map.entry("Created", "TF"),
                    Map.entry("For", "Acceptance-example")
                ))
                .build());
    
        }
    }
    
    resources:
      example:
        type: alicloud:cms:MonitorGroup
        properties:
          monitorGroupName: tf-example-accmonitorgroup
      default2:
        type: alicloud:cms:MonitorGroup
        properties:
          contactGroups:
            - your_contact_groups
          resourceGroupId: your_resource_group_id
          resourceGroupName: resource_group_name
          tags:
            Created: TF
            For: Acceptance-example
    

    Create MonitorGroup Resource

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

    Constructor syntax

    new MonitorGroup(name: string, args?: MonitorGroupArgs, opts?: CustomResourceOptions);
    @overload
    def MonitorGroup(resource_name: str,
                     args: Optional[MonitorGroupArgs] = None,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def MonitorGroup(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     contact_groups: Optional[Sequence[str]] = None,
                     monitor_group_name: Optional[str] = None,
                     resource_group_id: Optional[str] = None,
                     resource_group_name: Optional[str] = None,
                     tags: Optional[Mapping[str, Any]] = None)
    func NewMonitorGroup(ctx *Context, name string, args *MonitorGroupArgs, opts ...ResourceOption) (*MonitorGroup, error)
    public MonitorGroup(string name, MonitorGroupArgs? args = null, CustomResourceOptions? opts = null)
    public MonitorGroup(String name, MonitorGroupArgs args)
    public MonitorGroup(String name, MonitorGroupArgs args, CustomResourceOptions options)
    
    type: alicloud:cms:MonitorGroup
    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 MonitorGroupArgs
    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 MonitorGroupArgs
    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 MonitorGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MonitorGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MonitorGroupArgs
    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 monitorGroupResource = new AliCloud.Cms.MonitorGroup("monitorGroupResource", new()
    {
        ContactGroups = new[]
        {
            "string",
        },
        MonitorGroupName = "string",
        ResourceGroupId = "string",
        ResourceGroupName = "string",
        Tags = 
        {
            { "string", "any" },
        },
    });
    
    example, err := cms.NewMonitorGroup(ctx, "monitorGroupResource", &cms.MonitorGroupArgs{
    	ContactGroups: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	MonitorGroupName:  pulumi.String("string"),
    	ResourceGroupId:   pulumi.String("string"),
    	ResourceGroupName: pulumi.String("string"),
    	Tags: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    })
    
    var monitorGroupResource = new MonitorGroup("monitorGroupResource", MonitorGroupArgs.builder()
        .contactGroups("string")
        .monitorGroupName("string")
        .resourceGroupId("string")
        .resourceGroupName("string")
        .tags(Map.of("string", "any"))
        .build());
    
    monitor_group_resource = alicloud.cms.MonitorGroup("monitorGroupResource",
        contact_groups=["string"],
        monitor_group_name="string",
        resource_group_id="string",
        resource_group_name="string",
        tags={
            "string": "any",
        })
    
    const monitorGroupResource = new alicloud.cms.MonitorGroup("monitorGroupResource", {
        contactGroups: ["string"],
        monitorGroupName: "string",
        resourceGroupId: "string",
        resourceGroupName: "string",
        tags: {
            string: "any",
        },
    });
    
    type: alicloud:cms:MonitorGroup
    properties:
        contactGroups:
            - string
        monitorGroupName: string
        resourceGroupId: string
        resourceGroupName: string
        tags:
            string: any
    

    MonitorGroup 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 MonitorGroup resource accepts the following input properties:

    ContactGroups List<string>
    The alert group to which alert notifications will be sent.
    MonitorGroupName string
    The name of the application group.
    ResourceGroupId string
    The ID of the resource group.
    ResourceGroupName string
    The name of the resource group.
    Tags Dictionary<string, object>
    A mapping of tags to assign to the resource.
    ContactGroups []string
    The alert group to which alert notifications will be sent.
    MonitorGroupName string
    The name of the application group.
    ResourceGroupId string
    The ID of the resource group.
    ResourceGroupName string
    The name of the resource group.
    Tags map[string]interface{}
    A mapping of tags to assign to the resource.
    contactGroups List<String>
    The alert group to which alert notifications will be sent.
    monitorGroupName String
    The name of the application group.
    resourceGroupId String
    The ID of the resource group.
    resourceGroupName String
    The name of the resource group.
    tags Map<String,Object>
    A mapping of tags to assign to the resource.
    contactGroups string[]
    The alert group to which alert notifications will be sent.
    monitorGroupName string
    The name of the application group.
    resourceGroupId string
    The ID of the resource group.
    resourceGroupName string
    The name of the resource group.
    tags {[key: string]: any}
    A mapping of tags to assign to the resource.
    contact_groups Sequence[str]
    The alert group to which alert notifications will be sent.
    monitor_group_name str
    The name of the application group.
    resource_group_id str
    The ID of the resource group.
    resource_group_name str
    The name of the resource group.
    tags Mapping[str, Any]
    A mapping of tags to assign to the resource.
    contactGroups List<String>
    The alert group to which alert notifications will be sent.
    monitorGroupName String
    The name of the application group.
    resourceGroupId String
    The ID of the resource group.
    resourceGroupName String
    The name of the resource group.
    tags Map<Any>
    A mapping of tags to assign to the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the MonitorGroup 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 MonitorGroup Resource

    Get an existing MonitorGroup 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?: MonitorGroupState, opts?: CustomResourceOptions): MonitorGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            contact_groups: Optional[Sequence[str]] = None,
            monitor_group_name: Optional[str] = None,
            resource_group_id: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            tags: Optional[Mapping[str, Any]] = None) -> MonitorGroup
    func GetMonitorGroup(ctx *Context, name string, id IDInput, state *MonitorGroupState, opts ...ResourceOption) (*MonitorGroup, error)
    public static MonitorGroup Get(string name, Input<string> id, MonitorGroupState? state, CustomResourceOptions? opts = null)
    public static MonitorGroup get(String name, Output<String> id, MonitorGroupState 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:
    ContactGroups List<string>
    The alert group to which alert notifications will be sent.
    MonitorGroupName string
    The name of the application group.
    ResourceGroupId string
    The ID of the resource group.
    ResourceGroupName string
    The name of the resource group.
    Tags Dictionary<string, object>
    A mapping of tags to assign to the resource.
    ContactGroups []string
    The alert group to which alert notifications will be sent.
    MonitorGroupName string
    The name of the application group.
    ResourceGroupId string
    The ID of the resource group.
    ResourceGroupName string
    The name of the resource group.
    Tags map[string]interface{}
    A mapping of tags to assign to the resource.
    contactGroups List<String>
    The alert group to which alert notifications will be sent.
    monitorGroupName String
    The name of the application group.
    resourceGroupId String
    The ID of the resource group.
    resourceGroupName String
    The name of the resource group.
    tags Map<String,Object>
    A mapping of tags to assign to the resource.
    contactGroups string[]
    The alert group to which alert notifications will be sent.
    monitorGroupName string
    The name of the application group.
    resourceGroupId string
    The ID of the resource group.
    resourceGroupName string
    The name of the resource group.
    tags {[key: string]: any}
    A mapping of tags to assign to the resource.
    contact_groups Sequence[str]
    The alert group to which alert notifications will be sent.
    monitor_group_name str
    The name of the application group.
    resource_group_id str
    The ID of the resource group.
    resource_group_name str
    The name of the resource group.
    tags Mapping[str, Any]
    A mapping of tags to assign to the resource.
    contactGroups List<String>
    The alert group to which alert notifications will be sent.
    monitorGroupName String
    The name of the application group.
    resourceGroupId String
    The ID of the resource group.
    resourceGroupName String
    The name of the resource group.
    tags Map<Any>
    A mapping of tags to assign to the resource.

    Import

    Cloud Monitor Service Monitor Group can be imported using the id, e.g.

    $ pulumi import alicloud:cms/monitorGroup:MonitorGroup example <id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi