Reputation: 462
I have an SQS Queue ARN as an input to my CloudFormation template, How do I reference Queue Name or URL from Queue ARN?
In other words, how do I get a CloudFormation Logical Queue from the ARN?(so that I can use GetAtt to reference all the attributes)
Upvotes: 1
Views: 3379
Reputation: 2678
Assuming you can't pass in the name from whatever is creating the queue, then you can get the queue name from the arn. Use Fn::Split to split the arn on colons. Then use Fn::Select to select the last string in the list. This will be something like
{ "Fn::Select" : [ "5", { "Fn::Split": [":", {"Fn::Sub": "QueueArn"}]}] }
See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html for a full list of the functions you can use.
Upvotes: 1