All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::MNS::Topics

Last Updated:Dec 02, 2024

DATASOURCE::MNS::Topics is used to query the information about topics.

Syntax

{
  "Type": "DATASOURCE::MNS::Topics",
  "Properties": {
    "TopicName": String,
    "RefreshOptions": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

TopicName

String

No

Yes

The topic name.

None.

RefreshOptions

String

No

Yes

The refresh policy for data source resources when the stack is updated.

Valid values:

  • Never (default): does not refresh data source resources when the stack is updated.

  • Always: refreshes data source resources when the stack is updated.

Return values (Fn::GetAtt)

Fn::GetAtt

  • TopicNames: the names of the topics.

  • Topics: details of the topics.

Property

Type

Description

Constraint

TopicNames

List

The names of the topics.

None.

Topics

List

Details of the topics.

None.

TopicName

String

The topic name.

The topic name must be unique within an account in a region. It can be up to 256 characters in length and can contain letters, digits, and hyphens (-). It must start with a letter.

MessageCount

Number

The number of messages in the topic.

None.

MaxMessageSize

Number

The maximum size of the message body that is sent to the topic.

Valid values: 1024 to 65536. A value of 1024 and a value of 65536 are separately equivalent to 1 KB and 64 KB.

Default value: 65536.

Unit: bytes.

MessageRetentionPeriod

Number

The maximum retention period of the message in the topic.

When the specified retention period ends, the message is deleted regardless of whether the message is pushed to the subscribers.

Unit: seconds.

CreateTime

String

The time when the topic was created.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.

LastModifyTime

String

The time when the topic was last modified.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.

LoggingEnabled

Boolean

Indicates whether the log management feature is enabled.

Valid values:

  • true

  • false (default)

Examples

  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "TopicName": {
          "Type": "String",
          "Description": "Topic name."
        }
      },
      "Resources": {
        "Topics": {
          "Type": "DATASOURCE::MNS::Topics",
          "Properties": {
            "TopicName": {
              "Ref": "TopicName"
            }
          }
        }
      },
      "Outputs": {
        "Topics": {
          "Description": "The list of topics.",
          "Value": {
            "Fn::GetAtt": [
              "Topics",
              "Topics"
            ]
          }
        },
        "TopicNames": {
          "Description": "The list of topic names.",
          "Value": {
            "Fn::GetAtt": [
              "Topics",
              "TopicNames"
            ]
          }
        }
      }
    }
  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      TopicName:
        Type: String
        Description: Topic name.
    Resources:
      Topics:
        Type: DATASOURCE::MNS::Topics
        Properties:
          TopicName:
            Ref: TopicName
    Outputs:
      Topics:
        Description: The list of topics.
        Value:
          Fn::GetAtt:
            - Topics
            - Topics
      TopicNames:
        Description: The list of topic names.
        Value:
          Fn::GetAtt:
            - Topics
            - TopicNames