In one Cloudformation template, I create an SNS topic and export it. Note that you cannot export an SNS topic's Arn
because that attribute is not available to GetAtt
on docs.
BaseStack
Outputs:
AlarmSNSTopic:
Description: Arn for SNS topic related to alarms
Export:
Name: AlarmSNSTopic
Value: { "Fn::GetAtt": ["MyAlarmSNSTopic", "TopicName"] }
Then in a different template, I try to reference that export with something like:
Functional Stack 1
InputQueueNoMessages:
Type: AWS::CloudWatch::Alarm
Properties:
AlarmDescription: Some Alarm
...
AlarmActions:
Fn::ImportValue: AlarmSNSTopic
When I do, Cloudformation tells me that it expects an ARN, not the topic name.
Invalid arn syntax: Blah-AlarmSNSTopic-random
Is this possible? Am I missing something?
AWS::CloudWatch::Alarm
requires an ARN for AlarmActions
, but you exported the topic name. The value of your output should be the ARN.
Outputs:
AlarmSNSTopic:
Description: Arn for SNS topic related to alarms
Export:
Name: AlarmSNSTopic
Value: !Ref MyAlarmSNSTopic
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With