aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.68k stars 3.93k forks source link

fix(scheduler-targets-alpha): imported target resources as schedule target throws synth error #32105

Closed gracelu0 closed 18 hours ago

gracelu0 commented 2 days ago

Issue # (if applicable)

Tracking #31785

Reason for this change

Similar to what was done in this PR for the Lambda Invoke target: https://github.com/aws/aws-cdk/pull/31837. Reasoning is explained in this comment:

At synth time, there are cases where CDK does not know about the actual environment (e.g. when the environment is using Tokens). In other words, the environment check works in some scenarios and not others. This creates more confusion than benefit. IF cross env target support is added in the future, this check will become a blocker for CDK customers to set up cross env target.

Description of changes

Remove synth-time error that checks for same account and region for all targets to allow use of imported resources as target.

Description of how you validated changes

All tests are passing.

Checklist


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

codecov[bot] commented 1 day ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 77.19%. Comparing base (dcb5cf1) to head (eab1676). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #32105 +/- ## ======================================= Coverage 77.19% 77.19% ======================================= Files 105 105 Lines 7164 7164 Branches 1311 1311 ======================================= Hits 5530 5530 Misses 1454 1454 Partials 180 180 ``` | [Flag](https://app.codecov.io/gh/aws/aws-cdk/pull/32105/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws) | Coverage Δ | | |---|---|---| | [suite.unit](https://app.codecov.io/gh/aws/aws-cdk/pull/32105/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws) | `77.19% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws#carryforward-flags-in-the-pull-request-comment) to find out more. | [Components](https://app.codecov.io/gh/aws/aws-cdk/pull/32105/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws) | Coverage Δ | | |---|---|---| | [packages/aws-cdk](https://app.codecov.io/gh/aws/aws-cdk/pull/32105/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws) | `77.19% <ø> (ø)` | |
mergify[bot] commented 19 hours ago

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-cdk-automation commented 18 hours ago

AWS CodeBuild CI Report

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

mergify[bot] commented 18 hours ago

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).

github-actions[bot] commented 18 hours ago

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.