Menu
Amazon Simple Notification Service
CLI Reference (API Version 2010-03-31)

sns-get-topic-attributes

The Amazon SNS CLI has been deprecated and is no longer supported. Please use the AWS Unified CLI or the AWS Tools for Windows PowerShell instead. To map the old SNS CLI commands to the AWS Unified CLI or PowerShell, see Migrating Amazon SNS CLI Commands to AWS CLI and PowerShell Commands.

Description

Returns all the attributes of a topic.

Syntax

Copy
sns-get-topic-attributes TopicArn [General Options]

Options

Name Description Required

TopicArn

The ARN of the topic whose attributes you want to return.

Yes

Output

Returns the following information:

  • topic owner

  • number of pending subscriptions

  • topic policy

  • number of confirmed subscriptions

  • number of deleted subscriptions

  • topic ARN

Examples

Example Request

This example returns a list of attributes from a topic with ARN arn:aws:sns:us-east-1:365928882516:Foo.

Copy
$PROMPT> sns-get-topic-attributes arn:aws:sns:us-east-1:365928882516:Foo

Example Response

Copy
Owner 054794666394 SubscriptionsPending 0 Policy {"Version":"2012-10-17","Id":"__default_policy_ID", "Statement":[{"Sid":"__default_statement_ID","Effect":"Allow","Principal":{ "AWS":"*"},"Action":["SNS:Publish","SNS:RemovePermission","SNS:SetTopicAttr ibutes","SNS:DeleteTopic","SNS:ListSubscriptionsByTopic","SNS:GetTopicAttri butes","SNS:Receive","SNS:AddPermission","SNS:Subscribe"],"Resource":"arn:a ws:sns:us-east-1:054794666394:Foo","Condition":{"StringEquals":{"AWS:So urceOwner":"054794666394"}}}]} SubscriptionsConfirmed 2 SubscriptionsDeleted 0 TopicArn arn:aws:sns:us-east-1:054794666394:Foo