All Products
Search
Document Center

Cloud Config:Deliver resource data to an MNS topic

Last Updated:Feb 20, 2024

You can deliver resource change logs and resource non-compliance events as messages to a specific Message Service (MNS) topic in Cloud Config. You can also specify the push method and content of the topic.

Prerequisites

  • MNS is activated. For more information, see Activate MNS and authorize RAM users to access MNS.

    Important

    You are not charged for activating MNS. You are charged when Cloud Config delivers resource data to an MNS topic. For more information, see Pricing.

  • If you want to deliver large files to an Object Storage Service (OSS) bucket, you must activate OSS and create an OSS bucket. For more information, see Get started by using the OSS console.

    Note

    Make 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 MNS to incur costs, you can delete the MNS topic to which Cloud Config delivers resource data in the MNS console. After you delete the MNS topic, the delivery task in Cloud Config becomes invalid and the resource data is no longer delivered to the MNS topic. For more information, see the Delete a topic section of the "Manage topics in the console" topic.

Procedure

  1. Log on to the Cloud Config console.

  2. 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.

  3. In the left-side navigation pane, click Deliveries.

  4. On the Deliveries page, click Create Delivery in the upper-left corner.

  5. On the Create Delivery page, configure the Delivery Name parameter, set the Channel Type parameter to Message Notification Service, and then configure the parameters of MNS.

    The following table describes the parameters for resource data delivery.

    Parameter

    Description

    Content

    The type of the resource data that you want to deliver to the MNS 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 MNS 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 MNS topic.

    Topic Source

    The source of the MNS 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 MNS topic. If this value is selected 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 MNS 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.

      Note

      If 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 MNS topic.

    • If you configure this parameter, a message that Cloud Config delivers to the MNS 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 MNS topic is automatically discarded if the message size exceeds 64 KB.

  6. Click OK.

  7. (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.

    Note

    The newly created delivery task takes effect only on all member accounts 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.

  1. On the Deliveries page, click the newly created delivery ID.

  2. In the Extended Information section of the delivery details page, click the topic name.

    You are navigated to the Topics page in the MNS console. On the Topics page, you can specify the push method and content of the topic. For more information, see the Publish a message section of the "Manage topics in the console" topic.

    For more information about the example files in the JSON format, see Examples of resource change logs and Example of resource non-compliance events.