(aws-appsync): Datasource not found after migrating from aws-appsync-alpha #23743
Labels
@aws-cdk/aws-appsync
Related to AWS AppSync
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
Describe the bug
We were previously using
@aws-cdk/aws-appsync-alpha
version2.12.0-alpha.0
and recently migrated to the stable AppSync CDK construct in2.60.0
.CDK deploys are now failing as the
AWS::AppSync::Resolver
generated cannot find associatedAWS::AppSync::DataSource
:We think it's related to this PR merged 3 months ago: #22378 which changed how DataSource names are sanitized to remove invalid characters (such as hyphens in our case).
It used to sanitize the name and apply the sanitized name to both the L1 and L2 Construct
name
field, however now it only santitizes the underlying L1CfnDataSource
name
field and not the L2name
field leaving it inconsistent and resulting in the above error.Expected Behavior
I would expect that both the L2 and L1 names be the same like it was prior to #22378 to avoid issues such as we encountered where the wrong name is used and can't be found.
Current Behavior
The L1
CfnDataSource
name
field is sanitized (in our case stripping out hyphens) whilst the L2 DataSource Construct is not. This leads to the CDK not deploying the stack correctly since it cannot find the DataSource:Reproduction Steps
Create an AppSync Resolver with a DataSource (such as a
LambdaDataSource
) that has a name with a hypen in it.Possible Solution
The L2
name
field should be set tosupportedName
so that it matches the L1name
field.See here.
Additional Information/Context
No response
CDK CLI Version
2.60.0
Framework Version
No response
Node.js Version
16.19.0
OS
MacOS
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: