`appsync.GraphqlApi.addLambdaDataSource` doesn't strip symbols from `id` name, causing deploy to fail
See original GitHub issueDoing something like the following:
const api = /* create api */
api.addLambdaDataSource(
"lambda-name-ds",
/* lambda */,
);
does not remove the -
from the id name, causing the deploy to fail with:
Property validation failure: [Value for property {/Name} does not match pattern {[_A-Za-z][_0-9A-Za-z]*}]
And if we look at the resulting stack.template.json file, we see the error is present:
{
"lambdadatasourceid": {
/* ... */
"Name": "ambda-name-ds"
/* ... */
}
}
Reproduction Steps
Just create any appsync GraphQL API and add a lambda datasource that contains -
. (haven’t tested if other symbols also trip it up)
What did you expect to happen?
I expect the -
to be stripped out, just like all other id’s in the CDK along with the deploy not failing.
What actually happened?
The deploy fails.
Environment
- CDK CLI Version : 1.119.0 (build 2921d64)
- Framework Version: 1.119.0
- Node.js Version: v16.6.1
- OS : Ubuntu (WSL 2)
- Language (Version): TypeScript ~3.9.7
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Authorization and authentication - AWS AppSync
There are five ways you can authorize applications to interact with your AWS AppSync GraphQL API. You specify which authorization type you use...
Read more >Deploy an AWS AppSync GraphQL API with CloudFormation
This is a good model for creating IAM roles that you will need. Each resource you create has a logical name that is...
Read more >Serverless Appsync Plugin
Deploy AppSync API's in minutes using this Serverless plugin. Getting Started. Be sure to check out all that AWS AppSync has to offer....
Read more >API (GraphQL) - Client code generation - AWS Amplify Docs
Codegen add workflow triggers automatically when an AppSync API is pushed to ... 1 id content post { # depth level 2 id...
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
I tried to created an S3 bucket using CDK with ID including various unusual characters as following:
I compared the logical id in the aws console of cloudformation, and found all the unusual characters were stripped.
By this logical analogy, I think we should stripe all of the characters except [_0-9A-Za-z] instead of just stripe ‘-’ only. What do you think? @otaviomacedo @BryanPan342 @jquesada2016 , if you don’t mind, I’d like try to solve this issue.
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.