Skip to content
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

feat(aws-codepipeline-actions): Added region as prop of LambdaInvokeAction #18229

Closed
wants to merge 3 commits into from

Conversation

ryparker
Copy link
Contributor

Summary

This PR adds the missing prop region to the LambdaInvokeAction.

Fixes: #18228


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Dec 30, 2021

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Dec 30, 2021
Copy link
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good attempt, but the region should be taken from the Function passed in the lambda property, not separately 🙂.

@ryparker
Copy link
Contributor Author

ryparker commented Dec 30, 2021

This is a good attempt, but the region should be taken from the Function passed in the lambda property, not separately 🙂.

That sounds ideal however it would cause an error on any pipeline stack that does not have region specified.

Error: Resolution error: Resolution error: Resolution error: Pipeline stack which uses cross-environment actions must have an explicitly set region.

In this case we're allowing the user to configure the LambdaInvokeAction's region only when necessary. If we default to using the Lambda's region then the above error will break any current usage that does not have region specified on the pipeline's stack.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: d659953
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@skinny85
Copy link
Contributor

This is a good attempt, but the region should be taken from the Function passed in the lambda property, not separately 🙂.

That sounds ideal however it would cause an error on any pipeline stack that does not have region specified.

Error: Resolution error: Resolution error: Resolution error: Pipeline stack which uses cross-environment actions must have an explicitly set region.

In this case we're allowing the user to configure the LambdaInvokeAction's region only when necessary. If we default to using the Lambda's region then the above error will break any current usage that does not have region specified on the pipeline's stack.

Yep, that's expected behavior, like the error message says. If you provide a Lambda function from a specific region, you must also tell us what region the pipeline is in, because if the two are different, this means this is a cross-region CodePipeline, and we must do some additional stuff to make it work. The construct handles all of that in its implementation, but we need to have a specific region to make sure the pipeline is indeed cross-region.

We already take the region from the Lambda function here, so I'm curious what is causing the incorrect behavior in the original issue.

@cgarvis
Copy link
Contributor

cgarvis commented Mar 17, 2022

#18228 was closed by #18255. So seems like this is not needed anymore.

@cgarvis cgarvis closed this Mar 17, 2022
@TheRealAmazonKendra TheRealAmazonKendra deleted the fix-lambda-invoke-action-missing-region-prop branch February 14, 2023 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-codepipelines-actions): Cannot set region on LambdaInvokeAction
4 participants