Fifo queue without name in nested stack fails to create
See original GitHub issueReproduction Steps
import cdk = require('@aws-cdk/core');
import { NestedStack } from '@aws-cdk/aws-cloudformation';
import { Queue } from '@aws-cdk/aws-sqs';
export class CdkFifoQueueStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
new MyNestedStack(this, 'NestedStack');
}
}
export class MyNestedStack extends NestedStack {
constructor(scope: cdk.Construct, id: string) {
super(scope, id);
new Queue(this, 'MyQueue', {
fifo: true
});
}
}
MUST USE cdk deploy
. THE STACK SYNTHESIZES FINE.
Error Log
CloudFormation error after running cdk deploy
:
The name of a FIFO queue can only include alphanumeric characters, hyphens, or underscores, must end with .fifo suffix and be 1 to 80 in length. (Service: AmazonSQS; Status Code: 400; Error Code: InvalidParameterValue; Request ID: 0079e079-6bf5-5eec-90d9-b6e4eebec170)
Environment
- CLI Version : 1.19.0
- Framework Version: 1.19.0
- OS : macOS
- Language : TypeScript
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:5 (5 by maintainers)
Top Results From Across the Web
AWS::SQS::Queue - AWS CloudFormation
To successfully create a new queue, you must provide a queue name that adheres to the limits related to queues and is unique...
Read more >Creating FIFO SQS queue with cloudformation - Stack Overflow
I get the following error: Unknown Attribute FifoQueue. If I delete the last name, for the Queue Name, I get:The name of a...
Read more >CloudFormation Nested Stacks Archives
Nested stacks are stacks created as part of other stacks. A nested stack can be created within another stack by using the AWS::CloudFormation:: ......
Read more >awssqs - Go Packages
Returns: The construct as a stack element or undefined if it is not a stack ... To create a FIFO queue, the name...
Read more >What I learned using the AWS CDK in the past year - Tech Blog
The High Level Module does not provide an easy way to create a secret ... A better way to structure AWS CDK projects...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
How about setting the queueName to
${this.node.uniqueId.substr(0, 75)}.fifo
when thefifo
flag is set to true?The queue name is it’s physical ID, when not required, the CDK will not set it, unless provided by the user. Setting a physical name for a resource have implication on the resource update policy, from CloudFormation docs:
Which is why we try to avoid setting a physical name for resources when not required. We will follow up with CloudFormation to see if this can be fixed on their side.
In the meantime we can implement @nija-at suggestion above.