#Get Topic Subscription Arn Cloudformation Custom Resource to find SNS topic subscription arn.
#required
TopicArn: topic arn which should be queried
Endpoint: endpoint as matching criteria
##Output
Arn: Founded subscription arn
Throws error when:
- no subscription arn will be founded
- more than one subscription arn will be founded
- SetSubscriptionAttributes
##Example
GetTopicSubscriptionArn:
Type: "Custom::GetTopicSubscriptionArn"
Properties:
ServiceToken:
!Sub |
arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${LambdaFunctionName}
TopicArn: Ref(Topic)
Endpoint: GetAtt(LambdaWhichIsSubscribed,'Arn')
StackName:
Ref: "StackName"
An Endpoint must be unique in the topic subscription list.