sst: Default tags for SNS problem
Heyall! I’m using SST for lots of projects in Prod since early 2022, and everything’s flawless so far. Yesterday our builds (for dev and PRs - prob PROD as well [haven’t tested it yet]) started to break in one part of the code that was not changed in a long time. We have a very simple SNS topic in our stack:
const guestEventTopic = new sst.Topic(this, 'guest-event-sns', {
cdk: {
topic: {
topicName: RESOURCE.SNS.GUEST_EVENT,
},
},
});
And since yesterday we are getting this error:
***stackname*** failed: Properties validation failed for resource guesteventsnsTopic1FRD23DS with message:
#/Tags/0/Key: failed validation constraint for keyword [pattern]
#/Tags/1/Key: failed validation constraint for keyword [pattern]
Is there any known problem around this? Or am I missing something?
Investigation points so far:
1 - There are only 2 default tags created for all the resources: sst:app and sst:stack.
2 - Version used:
"@aws-cdk/aws-apigatewayv2-alpha": "2.24.0-alpha.0",
"@aws-cdk/aws-apigatewayv2-authorizers-alpha": "2.24.0-alpha.0",
"@serverless-stack/cli": "1.2.18",
"@serverless-stack/resources": "1.2.18",
"aws-cdk-lib": "2.24.0"
Tried with latest versions as well, but no luck:
"@aws-cdk/aws-apigatewayv2-alpha": "2.32.0-alpha.0",
"@aws-cdk/aws-apigatewayv2-authorizers-alpha": "2.32.0-alpha.0",
"@serverless-stack/cli": "1.7.0",
"@serverless-stack/resources": "1.7.0",
"aws-cdk-lib": "2.32.0"
3 - For local deployment, I tried to modify the library’s synth method of the resources/src/App.ts and change this part of the code:
//cdk.Tags.of(child).add("sst:app", this.name);
//cdk.Tags.of(child).add("sst:stage", this.stage);
cdk.Tags.of(child).add("sst_app", this.name);
cdk.Tags.of(child).add("sst_stage", this.stage);
Since as mentioned in the tags doc:
The key name of the tag. You can specify a value that's 1 to 128 Unicode characters in length and can't be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.
After this modification, the deployment was successful.
Error happening in Seed.run and local.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 3
- Comments: 15 (5 by maintainers)
We are running into the same error all of a sudden trying to deploy our sst app using
sst deploycommand. Specifically any resource of typeAWS::SNS::Topicis failing to be created.removing the tags actually messed up the console so that might not be the best solution. Taking all the Tags removal code out fixes it and it looks like deploys are working for me as well with the default
was having the same problem too randomly. I was able to reproduce consistently after I added additional tags to the app in the main function. As a workaround I ended up removing the tags and that allowed me to deploy again.
Yeah, keep me posted. Thanks @brunorib0