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

❗ NOTICE(aws-events-targets): Hardcoded AWS Partition in ECS task resource ARN #29610

Closed
1somorphism opened this issue Mar 25, 2024 · 4 comments · Fixed by #29633
Closed

❗ NOTICE(aws-events-targets): Hardcoded AWS Partition in ECS task resource ARN #29610

1somorphism opened this issue Mar 25, 2024 · 4 comments · Fixed by #29633
Assignees
Labels
@aws-cdk/aws-events-targets bug This issue is a bug. effort/small Small work item – less than a day of effort management/tracking Issues that track a subject or multiple issues p0

Comments

@1somorphism
Copy link

1somorphism commented Mar 25, 2024

Please add your +1 👍 to let us know you have encountered this

Status: RESOLVED

Overview:

Partition in https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-events-targets/lib/ecs-task.ts#L291 is hardcoded to aws so it doesn't work for other special partitions.

Workaround:

Solution:

Update policy to use this.cluster.stack.partition instead of hardcoded aws.

Fixed in v2.135.0.

Expected Behavior

Partition should be added dynamically.

Current Behavior

Fixed to aws

Reproduction Steps

Create an ScheduledEc2Task or a ScheduledFargateTask following the example in the CDK documentation and attempt to deploy outside the AWS partition.

Possible Solution

Partition should be coming from this.cluster.env.partition?

Related Issues:

#29628

Additional Information/Context

No response

CDK CLI Version

2.132.1

Framework Version

No response

Node.js Version

18.18.2

OS

MacOS 14.3.1

Language

TypeScript

Language Version

5.4.2

Other information

No response

@1somorphism 1somorphism added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 25, 2024
@1somorphism 1somorphism changed the title (aws-events-targets): (Hardcoded AWS Partition in ECS task resource ARN) aws-events-targets: Hardcoded AWS Partition in ECS task resource ARN Mar 25, 2024
@tim-finnigan tim-finnigan self-assigned this Mar 25, 2024
@tim-finnigan tim-finnigan added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Mar 25, 2024
@tim-finnigan
Copy link

Thanks for reporting this issue. It looks like that was recently added in #28898, and the partition should be dynamically populated.

@tim-finnigan tim-finnigan added p1 effort/small Small work item – less than a day of effort and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Mar 25, 2024
@tim-finnigan tim-finnigan removed their assignment Mar 25, 2024
@tim-finnigan tim-finnigan added p0 and removed p1 labels Mar 27, 2024
@mergify mergify bot closed this as completed in #29633 Mar 27, 2024
mergify bot pushed a commit that referenced this issue Mar 27, 2024
…#29633)

### Issue # (if applicable)

Closes #29610 

Related to #28898

### Reason for this change

Previously the AWS partition was hardcoded so it would not work for other special partitions.

### Description of changes

Replace hardcoded `aws` partition to be dynamically added with `this.cluster.stack.partition`. 

### Description of how you validated changes

Ran integ tests suite, no changes. 

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

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

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@tim-finnigan
Copy link

#29633 has been merged to fix this and should be available soon in an upcoming release.

@paulhcsun paulhcsun added the management/tracking Issues that track a subject or multiple issues label Apr 3, 2024
@paulhcsun paulhcsun pinned this issue Apr 3, 2024
@paulhcsun
Copy link
Contributor

Fix has been released in v2.135.0.

mergify bot pushed a commit to cdklabs/aws-cdk-notices that referenced this issue Apr 3, 2024
paulhcsun added a commit to cdklabs/aws-cdk-notices that referenced this issue Apr 3, 2024
paulhcsun added a commit to cdklabs/aws-cdk-notices that referenced this issue Apr 3, 2024
paulhcsun added a commit to cdklabs/aws-cdk-notices that referenced this issue Apr 3, 2024
@paulhcsun paulhcsun changed the title aws-events-targets: Hardcoded AWS Partition in ECS task resource ARN ❗ NOTICE(aws-events-targets): Hardcoded AWS Partition in ECS task resource ARN Apr 9, 2024
@TheRealAmazonKendra TheRealAmazonKendra unpinned this issue Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-events-targets bug This issue is a bug. effort/small Small work item – less than a day of effort management/tracking Issues that track a subject or multiple issues p0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants