All Products
Search
Document Center

Cloud Config:CreateDeliveryChannel

Last Updated:Mar 08, 2023

Creates a delivery channel.

Operation Description

In this example, a delivery channel is created. The type of the delivery channle is OSS, the Alibaba Cloud Resource Name (ARN) of the delivery destination is acs:oss:cn-shanghai:100931896542****:new-bucket, and the ARN of the role that is assigned to the delivery channel is acs:ram::100931896542****:role/aliyunserviceroleforconfig. The response shows that the delivery channel is created, and the ID of the delivery channel is cdc-8e45ff4e06a3a8****.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociation operation
config:CreateDeliveryChannelWrite
  • Config
    acs:config:*:{#accountId}:*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DeliveryChannelNamestringNo

The name of the delivery channel.

NoteIf you do not configure this parameter, this parameter is left empty.
testoss
DeliveryChannelTypestringYes

The type of the delivery channel. Valid values:

  • OSS: Object Storage Service (OSS)
  • MNS: Message Service (MNS)
  • SLS: Log Service
OSS
DeliveryChannelTargetArnstringYes

The ARN of the delivery destination. Valid values:

  • acs:oss:{RegionId}:{accountId}:{bucketName} if your delivery destination is an OSS bucket. Example: acs:oss:cn-shanghai:100931896542****:new-bucket.
  • acs:mns:{RegionId}:{accountId}:/topics/{topicName} if your delivery destination is an MNS topic. Example: acs:mns:cn-shanghai:100931896542****:/topics/topic1.
  • acs:log:{RegionId}:{accountId}:project/{projectName}/logstore/{logstoreName} if your delivery destination is a Log Service Logstore. Example: acs:log:cn-shanghai:100931896542****:project/project1/logstore/logstore1.
acs:oss:cn-shanghai:100931896542****:new-bucket
DeliveryChannelAssumeRoleArnstringYes

The ARN of the role that you want to assign to the delivery channel. Specify an ARN in the following format: acs:ram::{accountId}:role/aliyunserviceroleforconfig.

acs:ram::100931896542****:role/aliyunserviceroleforconfig
DeliveryChannelConditionstringNo

The rule that you want to attach to the delivery channel. This parameter is available only for delivery channels of the MNS type.

This parameter specifies the lowest risk level and the resource types for the events to which you want to subscribe.

  • The setting of the lowest risk level for the events to which you want to subscribe is in the following format: {"filterType":"RuleRiskLevel","value":"1","multiple":false}. The value field specifies the lowest risk level for the events to which you want to subscribe. Valid values: 1, 2, and 3, where 1 indicates the high risk leve, 2 indicates the medium risk level, and 3 indicates the low risk level.

  • The setting of the resource types for the events to which you want to subscribe is in the following format: {"filterType":"ResourceType","values":["ACS::ACK::Cluster","ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage"],"multiple":true}. The values field specifies the resource types for which you want to subscribe to events. The value of the field is a JSON array.

    Example: [{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]

[{"filterType":"ResourceType","values":["ACS::ActionTrail::Trail","ACS::CBWP::CommonBandwidthPackage","ACS::CDN::Domain","ACS::CEN::CenBandwidthPackage","ACS::CEN::CenInstance","ACS::CEN::Flowlog","ACS::DdosCoo::Instance"],"multiple":true}]
DescriptionstringNo

The description of the delivery channel.

My OSS delivery.
ClientTokenstringNo

The client token that you want to use to ensure the idempotency of the request. You can use the client to generate the value, but you must make sure that the value is unique among different requests.

The ClientToken value can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see Ensure idempotence.

1594295238-f9361358-5843-4294-8d30-b5183fac****
ConfigurationSnapshotbooleanNo

Specifies whether to deliver scheduled resource snapshots to the OSS bucket. If the value of this parameter is true, the scheduled resource snapshots are delivered to the specified OSS bucket at 00:00:00 and 12:00:00 on a daily basis. Valid values:

  • true
  • false. This is the default value.
NoteThis parameter is available only for delivery channels of the OSS type.
false
ConfigurationItemChangeNotificationbooleanNo

Specifies whether to deliver resource change logs to the specified destination. If you set this parameter to true, Cloud Config delivers resource change logs to OSS, Log Service, or MNS when the configurations of the resources change. Valid values:

  • true
  • false. This is the default value.
NoteThis parameter is available for delivery channels of the OSS, SLS, or MNS type.
false
NonCompliantNotificationbooleanNo

Specifies whether to deliver resource non-compliance events to the specified destination. If you set this parameter to true, Cloud Config delivers resource non-compliance events to Log Service or MNS when resources are considered incompliant. Valid values:

  • true
  • false. This is the default value.
NoteThis parameter is applicable only to delivery channels of the SLS or MNS type.
false
OversizedDataOSSTargetArnstringNo

The ARN of the OSS bucket to which you want to transfer the delivery data when the size of the data exceeds the specified upper limit of the delivery channel. Format: acs:oss:{RegionId}:{accountId}:{bucketName}.

If you do not configure this parameter, Cloud Config delivers only summary data.

NoteThis parameter is available only for delivery channels of the SLS type or MNS type. The upper limit on the storage size of delivery channels of the SLS type is 1 MB, and the upper limit on the storage size of delivery channels of the MNS type is 64 KB.
acs:oss:cn-shanghai:100931896542****:new-bucket

For more information about common request parameters, see Common parameters.

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

A7A0FFF8-0B44-40C6-8BBF-3A185EFDERTHG
DeliveryChannelIdstring

The ID of the delivery channel.

cdc-8e45ff4e06a3a8****

Examples

Sample success responses

JSONformat

{
  "RequestId": "A7A0FFF8-0B44-40C6-8BBF-3A185EFDERTHG",
  "DeliveryChannelId": "cdc-8e45ff4e06a3a8****"
}

Error codes

HTTP status codeError codeError messageDescription
400DeliveryChannelNotExistsThe delivery channel does not exist.The delivery channel does not exist.
400Invalid.DeliveryChannelAssumeRoleArn.FormatThe specified format of DeliveryChannelAssumeRoleArn is invalid.The specified format of DeliveryChannelAssumeRoleArn is invalid.
400Invalid.DeliveryChannelTargetArn.FormatThe specified format of DeliveryChannelTargetArn is invalid.The specified format of DeliveryChannelTargetArn is invalid.
400Invalid.DeliveryChannelCondition.FormatThe specified format of DeliveryChannelCondition is invalid.The specified format of DeliveryChannelCondition is invalid.
400MemberNotBelongToMasterThe specified member does not belong to your organization.The specified member does not belong to your organization.
400DeliveryChannelAccountNotSupportCross-account delivery that is not in the RD is not supported.Cross-account delivery that is not in the RD is not supported.
400DeliveryChannelMnsUnreachableThe MNS topic is unreachable.The MNS topic is unreachable.
400DeliveryChannelOssUnreachableThe OSS bucket is unreachable.The OSS bucket is unreachable.
400DeliveryChannelSlsUnreachableSLS logstore is unreachable.The SLS Logstore is unreachable.
404AccountNotExistedYour account does not exist.The specified account does not exist.

For a list of error codes, visit the Service error codes.