Provides an Alicloud Config Delivery Channel resource. You can receive configuration audit event changes by configuring OSS, MNS and SLS services provided by Alibaba Cloud. For information about Alicloud Config Delivery Channel and how to use it, see What is Delivery Channel.
provider "alicloud" {
region = "cn-shanghai"
}
resource "alicloud_mns_topic" "example" {
name = "test-topic"
}
# Example for create a MNS delivery channel
resource "alicloud_config_delivery_channel" "example" {
description = "channel_description"
delivery_channel_name = "channel_name"
delivery_channel_assume_role_arn = "acs:ram::11827252********:role/aliyunserviceroleforconfig"
delivery_channel_type = "MNS"
delivery_channel_target_arn = format("acs:oss:cn-shanghai:11827252********:/topics/%s", alicloud_mns_topic.example.name)
delivery_channel_condition = <<EOF
[
{
"filterType":"ResourceType",
"values":[
"ACS::CEN::CenInstance",
"ACS::CEN::Flowlog",
],
"multiple":true
}
]
EOF
}
[
{
"filterType":"ResourceType",
"values":[
"ACS::CEN::CenInstance",
"ACS::CEN::Flowlog",
],
"multiple":true
}
]
EOF
}
The following arguments are supported:
delivery_channel_name
- (Optional, Computed) The name of the delivery channel.description
- (Optional, Computed) The description of the delivery method.status
- (Optional, Computed) The status of the delivery method. Valid values: 0
: The delivery method is disabled., 1
: The delivery destination is enabled. This is the default value. delivery_channel_assume_role_arn
- (Required) The Alibaba Cloud Resource Name (ARN) of the role to be assumed by the delivery method.delivery_channel_type
- (Required, ForceNew) - The type of the delivery method. This parameter is required when you create a delivery method. Valid values: OSS
: Object Storage, MNS
: Message Service, SLS
: Log Service.delivery_channel_target_arn
- (Required) - The ARN of the delivery destination. This parameter is required when you create a delivery method. The value must be in one of the following formats:
acs:oss:{RegionId}:{Aliuid}:{bucketName}
: if your delivery destination is an Object Storage Service (OSS) bucket. acs:mns:{RegionId}:{Aliuid}:/topics/{topicName}
: if your delivery destination is a Message Service (MNS) topic.acs:log:{RegionId}:{Aliuid}:project/{projectName}/logstore/{logstoreName}
: if your delivery destination is a Log Service Logstore.delivery_channel_condition
- (Optional, Computed) The rule attached to the delivery method. This parameter is applicable only to delivery methods of the MNS type. Please refer to api PutDeliveryChannel for example format. The following attributes are exported:
id
- This ID of Config Delivery Channel. The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 3 mins) Used when create the Config Delivery Channel.update
- (Defaults to 3 mins) Used when update the Config Delivery Channel.Alicloud Config Delivery Channel can be imported using the id, e.g.
$ terraform import alicloud_config_delivery_channel.example cdc-49a2ad756057********