Skip to content

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

@1somorphism

Description

@1somorphism

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions