Skip to content

Commit 3a8a3e6

Browse files
authored
Merge branch 'master' into nija-at/cognito-test-refactor
2 parents c784d98 + 9fbeec3 commit 3a8a3e6

15 files changed

+167
-14
lines changed

packages/@aws-cdk/aws-ecs-patterns/test/ec2/integ.multiple-application-load-balanced-ecs-service.expected.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,17 @@
658658
"ecs:DescribeTasks"
659659
],
660660
"Effect": "Allow",
661-
"Resource": "*"
661+
"Resource": "*",
662+
"Condition": {
663+
"ArnEquals": {
664+
"ecs:cluster": {
665+
"Fn::GetAtt": [
666+
"ClusterEB0386A7",
667+
"Arn"
668+
]
669+
}
670+
}
671+
}
662672
},
663673
{
664674
"Action": [

packages/@aws-cdk/aws-ecs-patterns/test/ec2/integ.scheduled-ecs-task.lit.expected.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,17 @@
474474
"ecs:DescribeTasks"
475475
],
476476
"Effect": "Allow",
477-
"Resource": "*"
477+
"Resource": "*",
478+
"Condition": {
479+
"ArnEquals": {
480+
"ecs:cluster": {
481+
"Fn::GetAtt": [
482+
"EcsCluster97242B84",
483+
"Arn"
484+
]
485+
}
486+
}
487+
}
478488
},
479489
{
480490
"Action": [

packages/@aws-cdk/aws-ecs/lib/drain-hook/instance-drain-hook.ts

+3
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ export class InstanceDrainHook extends cdk.Construct {
9090
fn.addToRolePolicy(new iam.PolicyStatement({
9191
actions: ['ecs:DescribeContainerInstances', 'ecs:DescribeTasks'],
9292
resources: ['*'],
93+
conditions: {
94+
ArnEquals: { 'ecs:cluster': props.cluster.clusterArn },
95+
},
9396
}));
9497

9598
// Restrict to the ECS Cluster

packages/@aws-cdk/aws-ecs/test/ec2/integ.app-mesh-proxy-config.expected.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,17 @@
637637
"ecs:DescribeTasks"
638638
],
639639
"Effect": "Allow",
640-
"Resource": "*"
640+
"Resource": "*",
641+
"Condition": {
642+
"ArnEquals": {
643+
"ecs:cluster": {
644+
"Fn::GetAtt": [
645+
"EcsCluster97242B84",
646+
"Arn"
647+
]
648+
}
649+
}
650+
}
641651
},
642652
{
643653
"Action": [

packages/@aws-cdk/aws-ecs/test/ec2/integ.clb-host-nw.expected.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,17 @@
658658
"ecs:DescribeTasks"
659659
],
660660
"Effect": "Allow",
661-
"Resource": "*"
661+
"Resource": "*",
662+
"Condition": {
663+
"ArnEquals": {
664+
"ecs:cluster": {
665+
"Fn::GetAtt": [
666+
"EcsCluster97242B84",
667+
"Arn"
668+
]
669+
}
670+
}
671+
}
662672
},
663673
{
664674
"Action": [

packages/@aws-cdk/aws-ecs/test/ec2/integ.firelens-s3-config.expected.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,17 @@
637637
"ecs:DescribeTasks"
638638
],
639639
"Effect": "Allow",
640-
"Resource": "*"
640+
"Resource": "*",
641+
"Condition": {
642+
"ArnEquals": {
643+
"ecs:cluster": {
644+
"Fn::GetAtt": [
645+
"EcsCluster97242B84",
646+
"Arn"
647+
]
648+
}
649+
}
650+
}
641651
},
642652
{
643653
"Action": [

packages/@aws-cdk/aws-ecs/test/ec2/integ.lb-awsvpc-nw.expected.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,17 @@
637637
"ecs:DescribeTasks"
638638
],
639639
"Effect": "Allow",
640-
"Resource": "*"
640+
"Resource": "*",
641+
"Condition": {
642+
"ArnEquals": {
643+
"ecs:cluster": {
644+
"Fn::GetAtt": [
645+
"EcsCluster97242B84",
646+
"Arn"
647+
]
648+
}
649+
}
650+
}
641651
},
642652
{
643653
"Action": [

packages/@aws-cdk/aws-ecs/test/ec2/integ.lb-bridge-nw.expected.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,17 @@
658658
"ecs:DescribeTasks"
659659
],
660660
"Effect": "Allow",
661-
"Resource": "*"
661+
"Resource": "*",
662+
"Condition": {
663+
"ArnEquals": {
664+
"ecs:cluster": {
665+
"Fn::GetAtt": [
666+
"EcsCluster97242B84",
667+
"Arn"
668+
]
669+
}
670+
}
671+
}
662672
},
663673
{
664674
"Action": [

packages/@aws-cdk/aws-ecs/test/ec2/integ.sd-awsvpc-nw.expected.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,17 @@
637637
"ecs:DescribeTasks"
638638
],
639639
"Effect": "Allow",
640-
"Resource": "*"
640+
"Resource": "*",
641+
"Condition": {
642+
"ArnEquals": {
643+
"ecs:cluster": {
644+
"Fn::GetAtt": [
645+
"EcsCluster97242B84",
646+
"Arn"
647+
]
648+
}
649+
}
650+
}
641651
},
642652
{
643653
"Action": [

packages/@aws-cdk/aws-ecs/test/ec2/integ.sd-bridge-nw.expected.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,17 @@
637637
"ecs:DescribeTasks"
638638
],
639639
"Effect": "Allow",
640-
"Resource": "*"
640+
"Resource": "*",
641+
"Condition": {
642+
"ArnEquals": {
643+
"ecs:cluster": {
644+
"Fn::GetAtt": [
645+
"EcsCluster97242B84",
646+
"Arn"
647+
]
648+
}
649+
}
650+
}
641651
},
642652
{
643653
"Action": [

packages/@aws-cdk/aws-ecs/test/ec2/integ.spot-drain.expected.json

+22-2
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,17 @@
639639
"ecs:DescribeTasks"
640640
],
641641
"Effect": "Allow",
642-
"Resource": "*"
642+
"Resource": "*",
643+
"Condition": {
644+
"ArnEquals": {
645+
"ecs:cluster": {
646+
"Fn::GetAtt": [
647+
"EcsCluster97242B84",
648+
"Arn"
649+
]
650+
}
651+
}
652+
}
643653
},
644654
{
645655
"Action": [
@@ -1110,7 +1120,17 @@
11101120
"ecs:DescribeTasks"
11111121
],
11121122
"Effect": "Allow",
1113-
"Resource": "*"
1123+
"Resource": "*",
1124+
"Condition": {
1125+
"ArnEquals": {
1126+
"ecs:cluster": {
1127+
"Fn::GetAtt": [
1128+
"EcsCluster97242B84",
1129+
"Arn"
1130+
]
1131+
}
1132+
}
1133+
}
11141134
},
11151135
{
11161136
"Action": [

packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts

+10
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,16 @@ export = {
444444
],
445445
Effect: 'Allow',
446446
Resource: '*',
447+
Condition: {
448+
ArnEquals: {
449+
'ecs:cluster': {
450+
'Fn::GetAtt': [
451+
'EcsCluster97242B84',
452+
'Arn',
453+
],
454+
},
455+
},
456+
},
447457
},
448458
{
449459
Action: [

packages/@aws-cdk/aws-events-targets/test/ecs/integ.event-ec2-task.lit.expected.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,17 @@
475475
"ecs:DescribeTasks"
476476
],
477477
"Effect": "Allow",
478-
"Resource": "*"
478+
"Resource": "*",
479+
"Condition": {
480+
"ArnEquals": {
481+
"ecs:cluster": {
482+
"Fn::GetAtt": [
483+
"EcsCluster97242B84",
484+
"Arn"
485+
]
486+
}
487+
}
488+
}
479489
},
480490
{
481491
"Action": [

packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.ec2-run-task.expected.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,17 @@
269269
"ecs:DescribeTasks"
270270
],
271271
"Effect": "Allow",
272-
"Resource": "*"
272+
"Resource": "*",
273+
"Condition": {
274+
"ArnEquals": {
275+
"ecs:cluster": {
276+
"Fn::GetAtt": [
277+
"Ec2ClusterEE43E89D",
278+
"Arn"
279+
]
280+
}
281+
}
282+
}
273283
},
274284
{
275285
"Action": [

packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs/integ.ec2-task.expected.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,17 @@
269269
"ecs:DescribeTasks"
270270
],
271271
"Effect": "Allow",
272-
"Resource": "*"
272+
"Resource": "*",
273+
"Condition": {
274+
"ArnEquals": {
275+
"ecs:cluster": {
276+
"Fn::GetAtt": [
277+
"FargateCluster7CCD5F93",
278+
"Arn"
279+
]
280+
}
281+
}
282+
}
273283
},
274284
{
275285
"Action": [

0 commit comments

Comments
 (0)