-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
@aws-cdk/aws-appsyncRelated to AWS AppSyncRelated to AWS AppSyncbugThis issue is a bug.This issue is a bug.good first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdp2
Description
Doing 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-appsyncRelated to AWS AppSyncRelated to AWS AppSyncbugThis issue is a bug.This issue is a bug.good first issueRelated to contributions. See CONTRIBUTING.mdRelated to contributions. See CONTRIBUTING.mdp2