-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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(scheduler-targets-alpha): imported lambda function as schedule target throws synth error #31837
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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). |
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