All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::MNS::Topic

Last Updated:Feb 05, 2025

DATASOURCE::MNS::Topic is used to query the information about a topic.

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

TopicName

String

Yes

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

  • MessageRetentionPeriod: the maximum retention time period of the message in the topic.

  • CreateTime: the time when the topic was created.

  • TopicUrl: the public URL of the topic.

  • MaxMessageSize: the maximum size of the message body that is sent to the topic.

  • LastModifyTime: the most recent time when the topic was modified.

  • MessageCount: the number of messages in the topic.

  • TopicInnerUrl: the private URL of the topic.

  • LoggingEnabled: indicates whether the logging feature is enabled.

  • TopicName: the topic name.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  TopicName:
    Type: String
    Description:
      en: The name of the resource.
    Required: true
Resources:
  ExtensionDataSource:
    Type: DATASOURCE::MNS::Topic
    Properties:
      TopicName:
        Ref: TopicName
Outputs:
  MessageRetentionPeriod:
    Description: The retention period of the message in the topic.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - MessageRetentionPeriod
  CreateTime:
    Description: The time when the topic was created.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - CreateTime
  TopicUrl:
    Description: The URL of the topic.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - TopicUrl
  MaxMessageSize:
    Description: The maximum size of a message body that is sent to the topic.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - MaxMessageSize
  LastModifyTime:
    Description: The time when the topic was last modified.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - LastModifyTime
  MessageCount:
    Description: The number of messages in the topic.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - MessageCount
  TopicInnerUrl:
    Description: The internal URL of the topic.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - TopicInnerUrl
  LoggingEnabled:
    Description: Indicates whether the log management feature is enabled for the topic.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - LoggingEnabled
  TopicName:
    Description: The name of the MNS topic.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - TopicName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "TopicName": {
      "Type": "String",
      "Description": {
        "en": "The name of the resource."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::MNS::Topic",
      "Properties": {
        "TopicName": {
          "Ref": "TopicName"
        }
      }
    }
  },
  "Outputs": {
    "MessageRetentionPeriod": {
      "Description": "The retention period of the message in the topic.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "MessageRetentionPeriod"
        ]
      }
    },
    "CreateTime": {
      "Description": "The time when the topic was created.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "CreateTime"
        ]
      }
    },
    "TopicUrl": {
      "Description": "The URL of the topic.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "TopicUrl"
        ]
      }
    },
    "MaxMessageSize": {
      "Description": "The maximum size of a message body that is sent to the topic.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "MaxMessageSize"
        ]
      }
    },
    "LastModifyTime": {
      "Description": "The time when the topic was last modified.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "LastModifyTime"
        ]
      }
    },
    "MessageCount": {
      "Description": "The number of messages in the topic.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "MessageCount"
        ]
      }
    },
    "TopicInnerUrl": {
      "Description": "The internal URL of the topic.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "TopicInnerUrl"
        ]
      }
    },
    "LoggingEnabled": {
      "Description": "Indicates whether the log management feature is enabled for the topic.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "LoggingEnabled"
        ]
      }
    },
    "TopicName": {
      "Description": "The name of the MNS topic.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "TopicName"
        ]
      }
    }
  }
}