tencentcloud.MonitorBindingReceiver
Explore with Pulumi AI
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:
- Group
Id double - Policy group ID for binding receivers.
- Monitor
Binding stringReceiver Id - ID of the resource.
- Receivers
Monitor
Binding Receiver Receivers - A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:
- Group
Id float64 - Policy group ID for binding receivers.
- Monitor
Binding stringReceiver Id - ID of the resource.
- Receivers
Monitor
Binding Receiver Receivers Args - A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:
- group
Id Double - Policy group ID for binding receivers.
- monitor
Binding StringReceiver Id - ID of the resource.
- receivers
Monitor
Binding Receiver Receivers - A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:
- group
Id number - Policy group ID for binding receivers.
- monitor
Binding stringReceiver Id - ID of the resource.
- receivers
Monitor
Binding Receiver Receivers - 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_ strreceiver_ id - ID of the resource.
- receivers
Monitor
Binding Receiver Receivers Args - A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:
- group
Id Number - Policy group ID for binding receivers.
- monitor
Binding StringReceiver Id - 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.
- Group
Id double - Policy group ID for binding receivers.
- Monitor
Binding stringReceiver Id - ID of the resource.
- Receivers
Monitor
Binding Receiver Receivers - A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:
- Group
Id float64 - Policy group ID for binding receivers.
- Monitor
Binding stringReceiver Id - ID of the resource.
- Receivers
Monitor
Binding Receiver Receivers Args - A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:
- group
Id Double - Policy group ID for binding receivers.
- monitor
Binding StringReceiver Id - ID of the resource.
- receivers
Monitor
Binding Receiver Receivers - A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:
- group
Id number - Policy group ID for binding receivers.
- monitor
Binding stringReceiver Id - ID of the resource.
- receivers
Monitor
Binding Receiver Receivers - 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_ strreceiver_ id - ID of the resource.
- receivers
Monitor
Binding Receiver Receivers Args - A list of receivers(will overwrite the configuration of the server or other resources). Each element contains the following attributes:
- group
Id Number - Policy group ID for binding receivers.
- monitor
Binding StringReceiver Id - 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
- Notify
Ways List<string> - Method of warning notification.Optional
CALL
,EMAIL
,SITE
,SMS
,WECHAT
. - Receiver
Type string - Receive type. Optional
group
,user
. - End
Time double - End of alarm period. Meaning with
start_time
. - Receive
Language string - Alert sending language. Optional
en-US
,zh-CN
. - Receiver
Group List<double>Lists - Alarm receive group ID list.
- Receiver
User List<double>Lists - Alarm receiver ID list.
- Start
Time 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'.
- Notify
Ways []string - Method of warning notification.Optional
CALL
,EMAIL
,SITE
,SMS
,WECHAT
. - Receiver
Type string - Receive type. Optional
group
,user
. - End
Time float64 - End of alarm period. Meaning with
start_time
. - Receive
Language string - Alert sending language. Optional
en-US
,zh-CN
. - Receiver
Group []float64Lists - Alarm receive group ID list.
- Receiver
User []float64Lists - Alarm receiver ID list.
- Start
Time 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'.
- notify
Ways List<String> - Method of warning notification.Optional
CALL
,EMAIL
,SITE
,SMS
,WECHAT
. - receiver
Type String - Receive type. Optional
group
,user
. - end
Time Double - End of alarm period. Meaning with
start_time
. - receive
Language String - Alert sending language. Optional
en-US
,zh-CN
. - receiver
Group List<Double>Lists - Alarm receive group ID list.
- receiver
User List<Double>Lists - Alarm receiver ID list.
- start
Time 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'.
- notify
Ways string[] - Method of warning notification.Optional
CALL
,EMAIL
,SITE
,SMS
,WECHAT
. - receiver
Type string - Receive type. Optional
group
,user
. - end
Time number - End of alarm period. Meaning with
start_time
. - receive
Language string - Alert sending language. Optional
en-US
,zh-CN
. - receiver
Group number[]Lists - Alarm receive group ID list.
- receiver
User number[]Lists - Alarm receiver ID list.
- start
Time 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_ Sequence[float]lists - Alarm receive group ID list.
- receiver_
user_ Sequence[float]lists - 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'.
- notify
Ways List<String> - Method of warning notification.Optional
CALL
,EMAIL
,SITE
,SMS
,WECHAT
. - receiver
Type String - Receive type. Optional
group
,user
. - end
Time Number - End of alarm period. Meaning with
start_time
. - receive
Language String - Alert sending language. Optional
en-US
,zh-CN
. - receiver
Group List<Number>Lists - Alarm receive group ID list.
- receiver
User List<Number>Lists - Alarm receiver ID list.
- start
Time 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.