AWS Native is in preview. AWS Classic is fully supported.
aws-native.sns.getTopic
Explore with Pulumi AI
AWS Native is in preview. AWS Classic is fully supported.
The AWS::SNS::Topic
resource creates a topic to which notifications can be published.
One account can create a maximum of 100,000 standard topics and 1,000 FIFO topics. For more information, see endpoints and quotas in the General Reference.
The structure of AUTHPARAMS
depends on the .signature of the API request. For more information, see Examples of the complete Signature Version 4 signing process in the General Reference.
Using getTopic
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getTopic(args: GetTopicArgs, opts?: InvokeOptions): Promise<GetTopicResult>
function getTopicOutput(args: GetTopicOutputArgs, opts?: InvokeOptions): Output<GetTopicResult>
def get_topic(topic_arn: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetTopicResult
def get_topic_output(topic_arn: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetTopicResult]
func LookupTopic(ctx *Context, args *LookupTopicArgs, opts ...InvokeOption) (*LookupTopicResult, error)
func LookupTopicOutput(ctx *Context, args *LookupTopicOutputArgs, opts ...InvokeOption) LookupTopicResultOutput
> Note: This function is named LookupTopic
in the Go SDK.
public static class GetTopic
{
public static Task<GetTopicResult> InvokeAsync(GetTopicArgs args, InvokeOptions? opts = null)
public static Output<GetTopicResult> Invoke(GetTopicInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetTopicResult> getTopic(GetTopicArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws-native:sns:getTopic
arguments:
# arguments dictionary
The following arguments are supported:
- Topic
Arn string
- Topic
Arn string
- topic
Arn String
- topic
Arn string
- topic_
arn str
- topic
Arn String
getTopic Result
The following output properties are available:
- Archive
Policy object The archive policy determines the number of days SNS retains messages. You can set a retention period from 1 to 365 days.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- Content
Based boolDeduplication - Enables content-based deduplication for FIFO topics.
- By default,
ContentBasedDeduplication
is set tofalse
. If you create a FIFO topic and this attribute isfalse
, you must specify a value for theMessageDeduplicationId
parameter for the Publish action. - When you set
ContentBasedDeduplication
totrue
, SNS uses a SHA-256 hash to generate theMessageDeduplicationId
using the body of the message (but not the attributes of the message). (Optional) To override the generated value, you can specify a value for the theMessageDeduplicationId
parameter for thePublish
action.
- By default,
- Data
Protection objectPolicy The body of the policy document you want to use for this topic. You can only add one policy per topic. The policy must be in JSON string format. Length Constraints: Maximum length of 30,720.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- Delivery
Status List<Pulumi.Logging Aws Native. Sns. Outputs. Topic Logging Config> - Display
Name string - The display name to use for an SNS topic with SMS subscriptions. The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs.
- Kms
Master stringKey Id - The ID of an AWS managed customer master key (CMK) for SNS or a custom CMK. For more information, see Key terms. For more examples, see
KeyId
in the API Reference. This property applies only to server-side-encryption. - Signature
Version string - The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS. By default,
SignatureVersion
is set to1
. - Subscription
List<Pulumi.
Aws Native. Sns. Outputs. Topic Subscription> - The SNS subscriptions (endpoints) for this topic.
If you specify the
Subscription
property in theAWS::SNS::Topic
resource and it creates an associated subscription resource, the associated subscription is not deleted when theAWS::SNS::Topic
resource is deleted. - List<Pulumi.
Aws Native. Outputs. Tag> - The list of tags to add to a new topic.
To be able to tag a topic on creation, you must have the
sns:CreateTopic
andsns:TagResource
permissions. - Topic
Arn string - Tracing
Config string - Tracing mode of an SNS topic. By default
TracingConfig
is set toPassThrough
, and the topic passes through the tracing header it receives from an SNS publisher to its subscriptions. If set toActive
, SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true.
- Archive
Policy interface{} The archive policy determines the number of days SNS retains messages. You can set a retention period from 1 to 365 days.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- Content
Based boolDeduplication - Enables content-based deduplication for FIFO topics.
- By default,
ContentBasedDeduplication
is set tofalse
. If you create a FIFO topic and this attribute isfalse
, you must specify a value for theMessageDeduplicationId
parameter for the Publish action. - When you set
ContentBasedDeduplication
totrue
, SNS uses a SHA-256 hash to generate theMessageDeduplicationId
using the body of the message (but not the attributes of the message). (Optional) To override the generated value, you can specify a value for the theMessageDeduplicationId
parameter for thePublish
action.
- By default,
- Data
Protection interface{}Policy The body of the policy document you want to use for this topic. You can only add one policy per topic. The policy must be in JSON string format. Length Constraints: Maximum length of 30,720.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- Delivery
Status []TopicLogging Logging Config - Display
Name string - The display name to use for an SNS topic with SMS subscriptions. The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs.
- Kms
Master stringKey Id - The ID of an AWS managed customer master key (CMK) for SNS or a custom CMK. For more information, see Key terms. For more examples, see
KeyId
in the API Reference. This property applies only to server-side-encryption. - Signature
Version string - The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS. By default,
SignatureVersion
is set to1
. - Subscription
[]Topic
Subscription - The SNS subscriptions (endpoints) for this topic.
If you specify the
Subscription
property in theAWS::SNS::Topic
resource and it creates an associated subscription resource, the associated subscription is not deleted when theAWS::SNS::Topic
resource is deleted. - Tag
- The list of tags to add to a new topic.
To be able to tag a topic on creation, you must have the
sns:CreateTopic
andsns:TagResource
permissions. - Topic
Arn string - Tracing
Config string - Tracing mode of an SNS topic. By default
TracingConfig
is set toPassThrough
, and the topic passes through the tracing header it receives from an SNS publisher to its subscriptions. If set toActive
, SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true.
- archive
Policy Object The archive policy determines the number of days SNS retains messages. You can set a retention period from 1 to 365 days.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- content
Based BooleanDeduplication - Enables content-based deduplication for FIFO topics.
- By default,
ContentBasedDeduplication
is set tofalse
. If you create a FIFO topic and this attribute isfalse
, you must specify a value for theMessageDeduplicationId
parameter for the Publish action. - When you set
ContentBasedDeduplication
totrue
, SNS uses a SHA-256 hash to generate theMessageDeduplicationId
using the body of the message (but not the attributes of the message). (Optional) To override the generated value, you can specify a value for the theMessageDeduplicationId
parameter for thePublish
action.
- By default,
- data
Protection ObjectPolicy The body of the policy document you want to use for this topic. You can only add one policy per topic. The policy must be in JSON string format. Length Constraints: Maximum length of 30,720.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- delivery
Status List<TopicLogging Logging Config> - display
Name String - The display name to use for an SNS topic with SMS subscriptions. The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs.
- kms
Master StringKey Id - The ID of an AWS managed customer master key (CMK) for SNS or a custom CMK. For more information, see Key terms. For more examples, see
KeyId
in the API Reference. This property applies only to server-side-encryption. - signature
Version String - The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS. By default,
SignatureVersion
is set to1
. - subscription
List<Topic
Subscription> - The SNS subscriptions (endpoints) for this topic.
If you specify the
Subscription
property in theAWS::SNS::Topic
resource and it creates an associated subscription resource, the associated subscription is not deleted when theAWS::SNS::Topic
resource is deleted. - List<Tag>
- The list of tags to add to a new topic.
To be able to tag a topic on creation, you must have the
sns:CreateTopic
andsns:TagResource
permissions. - topic
Arn String - tracing
Config String - Tracing mode of an SNS topic. By default
TracingConfig
is set toPassThrough
, and the topic passes through the tracing header it receives from an SNS publisher to its subscriptions. If set toActive
, SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true.
- archive
Policy any The archive policy determines the number of days SNS retains messages. You can set a retention period from 1 to 365 days.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- content
Based booleanDeduplication - Enables content-based deduplication for FIFO topics.
- By default,
ContentBasedDeduplication
is set tofalse
. If you create a FIFO topic and this attribute isfalse
, you must specify a value for theMessageDeduplicationId
parameter for the Publish action. - When you set
ContentBasedDeduplication
totrue
, SNS uses a SHA-256 hash to generate theMessageDeduplicationId
using the body of the message (but not the attributes of the message). (Optional) To override the generated value, you can specify a value for the theMessageDeduplicationId
parameter for thePublish
action.
- By default,
- data
Protection anyPolicy The body of the policy document you want to use for this topic. You can only add one policy per topic. The policy must be in JSON string format. Length Constraints: Maximum length of 30,720.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- delivery
Status TopicLogging Logging Config[] - display
Name string - The display name to use for an SNS topic with SMS subscriptions. The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs.
- kms
Master stringKey Id - The ID of an AWS managed customer master key (CMK) for SNS or a custom CMK. For more information, see Key terms. For more examples, see
KeyId
in the API Reference. This property applies only to server-side-encryption. - signature
Version string - The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS. By default,
SignatureVersion
is set to1
. - subscription
Topic
Subscription[] - The SNS subscriptions (endpoints) for this topic.
If you specify the
Subscription
property in theAWS::SNS::Topic
resource and it creates an associated subscription resource, the associated subscription is not deleted when theAWS::SNS::Topic
resource is deleted. - Tag[]
- The list of tags to add to a new topic.
To be able to tag a topic on creation, you must have the
sns:CreateTopic
andsns:TagResource
permissions. - topic
Arn string - tracing
Config string - Tracing mode of an SNS topic. By default
TracingConfig
is set toPassThrough
, and the topic passes through the tracing header it receives from an SNS publisher to its subscriptions. If set toActive
, SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true.
- archive_
policy Any The archive policy determines the number of days SNS retains messages. You can set a retention period from 1 to 365 days.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- content_
based_ booldeduplication - Enables content-based deduplication for FIFO topics.
- By default,
ContentBasedDeduplication
is set tofalse
. If you create a FIFO topic and this attribute isfalse
, you must specify a value for theMessageDeduplicationId
parameter for the Publish action. - When you set
ContentBasedDeduplication
totrue
, SNS uses a SHA-256 hash to generate theMessageDeduplicationId
using the body of the message (but not the attributes of the message). (Optional) To override the generated value, you can specify a value for the theMessageDeduplicationId
parameter for thePublish
action.
- By default,
- data_
protection_ Anypolicy The body of the policy document you want to use for this topic. You can only add one policy per topic. The policy must be in JSON string format. Length Constraints: Maximum length of 30,720.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- delivery_
status_ Sequence[Topiclogging Logging Config] - display_
name str - The display name to use for an SNS topic with SMS subscriptions. The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs.
- kms_
master_ strkey_ id - The ID of an AWS managed customer master key (CMK) for SNS or a custom CMK. For more information, see Key terms. For more examples, see
KeyId
in the API Reference. This property applies only to server-side-encryption. - signature_
version str - The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS. By default,
SignatureVersion
is set to1
. - subscription
Sequence[Topic
Subscription] - The SNS subscriptions (endpoints) for this topic.
If you specify the
Subscription
property in theAWS::SNS::Topic
resource and it creates an associated subscription resource, the associated subscription is not deleted when theAWS::SNS::Topic
resource is deleted. - Sequence[root_Tag]
- The list of tags to add to a new topic.
To be able to tag a topic on creation, you must have the
sns:CreateTopic
andsns:TagResource
permissions. - topic_
arn str - tracing_
config str - Tracing mode of an SNS topic. By default
TracingConfig
is set toPassThrough
, and the topic passes through the tracing header it receives from an SNS publisher to its subscriptions. If set toActive
, SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true.
- archive
Policy Any The archive policy determines the number of days SNS retains messages. You can set a retention period from 1 to 365 days.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- content
Based BooleanDeduplication - Enables content-based deduplication for FIFO topics.
- By default,
ContentBasedDeduplication
is set tofalse
. If you create a FIFO topic and this attribute isfalse
, you must specify a value for theMessageDeduplicationId
parameter for the Publish action. - When you set
ContentBasedDeduplication
totrue
, SNS uses a SHA-256 hash to generate theMessageDeduplicationId
using the body of the message (but not the attributes of the message). (Optional) To override the generated value, you can specify a value for the theMessageDeduplicationId
parameter for thePublish
action.
- By default,
- data
Protection AnyPolicy The body of the policy document you want to use for this topic. You can only add one policy per topic. The policy must be in JSON string format. Length Constraints: Maximum length of 30,720.
Search the CloudFormation User Guide for
AWS::SNS::Topic
for more information about the expected schema for this property.- delivery
Status List<Property Map>Logging - display
Name String - The display name to use for an SNS topic with SMS subscriptions. The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs.
- kms
Master StringKey Id - The ID of an AWS managed customer master key (CMK) for SNS or a custom CMK. For more information, see Key terms. For more examples, see
KeyId
in the API Reference. This property applies only to server-side-encryption. - signature
Version String - The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS. By default,
SignatureVersion
is set to1
. - subscription List<Property Map>
- The SNS subscriptions (endpoints) for this topic.
If you specify the
Subscription
property in theAWS::SNS::Topic
resource and it creates an associated subscription resource, the associated subscription is not deleted when theAWS::SNS::Topic
resource is deleted. - List<Property Map>
- The list of tags to add to a new topic.
To be able to tag a topic on creation, you must have the
sns:CreateTopic
andsns:TagResource
permissions. - topic
Arn String - tracing
Config String - Tracing mode of an SNS topic. By default
TracingConfig
is set toPassThrough
, and the topic passes through the tracing header it receives from an SNS publisher to its subscriptions. If set toActive
, SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true.
Supporting Types
Tag
TopicLoggingConfig
TopicLoggingConfigProtocol
TopicSubscription
- Endpoint string
- The endpoint that receives notifications from the SNS topic. The endpoint value depends on the protocol that you specify. For more information, see the
Endpoint
parameter of theSubscribe
action in the API Reference. - Protocol string
- The subscription's protocol. For more information, see the
Protocol
parameter of theSubscribe
action in the API Reference.
- Endpoint string
- The endpoint that receives notifications from the SNS topic. The endpoint value depends on the protocol that you specify. For more information, see the
Endpoint
parameter of theSubscribe
action in the API Reference. - Protocol string
- The subscription's protocol. For more information, see the
Protocol
parameter of theSubscribe
action in the API Reference.
- endpoint String
- The endpoint that receives notifications from the SNS topic. The endpoint value depends on the protocol that you specify. For more information, see the
Endpoint
parameter of theSubscribe
action in the API Reference. - protocol String
- The subscription's protocol. For more information, see the
Protocol
parameter of theSubscribe
action in the API Reference.
- endpoint string
- The endpoint that receives notifications from the SNS topic. The endpoint value depends on the protocol that you specify. For more information, see the
Endpoint
parameter of theSubscribe
action in the API Reference. - protocol string
- The subscription's protocol. For more information, see the
Protocol
parameter of theSubscribe
action in the API Reference.
- endpoint str
- The endpoint that receives notifications from the SNS topic. The endpoint value depends on the protocol that you specify. For more information, see the
Endpoint
parameter of theSubscribe
action in the API Reference. - protocol str
- The subscription's protocol. For more information, see the
Protocol
parameter of theSubscribe
action in the API Reference.
- endpoint String
- The endpoint that receives notifications from the SNS topic. The endpoint value depends on the protocol that you specify. For more information, see the
Endpoint
parameter of theSubscribe
action in the API Reference. - protocol String
- The subscription's protocol. For more information, see the
Protocol
parameter of theSubscribe
action in the API Reference.
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
AWS Native is in preview. AWS Classic is fully supported.