Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQS - Unknown Attribute FifoQueue when setting fifo to false in Queue Props #8550

Closed
HassanMahmud opened this issue Jun 15, 2020 · 22 comments · Fixed by #31922
Closed

SQS - Unknown Attribute FifoQueue when setting fifo to false in Queue Props #8550

HassanMahmud opened this issue Jun 15, 2020 · 22 comments · Fixed by #31922
Labels
@aws-cdk/aws-sqs Related to Amazon Simple Queue Service blocked Work is blocked on this issue for this codebase. Other labels or comments may indicate why. bug This issue is a bug. needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed. p2

Comments

@HassanMahmud
Copy link

Setting fifo to false in QueueProps when creating an SQS queue causes the deploy to fail.

Reproduction Steps

This is the code used to create the queue. It is part of a reusable component, I have made a workaround of only setting the fifo prop if it is set to true and everything works as expected.

return new sqs.Queue(stack, name, {
      encryption: encrypted ? sqs.QueueEncryption.KMS_MANAGED : sqs.QueueEncryption.UNENCRYPTED,
      fifo,
      queueName: name,
      retentionPeriod,
      visibilityTimeout
    });

Error Log

This error shows up under CloudFormation events as the reason why creating the queue failed.
Unknown Attribute FifoQueue. (Service: AmazonSQS; Status Code: 400; Error Code: InvalidAttributeName; Request ID: <REQUEST_ID>)

Environment

  • CLI Version : 1.45.0
  • Framework Version: 1.45.0
  • Node.js Version: v14.3.0
  • OS : macOS Catalina v10.15.15
  • Language (Version): TypeScript (^3.9.5)

Other

I found a similar issue report here: AWS PHP SDK Github issue


This is 🐛 Bug Report

@HassanMahmud HassanMahmud added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 15, 2020
@SomayaB SomayaB added the @aws-cdk/aws-sqs Related to Amazon Simple Queue Service label Jun 17, 2020
@MrArnoldPalmer
Copy link
Contributor

MrArnoldPalmer commented Jun 17, 2020

Hey there. Looks like this is a known issue with cloudformation. They have an issue in their roadmap for it.

We can potentially perform some logic inside of the construct to pass undefined to the L1 when the user passes false to cover this from our side. I can't imagine that causing any conflicts in the future. @eladb opinions on diverging from CFN here to prevent this error? Should be non-breaking as far as I can tell.

That is exactly what you're workaround is doing but one level higher. Anyone else encountering this can do that as well in the meantime.

@MrArnoldPalmer MrArnoldPalmer added p2 and removed needs-triage This issue or PR still needs to be triaged. labels Jun 17, 2020
@MrArnoldPalmer MrArnoldPalmer added the effort/small Small work item – less than a day of effort label Aug 17, 2020
@suankan
Copy link

suankan commented Oct 4, 2020

I've just bumped into this issue as well.

It would make a lot of sense to reflect this in the docs.
Currently docs for interface QueueProps reads: fifo? | boolean.
Would be better to make it some enum like true or undefined.

@bitsofinfo
Copy link

experience same

@emekdahl
Copy link

bump - also ran into this issue

@ParallelPlatypus
Copy link

bump - same issue, in python 3.7 using:

 self._queue=sqs.Queue(
            scope, 
            QUEUE_ID_PREFIX + name, 
            fifo=True if FIFO_ENABLED else None,
            removal_policy=REMOVAL_POLICY
        )

fixed this for me.

@JordanRickman
Copy link

same, Python 3.9

@z00dev
Copy link

z00dev commented Sep 23, 2021

Had the same issue, python 3.9, still unclear that it needs None

@noam-alchemy
Copy link

Seeing this as well in typescript.

@emmavray
Copy link

Seeing this as well. The documentation is literally incorrect in claiming that FifoQueue is boolean.

@jmurzy
Copy link

jmurzy commented Feb 8, 2022

Same issue when contentBasedDeduplication=false.

@wilhen01
Copy link
Contributor

Just encountered this in CDK v2 using Typescript. Agree with comments elsewhere in the thread - update docs and/or make this an enum of true | undefined. Minor issue but easily fixed.

@gwin003
Copy link

gwin003 commented Aug 1, 2022

Also ran into this in CDK v2 Typescript. Not exactly the same issue since my FifoQueue is currently always false, but I just removed the property altogether and it solved my issue.

@JussiLem
Copy link

Hello. Saw the same issue here and yeah removing the property helps, but still confusing

@github-actions
Copy link

github-actions bot commented Apr 2, 2023

This issue has received a significant amount of attention so we are automatically upgrading its priority. A member of the community will see the re-prioritization and provide an update on the issue.

@peterwoodworth
Copy link
Contributor

It appears this issue has moved to Coming Soon on the CloudFormation roadmap. We should continue to wait for CloudFormation to push this as it appears the wait will not be much longer

@peterwoodworth peterwoodworth added needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed. and removed p1 labels Apr 18, 2023
@peterwoodworth peterwoodworth added p2 blocked Work is blocked on this issue for this codebase. Other labels or comments may indicate why. and removed effort/small Small work item – less than a day of effort labels Apr 18, 2023
@cyber-gh
Copy link

Workaround in Typescript CDK

const additionalProperties = props.fifo
            ? {
                  fifo: true,
              }
            : {};

queue = new aws_sqs.Queue(this, `SomeQueue`, {
            queueName: name,
            ...additionalProperties
})

@mappingvermont
Copy link

Any movement on this?

@matt-challe
Copy link

Bump, same issue. Fixed using @ParallelPlatypus's method (thank you!)
fifo=True if fifo_enabled==True else None

@lennard0011
Copy link

Bump, had to remove the property fifo as it was set to false. Can we get an ETA when this is resolved in CDK?

@oappicgi
Copy link

oappicgi commented Jul 4, 2024

This is still an issue.

imo it should not accept undefined at all, but I guess now that people are required to use it it should be marked as deprecated and only accept true/false after few versions.

I've just bumped into this issue as well.

It would make a lot of sense to reflect this in the docs. Currently docs for interface QueueProps reads: fifo? | boolean. Would be better to make it some enum like true or undefined.

or even better: make it work like other constructs by allowing only boolean values and adjust documentation accordingly.

in the meantime I added function that i can call to hide the inconsistency.

function fixCDKBooleanLogic(isValueTrue: boolean): boolean | undefined {
if (isValueTrue) {
return true;
} else {
return undefined;
}
}

and calling it from sqs construct, where props.fifotype is boolean value.
new sqs.Queue(this, fine-sqs-queue, {
fifo: fixCDKBooleanLogic(props.fifotype),
...
}

rix0rrr added a commit that referenced this issue Oct 28, 2024
The `FifoQueue` property in CloudFormation can only be `true`, or
must be absent.

Make it so that a `fifo: false` configuration doesn't output FifoQueue
at all.

Closes #8550.
@mergify mergify bot closed this as completed in #31922 Oct 28, 2024
@mergify mergify bot closed this as completed in a9d3b02 Oct 28, 2024
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

1 similar comment
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-sqs Related to Amazon Simple Queue Service blocked Work is blocked on this issue for this codebase. Other labels or comments may indicate why. bug This issue is a bug. needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.