Retain API Gateway permissions to old Lambda Alias/Version on update #22616
Unanswered
radahh-rest
asked this question in
Q&A
Replies: 1 comment
-
I created broader permissions and can see that the update goes live immediately, before the stage is deployed. I'm guessing then that you must use stage variables to achieve this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are attempting to change our CDK deploy to bind the API Gateway resource to a Lambda Alias (or Version) rather than $LATEST and use Stages and Deployments to control service upgrades.
I have code that creates a version and alias and grants invoke to the alias from the APIGateway service principal. When I deploy the lambda stack, the permission for the last alias gets deleted before the stage is deployed, causing a 500 errors due to lack of permissions.
I set the retention policy of the alias to RETAIN, but it seems that the API resource
addMethod
function taking the new integration is what causes the change detection to remove the old permissions as the gateway resources are updated, but before the stage is deployed.Is there a pattern I can use to retain permissions to the old version until the stage is deployed?
Here's come pseudo code showing the steps I currently have:
5 minutes later...
And here's the log of the lambda deploy showing the permission to the last deployed alias being removed:
Beta Was this translation helpful? Give feedback.
All reactions