Skip to content

Commit

Permalink
fix(events-targets): allow adding same scheduled fargate task to mult…
Browse files Browse the repository at this point in the history
…iple rules

Also allow adding same scheduled fargate task multiple times to same rule.

Closes aws#3574
  • Loading branch information
jogold committed Aug 7, 2019
1 parent f4ca41c commit b8f68d1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@
]
}
},
"ScheduledFargateTaskScheduledTaskDefPutTargets7149EAB4": {
"ScheduledFargateTaskScheduledTaskDefScheduledEventRuleTarget0PutTargets4F6BAABA": {
"Type": "Custom::AWS",
"Properties": {
"ServiceToken": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@
]
}
},
"TaskDefPutTargetsF699575F": {
"TaskDefRuleTarget0PutTargets77691785": {
"Type": "Custom::AWS",
"Properties": {
"ServiceToken": {
Expand Down

0 comments on commit b8f68d1

Please sign in to comment.