You can deliver resource change logs and resource non-compliance events as messages to a specific Simple Message Queue (formerly MNS) topic in Cloud Config. You can also specify the push method and content of the topic based on your business requirements.
Prerequisites
SMQ is activated. For more information, see Activate SMQ and authorize RAM users to access SMQ.
ImportantYou are not charged for activating SMQ. You are charged when Cloud Config delivers resource data to an SMQ topic. For more information, see Billing.
Object Storage Service (OSS) is activated and an OSS bucket is created. This prerequisite must be met if you want to deliver large files to an OSS bucket. For more information, see Get started by using the OSS console.
NoteMake sure that the settings of the Region, Account, and Bucket Name parameters in the Recipient Address For Large Files section are the same as those of the recipient address for regular files.
Background information
If you do not want SMQ to generate fees, you can delete the SMQ topic to which Cloud Config delivers resource data in the SMQ console. After you delete the SMQ topic, the delivery task in Cloud Config becomes invalid and the resource data is no longer delivered to the SMQ topic. For more information, see Delete a topic.
Procedure
Log on to the Cloud Config console.
Optional. In the upper-left corner, select an account group.
This operation is required only if you are using a management account of a resource directory. Otherwise, you do not need to perform the operation.
In the left-side navigation pane, click
.On the Deliveries page, click Create Delivery in the upper-left corner.
On the Create Delivery page, configure the Delivery Name parameter, set Channel Type to Simple Message Queue (formerly MNS), and then configure the parameters.
The following table describes the parameters for resource data delivery.
Parameter
Description
Content
The type of resource data that you want to deliver to the SMQ topic. Valid values:
Historical Configuration Changes: resource change logs. When the configuration of a resource changes, Cloud Config delivers the resource change log to the SMQ topic.
Noncompliance Resource Events: resource non-compliance events. If a resource is evaluated as non-compliant, Cloud Config delivers the resource non-compliance event to the SMQ topic.
Topic Source
The source of the SMQ topic. Valid values:
Create a topic in the account: Creates a topic in the Cloud Config console. If this value is selected for this parameter, you must specify a topic name, region, and maximum message length, and then enable logging. The topic name must be unique within the account in the specified region.
Select an existing topic from the account: Selects an existing SMQ topic. If you select this value for this parameter, you must select the topic name and region, specify the maximum message length, and then enable logging.
Select an existing topic from other enterprise management accounts or delegated accounts: the Alibaba Cloud Resource Name (ARN) of the Logstore in the destination account. This parameter is displayed only if you log on to the SQM console by using a management account or delegated management account. The ARN contains the following information: region, member account, and topic name.
You can deliver the resource data of your account and all member accounts in the resource directory to a topic within a specific member account. You can use only management accounts to configure the settings to deliver resource data. Member accounts do not have the permissions to configure the settings.
NoteIf a delegated administrator account is configured by using a management account, the administrator account can be used to configure resource data delivery. For more information, see Add a delegated administrator account.
Minimum Risk Level of the Events to Subscribe
The lowest risk level of the events to which you want to subscribe. Valid values:
All Levels
High
Medium
Low
For example, if you set this parameter to Medium, Cloud Config delivers non-compliance events at the Medium and High levels. Non-compliance events at the Low level are ignored.
Events Of Specified Resource Type
The resource type of the data that you want to deliver. For more information about the resource types supported by Cloud Config, see Alibaba Cloud services and resource types supported by Cloud Config.
Recipient Address For Large Files
The OSS bucket that is used to receive the large messages that Cloud Config delivers to the SMQ topic.
If you configure this parameter, a message that Cloud Config delivers to the SMQ topic is automatically transferred to the specified OSS bucket when the message size exceeds 64 KB.
If you leave this parameter empty, the excess part of a message that Cloud Config delivers to the SMQ topic is automatically discarded when the message size exceeds 64 KB.
Click OK.
Optional. In the Confirm Operation dialog box, click OK.
This operation is required only if you are using a management account of a resource directory. Otherwise, you do not need to perform the operation.
NoteThe newly created delivery task takes effect only on all members in the account group.
What to do next
View the result of resource data delivery and download the JSON file that contains the delivered data.
On the Deliveries page, click the newly created delivery ID.
In the Extended Information section of the delivery details page, click the topic name.
You are redirected to the Topics page in the SMQ console. On the Topics page, you can specify the push method and content of the topic. For more information, see Publish a message.
For more information about sample files in the JSON format, see Examples of resource change logs and Example of resource non-compliance events.