question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fifo queue without name in nested stack fails to create

See original GitHub issue

Reproduction 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
    });
  }
}

source

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:open
  • Created 4 years ago
  • Reactions:10
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
nija-atcommented, Jan 22, 2020

How about setting the queueName to ${this.node.uniqueId.substr(0, 75)}.fifo when the fifo flag is set to true?

4reactions
NetaNircommented, Jul 29, 2020

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:

If you specify a name, you can’t perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found