Skip to content

Instantly share code, notes, and snippets.

@ctala
Created March 29, 2020 13:33
Show Gist options
  • Save ctala/78bf8e83344fa21b7587ac4e5b623a61 to your computer and use it in GitHub Desktop.
Save ctala/78bf8e83344fa21b7587ac4e5b623a61 to your computer and use it in GitHub Desktop.
Example of YAML file for Serverless framework to create SNS topics and export the name and the arn.
Resources:
SnsPostConfirm:
Type: "AWS::SNS::Topic"
Properties:
TopicName: ${self:custom.snsTopicPostConfirm}
DisplayName: Post Confirm User Cognito
Outputs:
#Name of the topic to use it from other resources
SnsPostConfirmNAME:
Description: The NAME for the SnsPostConfirm Topic
Value: ${self:custom.snsTopicPostConfirm}
Export:
Name: SnsPostConfirm-NAME-${opt:stage} # see Fn::ImportValue to use in other services and http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html for documentation on use.
SnsPostConfirmARN:
Description: The ARN for the SnsPostConfirm Topic
Value:
'Ref': "SnsPostConfirm"
Export:
Name: SnsPostConfirm-ARN-${opt:stage} # see Fn::ImportValue to use in other services and http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html for documentation on use.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment