1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. MonitorBindingReceiver
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.MonitorBindingReceiver

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource for bind receivers to a policy group resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const groups = tencentcloud.getCamGroups({});
    const group = new tencentcloud.MonitorPolicyGroup("group", {
        groupName: "nice_group",
        policyViewName: "cvm_device",
        remark: "this is a test policy group",
        conditions: [{
            metricId: 33,
            alarmNotifyType: 1,
            alarmNotifyPeriod: 600,
            calcType: 1,
            calcValue: 3,
            calcPeriod: 300,
            continuePeriod: 2,
        }],
    });
    const receiver = new tencentcloud.MonitorBindingReceiver("receiver", {
        groupId: group.monitorPolicyGroupId,
        receivers: {
            startTime: 0,
            endTime: 86399,
            notifyWays: ["SMS"],
            receiverType: "group",
            receiverGroupLists: [groups.then(groups => groups.groupLists?.[0]?.groupId)],
            receiveLanguage: "en-US",
        },
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    groups = tencentcloud.get_cam_groups()
    group = tencentcloud.MonitorPolicyGroup("group",
        group_name="nice_group",
        policy_view_name="cvm_device",
        remark="this is a test policy group",
        conditions=[{
            "metric_id": 33,
            "alarm_notify_type": 1,
            "alarm_notify_period": 600,
            "calc_type": 1,
            "calc_value": 3,
            "calc_period": 300,
            "continue_period": 2,
        }])
    receiver = tencentcloud.MonitorBindingReceiver("receiver",
        group_id=group.monitor_policy_group_id,
        receivers={
            "start_time": 0,
            "end_time": 86399,
            "notify_ways": ["SMS"],
            "receiver_type": "group",
            "receiver_group_lists": [groups.group_lists[0].group_id],
            "receive_language": "en-US",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		groups, err := tencentcloud.GetCamGroups(ctx, &tencentcloud.GetCamGroupsArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		group, err := tencentcloud.NewMonitorPolicyGroup(ctx, "group", &tencentcloud.MonitorPolicyGroupArgs{
    			GroupName:      pulumi.String("nice_group"),
    			PolicyViewName: pulumi.String("cvm_device"),
    			Remark:         pulumi.String("this is a test policy group"),
    			Conditions: tencentcloud.MonitorPolicyGroupConditionArray{
    				&tencentcloud.MonitorPolicyGroupConditionArgs{
    					MetricId:          pulumi.Float64(33),
    					AlarmNotifyType:   pulumi.Float64(1),
    					AlarmNotifyPeriod: pulumi.Float64(600),
    					CalcType:          pulumi.Float64(1),
    					CalcValue:         pulumi.Float64(3),
    					CalcPeriod:        pulumi.Float64(300),
    					ContinuePeriod:    pulumi.Float64(2),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewMonitorBindingReceiver(ctx, "receiver", &tencentcloud.MonitorBindingReceiverArgs{
    			GroupId: group.MonitorPolicyGroupId,
    			Receivers: &tencentcloud.MonitorBindingReceiverReceiversArgs{
    				StartTime: pulumi.Float64(0),
    				EndTime:   pulumi.Float64(86399),
    				NotifyWays: pulumi.StringArray{
    					pulumi.String("SMS"),
    				},
    				ReceiverType: pulumi.String("group"),
    				ReceiverGroupLists: pulumi.Float64Array{
    					pulumi.String(groups.GroupLists[0].GroupId),
    				},
    				ReceiveLanguage: pulumi.String("en-US"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var groups = Tencentcloud.GetCamGroups.Invoke();
    
        var @group = new Tencentcloud.MonitorPolicyGroup("group", new()
        {
            GroupName = "nice_group",
            PolicyViewName = "cvm_device",
            Remark = "this is a test policy group",
            Conditions = new[]
            {
                new Tencentcloud.Inputs.MonitorPolicyGroupConditionArgs
                {
                    MetricId = 33,
                    AlarmNotifyType = 1,
                    AlarmNotifyPeriod = 600,
                    CalcType = 1,
                    CalcValue = 3,
                    CalcPeriod = 300,
                    ContinuePeriod = 2,
                },
            },
        });
    
        var receiver = new Tencentcloud.MonitorBindingReceiver("receiver", new()
        {
            GroupId = @group.MonitorPolicyGroupId,
            Receivers = new Tencentcloud.Inputs.MonitorBindingReceiverReceiversArgs
            {
                StartTime = 0,
                EndTime = 86399,
                NotifyWays = new[]
                {
                    "SMS",
                },
                ReceiverType = "group",
                ReceiverGroupLists = new[]
                {
                    groups.Apply(getCamGroupsResult => getCamGroupsResult.GroupLists[0]?.GroupId),
                },
                ReceiveLanguage = "en-US",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetCamGroupsArgs;
    import com.pulumi.tencentcloud.MonitorPolicyGroup;
    import com.pulumi.tencentcloud.MonitorPolicyGroupArgs;
    import com.pulumi.tencentcloud.inputs.MonitorPolicyGroupConditionArgs;
    import com.pulumi.tencentcloud.MonitorBindingReceiver;
    import com.pulumi.tencentcloud.MonitorBindingReceiverArgs;
    import com.pulumi.tencentcloud.inputs.MonitorBindingReceiverReceiversArgs;
    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) {
            final var groups = TencentcloudFunctions.getCamGroups();
    
            var group = new MonitorPolicyGroup("group", MonitorPolicyGroupArgs.builder()
                .groupName("nice_group")
                .policyViewName("cvm_device")
                .remark("this is a test policy group")
                .conditions(MonitorPolicyGroupConditionArgs.builder()
                    .metricId(33)
                    .alarmNotifyType(1)
                    .alarmNotifyPeriod(600)
                    .calcType(1)
                    .calcValue(3)
                    .calcPeriod(300)
                    .continuePeriod(2)
                    .build())
                .build());
    
            var receiver = new MonitorBindingReceiver("receiver", MonitorBindingReceiverArgs.builder()
                .groupId(group.monitorPolicyGroupId())
                .receivers(MonitorBindingReceiverReceiversArgs.builder()
                    .startTime(0)
                    .endTime(86399)
                    .notifyWays("SMS")
                    .receiverType("group")
                    .receiverGroupLists(groups.applyValue(getCamGroupsResult -> getCamGroupsResult.groupLists()[0].groupId()))
                    .receiveLanguage("en-US")
                    .build())
                .build());
    
        }
    }
    
    resources:
      group:
        type: tencentcloud:MonitorPolicyGroup
        properties:
          groupName: nice_group
          policyViewName: cvm_device
          remark: this is a test policy group
          conditions:
            - metricId: 33
              alarmNotifyType: 1
              alarmNotifyPeriod: 600
              calcType: 1
              calcValue: 3
              calcPeriod: 300
              continuePeriod: 2
      receiver:
        type: tencentcloud:MonitorBindingReceiver
        properties:
          groupId: ${group.monitorPolicyGroupId}
          receivers:
            startTime: 0
            endTime: 86399
            notifyWays:
              - SMS
            receiverType: group
            receiverGroupLists:
              - ${groups.groupLists[0].groupId}
            receiveLanguage: en-US
    variables:
      groups:
        fn::invoke:
          function: tencentcloud:getCamGroups
          arguments: {}
    

    Create MonitorBindingReceiver Resource

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

    Constructor syntax

    new MonitorBindingReceiver(name: string, args: MonitorBindingReceiverArgs, opts?: CustomResourceOptions);
    @overload
    def MonitorBindingReceiver(resource_name: str,
                               args: MonitorBindingReceiverArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def MonitorBindingReceiver(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               group_id: Optional[float] = None,
                               monitor_binding_receiver_id: Optional[str] = None,
                               receivers: Optional[MonitorBindingReceiverReceiversArgs] = None)
    func NewMonitorBindingReceiver(ctx *Context, name string, args MonitorBindingReceiverArgs, opts ...ResourceOption) (*MonitorBindingReceiver, error)
    public MonitorBindingReceiver(string name, MonitorBindingReceiverArgs args, CustomResourceOptions? opts = null)
    public MonitorBindingReceiver(String name, MonitorBindingReceiverArgs args)
    public MonitorBindingReceiver(String name, MonitorBindingReceiverArgs args, CustomResourceOptions options)
    
    type: tencentcloud:MonitorBindingReceiver
    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 MonitorBindingReceiverArgs
    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 MonitorBindingReceiverArgs
    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 MonitorBindingReceiverArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MonitorBindingReceiverArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MonitorBindingReceiverArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    GroupId double
    Policy group ID for binding receivers.
    MonitorBindingReceiverId string
    ID of the resource.
    Receivers MonitorBindingReceiverReceivers
    A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:
    GroupId float64
    Policy group ID for binding receivers.
    MonitorBindingReceiverId string
    ID of the resource.
    Receivers MonitorBindingReceiverReceiversArgs
    A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:
    groupId Double
    Policy group ID for binding receivers.
    monitorBindingReceiverId String
    ID of the resource.
    receivers MonitorBindingReceiverReceivers
    A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:
    groupId number
    Policy group ID for binding receivers.
    monitorBindingReceiverId string
    ID of the resource.
    receivers MonitorBindingReceiverReceivers
    A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:
    group_id float
    Policy group ID for binding receivers.
    monitor_binding_receiver_id str
    ID of the resource.
    receivers MonitorBindingReceiverReceiversArgs
    A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:
    groupId Number
    Policy group ID for binding receivers.
    monitorBindingReceiverId String
    ID of the resource.
    receivers Property Map
    A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:

    Outputs

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

    Get an existing MonitorBindingReceiver 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?: MonitorBindingReceiverState, opts?: CustomResourceOptions): MonitorBindingReceiver
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            group_id: Optional[float] = None,
            monitor_binding_receiver_id: Optional[str] = None,
            receivers: Optional[MonitorBindingReceiverReceiversArgs] = None) -> MonitorBindingReceiver
    func GetMonitorBindingReceiver(ctx *Context, name string, id IDInput, state *MonitorBindingReceiverState, opts ...ResourceOption) (*MonitorBindingReceiver, error)
    public static MonitorBindingReceiver Get(string name, Input<string> id, MonitorBindingReceiverState? state, CustomResourceOptions? opts = null)
    public static MonitorBindingReceiver get(String name, Output<String> id, MonitorBindingReceiverState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:MonitorBindingReceiver    get:      id: ${id}
    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:
    GroupId double
    Policy group ID for binding receivers.
    MonitorBindingReceiverId string
    ID of the resource.
    Receivers MonitorBindingReceiverReceivers
    A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:
    GroupId float64
    Policy group ID for binding receivers.
    MonitorBindingReceiverId string
    ID of the resource.
    Receivers MonitorBindingReceiverReceiversArgs
    A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:
    groupId Double
    Policy group ID for binding receivers.
    monitorBindingReceiverId String
    ID of the resource.
    receivers MonitorBindingReceiverReceivers
    A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:
    groupId number
    Policy group ID for binding receivers.
    monitorBindingReceiverId string
    ID of the resource.
    receivers MonitorBindingReceiverReceivers
    A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:
    group_id float
    Policy group ID for binding receivers.
    monitor_binding_receiver_id str
    ID of the resource.
    receivers MonitorBindingReceiverReceiversArgs
    A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:
    groupId Number
    Policy group ID for binding receivers.
    monitorBindingReceiverId String
    ID of the resource.
    receivers Property Map
    A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:

    Supporting Types

    MonitorBindingReceiverReceivers, MonitorBindingReceiverReceiversArgs

    NotifyWays List<string>
    Method of warning notification.Optional CALL,EMAIL,SITE,SMS,WECHAT.
    ReceiverType string
    Receive type. Optional group,user.
    EndTime double
    End of alarm period. Meaning with start_time.
    ReceiveLanguage string
    Alert sending language. Optional en-US,zh-CN.
    ReceiverGroupLists List<double>
    Alarm receive group ID list.
    ReceiverUserLists List<double>
    Alarm receiver ID list.
    StartTime double
    Alarm period start time. Valid value ranges: (0~86399). which removes the date after it is converted to Beijing time as a Unix timestamp, for example 7200 means '10:0:0'.
    NotifyWays []string
    Method of warning notification.Optional CALL,EMAIL,SITE,SMS,WECHAT.
    ReceiverType string
    Receive type. Optional group,user.
    EndTime float64
    End of alarm period. Meaning with start_time.
    ReceiveLanguage string
    Alert sending language. Optional en-US,zh-CN.
    ReceiverGroupLists []float64
    Alarm receive group ID list.
    ReceiverUserLists []float64
    Alarm receiver ID list.
    StartTime float64
    Alarm period start time. Valid value ranges: (0~86399). which removes the date after it is converted to Beijing time as a Unix timestamp, for example 7200 means '10:0:0'.
    notifyWays List<String>
    Method of warning notification.Optional CALL,EMAIL,SITE,SMS,WECHAT.
    receiverType String
    Receive type. Optional group,user.
    endTime Double
    End of alarm period. Meaning with start_time.
    receiveLanguage String
    Alert sending language. Optional en-US,zh-CN.
    receiverGroupLists List<Double>
    Alarm receive group ID list.
    receiverUserLists List<Double>
    Alarm receiver ID list.
    startTime Double
    Alarm period start time. Valid value ranges: (0~86399). which removes the date after it is converted to Beijing time as a Unix timestamp, for example 7200 means '10:0:0'.
    notifyWays string[]
    Method of warning notification.Optional CALL,EMAIL,SITE,SMS,WECHAT.
    receiverType string
    Receive type. Optional group,user.
    endTime number
    End of alarm period. Meaning with start_time.
    receiveLanguage string
    Alert sending language. Optional en-US,zh-CN.
    receiverGroupLists number[]
    Alarm receive group ID list.
    receiverUserLists number[]
    Alarm receiver ID list.
    startTime number
    Alarm period start time. Valid value ranges: (0~86399). which removes the date after it is converted to Beijing time as a Unix timestamp, for example 7200 means '10:0:0'.
    notify_ways Sequence[str]
    Method of warning notification.Optional CALL,EMAIL,SITE,SMS,WECHAT.
    receiver_type str
    Receive type. Optional group,user.
    end_time float
    End of alarm period. Meaning with start_time.
    receive_language str
    Alert sending language. Optional en-US,zh-CN.
    receiver_group_lists Sequence[float]
    Alarm receive group ID list.
    receiver_user_lists Sequence[float]
    Alarm receiver ID list.
    start_time float
    Alarm period start time. Valid value ranges: (0~86399). which removes the date after it is converted to Beijing time as a Unix timestamp, for example 7200 means '10:0:0'.
    notifyWays List<String>
    Method of warning notification.Optional CALL,EMAIL,SITE,SMS,WECHAT.
    receiverType String
    Receive type. Optional group,user.
    endTime Number
    End of alarm period. Meaning with start_time.
    receiveLanguage String
    Alert sending language. Optional en-US,zh-CN.
    receiverGroupLists List<Number>
    Alarm receive group ID list.
    receiverUserLists List<Number>
    Alarm receiver ID list.
    startTime Number
    Alarm period start time. Valid value ranges: (0~86399). which removes the date after it is converted to Beijing time as a Unix timestamp, for example 7200 means '10:0:0'.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack