fix(scheduler-targets-alpha): imported lambda function as schedule target throws synth error#31837
Conversation
| } | ||
|
|
||
| protected addTargetActionToRole(schedule: ISchedule, role: IRole): void { | ||
| if (!sameEnvDimension(this.func.env.region, schedule.env.region)) { |
There was a problem hiding this comment.
While this would fix the problem mentioned in the issue, I don't think this is a good fix in general since it removes check even for functions and scheduler with known account & regions.
There was a problem hiding this comment.
That is correct. The reasoning to remove the check is explained here.
|
What is the deployment behaviour now without this validation if the account/region don't match? Is there any documentation on this restriction? I wasn't able to find anything. |
From my testing, different account works (although not explicitly documented). Different region will throw error at template deploy time. |
packages/@aws-cdk/aws-scheduler-targets-alpha/test/integ.lambda-invoke.ts
Outdated
Show resolved
Hide resolved
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Co-authored-by: Grace Luo <54298030+gracelu0@users.noreply.github.com>
|
Thank you for contributing! Your pull request will be updated from main 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 main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
Closes #29284.
Tracking #31785.
Reason for this change
Removed the same env check between the Schedule and the Lambda target to allow use of imported Lambda function as target.
Description of changes
Removed the check that forces the Schedule and the Lambda function to be in the same account and region.
Description of how you validated changes
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license