-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(apigateway): permission error in lambda integration when function name is modified #8813
fix(apigateway): permission error in lambda integration when function name is modified #8813
Conversation
… name is modified Changing function name triggers a resource replacement - the old function is removed and replaced with a new function. However, the RestApi deployment remains untouched and is still pointing at the ARN of the, now stale, function. The fix is to trigger a new deployment if the function name changes. fixes #5306
Currently, the Method construct reaches into the internals of the Integration class to construct itself, via the _props() internal method. Change to a more recent pattern where the bind() returns a result that contains all of the information that the Method class requires to finalize the bind. Motivation for the change This change - #8813 - requires a property returned to the Method that is not user specified. The change already introduces this pattern. This PR takes it a bit further and applies the same logic to existing properties, so that there is now only one way for the Method to get the result of the bind.
* This value is included in computing the Deployment's fingerprint. When the fingerprint | ||
* changes a new deployment is triggered. | ||
* This property should carry a different value when the Deployment needs to be refreshed. | ||
* @default - deployments are not triggered for any change of this integration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a note that it can be an arbitrary string and does not have to be a hash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched to index type <string, string> so the user doesn't have to do JSON.stringify() unless they're adding a nested struct. The input to the hash gen will also be a bit nicer without the serialized objects.
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Currently, the Method construct reaches into the internals of the Integration class to construct itself, via the _props() internal method. Change to a more recent pattern where the bind() returns a result that contains all of the information that the Method class requires to finalize the bind. Motivation for the change This change - #8813 - requires a property returned to the Method that is not user specified. The change already introduces this pattern. This PR takes it a bit further and applies the same logic to existing properties, so that there is now only one way for the Method to get the result of the bind. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Changing function name triggers a resource replacement - the old
function is removed and replaced with a new function.
However, the RestApi deployment remains untouched and is still pointing
at the ARN of the, now stale, function.
The fix is to trigger a new deployment if the function name changes.
fixes #5306
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license