alicloud.cms.MonitorGroup
Explore with Pulumi AI
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.StringMap{
"Created": pulumi.String("TF"),
"For": pulumi.String("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, str]] = 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", "string" },
},
});
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.StringMap{
"string": pulumi.String("string"),
},
})
var monitorGroupResource = new MonitorGroup("monitorGroupResource", MonitorGroupArgs.builder()
.contactGroups("string")
.monitorGroupName("string")
.resourceGroupId("string")
.resourceGroupName("string")
.tags(Map.of("string", "string"))
.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": "string",
})
const monitorGroupResource = new alicloud.cms.MonitorGroup("monitorGroupResource", {
contactGroups: ["string"],
monitorGroupName: "string",
resourceGroupId: "string",
resourceGroupName: "string",
tags: {
string: "string",
},
});
type: alicloud:cms:MonitorGroup
properties:
contactGroups:
- string
monitorGroupName: string
resourceGroupId: string
resourceGroupName: string
tags:
string: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The MonitorGroup resource accepts the following input properties:
- Contact
Groups List<string> - The alert group to which alert notifications will be sent.
- Monitor
Group stringName - The name of the application group.
- Resource
Group stringId - The ID of the resource group.
- Resource
Group stringName - The name of the resource group.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Contact
Groups []string - The alert group to which alert notifications will be sent.
- Monitor
Group stringName - The name of the application group.
- Resource
Group stringId - The ID of the resource group.
- Resource
Group stringName - The name of the resource group.
- map[string]string
- A mapping of tags to assign to the resource.
- contact
Groups List<String> - The alert group to which alert notifications will be sent.
- monitor
Group StringName - The name of the application group.
- resource
Group StringId - The ID of the resource group.
- resource
Group StringName - The name of the resource group.
- Map<String,String>
- A mapping of tags to assign to the resource.
- contact
Groups string[] - The alert group to which alert notifications will be sent.
- monitor
Group stringName - The name of the application group.
- resource
Group stringId - The ID of the resource group.
- resource
Group stringName - The name of the resource group.
- {[key: string]: string}
- 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_ strname - The name of the application group.
- resource_
group_ strid - The ID of the resource group.
- resource_
group_ strname - The name of the resource group.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- contact
Groups List<String> - The alert group to which alert notifications will be sent.
- monitor
Group StringName - The name of the application group.
- resource
Group StringId - The ID of the resource group.
- resource
Group StringName - The name of the resource group.
- Map<String>
- 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, str]] = 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.
- Contact
Groups List<string> - The alert group to which alert notifications will be sent.
- Monitor
Group stringName - The name of the application group.
- Resource
Group stringId - The ID of the resource group.
- Resource
Group stringName - The name of the resource group.
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Contact
Groups []string - The alert group to which alert notifications will be sent.
- Monitor
Group stringName - The name of the application group.
- Resource
Group stringId - The ID of the resource group.
- Resource
Group stringName - The name of the resource group.
- map[string]string
- A mapping of tags to assign to the resource.
- contact
Groups List<String> - The alert group to which alert notifications will be sent.
- monitor
Group StringName - The name of the application group.
- resource
Group StringId - The ID of the resource group.
- resource
Group StringName - The name of the resource group.
- Map<String,String>
- A mapping of tags to assign to the resource.
- contact
Groups string[] - The alert group to which alert notifications will be sent.
- monitor
Group stringName - The name of the application group.
- resource
Group stringId - The ID of the resource group.
- resource
Group stringName - The name of the resource group.
- {[key: string]: string}
- 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_ strname - The name of the application group.
- resource_
group_ strid - The ID of the resource group.
- resource_
group_ strname - The name of the resource group.
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- contact
Groups List<String> - The alert group to which alert notifications will be sent.
- monitor
Group StringName - The name of the application group.
- resource
Group StringId - The ID of the resource group.
- resource
Group StringName - The name of the resource group.
- Map<String>
- 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.