diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.scheduled-fargate-task.lit.expected.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.scheduled-fargate-task.lit.expected.json index ae6840c20dec3..1fcf45a621f49 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.scheduled-fargate-task.lit.expected.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/integ.scheduled-fargate-task.lit.expected.json @@ -632,7 +632,7 @@ ] } }, - "ScheduledFargateTaskScheduledTaskDefPutTargets7149EAB4": { + "ScheduledFargateTaskScheduledTaskDefScheduledEventRuleTarget0PutTargets4F6BAABA": { "Type": "Custom::AWS", "Properties": { "ServiceToken": { diff --git a/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts b/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts index 67aff8edd376b..6457bbb49d40b 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts @@ -117,7 +117,7 @@ export class EcsTask implements events.IRuleTarget { const subnetSelection = this.props.subnetSelection || { subnetType: ec2.SubnetType.PRIVATE }; const assignPublicIp = subnetSelection.subnetType === ec2.SubnetType.PRIVATE ? 'DISABLED' : 'ENABLED'; - new custom.AwsCustomResource(this.taskDefinition, 'PutTargets', { + new custom.AwsCustomResource(this.taskDefinition, `${rule.node.id}${id}PutTargets`, { // `onCreate´ defaults to `onUpdate` and we don't need an `onDelete` here // because the rule/target will be owned by CF anyway. onUpdate: { diff --git a/packages/@aws-cdk/aws-events-targets/test/ecs/integ.event-fargate-task.expected.json b/packages/@aws-cdk/aws-events-targets/test/ecs/integ.event-fargate-task.expected.json index 305b0394cdc5c..d13ae5c2abf03 100644 --- a/packages/@aws-cdk/aws-events-targets/test/ecs/integ.event-fargate-task.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/ecs/integ.event-fargate-task.expected.json @@ -595,7 +595,7 @@ ] } }, - "TaskDefPutTargetsF699575F": { + "TaskDefRuleTarget0PutTargets77691785": { "Type": "Custom::AWS", "Properties": { "ServiceToken": {