mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
fix(cloudformation): populate SQS queue ARN in resource attributes (#396)
When provisioning AWS::SQS::Queue via CloudFormation, the resource's
'Arn' attribute was being read from Queue#getAttributes(), but QueueArn
is a computed attribute in SqsService#getQueueAttributes() — it is not
stored on the Queue object itself. As a result, the Arn attribute was
set to an empty string.
This broke Fn::GetAtt references to queue ARNs. For example, an
EventBridge Rule target built with CDK's SqsQueue target construct
would end up with an empty Arn, silently dropping all events:
"Targets": [{
"Arn": {"Fn::GetAtt": ["MyQueue", "Arn"]}
}]
Fix: build the ARN from region + accountId + queueName, matching the
format used by SqsService#getQueueAttributes.
Added integration test that verifies Fn::GetAtt resolves correctly
when used for an EventBridge Rule target ARN.
This commit is contained in:
1 parent
cd62fda111
commit
bc8caa43f8
2 files changed
+71
-1
No files matched your search
+4
-1
@@ -204,7 +204,10 @@ public class CloudFormationResourceProvisioner {
|
||||
attrs.put("VisibilityTimeout", engine.resolve(props.get("VisibilityTimeout")));
|
||||
}
|
||||
var queue = sqsService.createQueue(queueName, attrs, region);
|
||||
String queueArn = queue.getAttributes().getOrDefault("QueueArn", "");
|
||||
// QueueArn is computed on demand in SqsService#getQueueAttributes and is not
|
||||
// stored on the Queue object, so build it here from region + accountId + queueName.
|
||||
// Without this, Fn::GetAtt [Queue, Arn] references resolve to an empty string.
|
||||
String queueArn = "arn:aws:sqs:" + region + ":" + accountId + ":" + queueName;
|
||||
r.setPhysicalId(queue.getQueueUrl());
|
||||
r.getAttributes().put("Arn", queueArn);
|
||||
r.getAttributes().put("QueueName", queueName);
|
||||
|
||||
Reference in new issue
Block a user