Missing `hashQueueName` option
ryanwalters opened this issue · 2 comments
Our CI is failing with the following error:
Generated queue name [really-long-queue-name] is longer than 80 characters long and may be truncated by AWS, causing naming collisions. Try a shorter prefix or name, or try the hashQueueName config option.
However, I don't see this option in the documentation or in the source code. Does this option need to be configured somewhere outside of this plugin?
Hi @ryanwalters,
That is actually a typo, we need to get that fixed.
See also: #552 (comment)
We recommend using the omitPhysicalId
config option to solve that problem. From the README:
AWS allows you to omit the physical ID (queue name) for SQS resources.
In this case, the name is automatically generated by AWS based on the logical ID (the CloudFormation resource name).
This provides some benefits such as the ability to perform updates that require replacement, and not having to worry about the 80 character maximum length for queue names.
However, if you need to refer to the queue by name (which should be rare), rather than a CloudFormation reference, you might have to switch this off so that the name is stable.
https://github.com/agiledigital/serverless-sns-sqs-lambda#what-is-the-omitphysicalid-option
Let me know if enabling that solves your problem. Be careful enabling it for existing stacks if you're referring to queues by name, rather than by CloudFormation reference.
If not, we do have an open PR to enable hashing, which we could have another look at, but I think it would have the same drawbacks to omitPhysicalId
in that you couldn't refer to a queue by name anyway.
Thanks @NoxHarmonium, enabling that option fixed our issue.