appsync: the ARN needed to grant access to the API has to contain 'v1' #26746
Labels
@aws-cdk/aws-appsync
Related to AWS AppSync
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p2
Describe the bug
I want to grant a Lambda function to rotate the API_KEY of the AppSync API. If I provide the ARN of the AppSync API to the PolicyStatement of the Lambda, I get the following error.
Please note the
v1
beforeapis
Oh, and just for completeness. There is the same behaviour when I try to grant via the API object:
Expected Behavior
I expect the ARN coming from the API constructor being the same as the one needed to grant permission to.
Current Behavior
The ARN coming from the API constructor is without
v1
, and the one needed to grant a Lambda permission to the API has to contain av1
.Coming from API Constructor:
Needed to grant a Lambda:
Reproduction Steps
To reproduce, see my bug description.
Possible Solution
My workaround is to concat the strings manually. I don't know if there is any better solution.
Additional Information/Context
No response
CDK CLI Version
2.91.0 (build eea12ea)
Framework Version
No response
Node.js Version
Node.js v18.17.0
OS
Ubuntu 22.04 - Linux version 5.15.90.1-microsoft-standard-WSL2
Language
Typescript
Language Version
[email protected]
Other information
No response
The text was updated successfully, but these errors were encountered: