Skip to content

Commit

Permalink
fix(ecs): ECS drain hook can't change instance state to draining (aws…
Browse files Browse the repository at this point in the history
…#3190)

update integration test data

fixes aws#3190
  • Loading branch information
ScOut3R committed Jul 4, 2019
1 parent caaee9e commit 150e3a8
Show file tree
Hide file tree
Showing 7 changed files with 199 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,7 @@
"Action": [
"ecs:ListContainerInstances",
"ecs:SubmitContainerStateChange",
"ecs:SubmitTaskStateChange",
"ecs:UpdateContainerInstancesState",
"ecs:ListTasks"
"ecs:SubmitTaskStateChange"
],
"Effect": "Allow",
"Resource": {
Expand All @@ -460,6 +458,29 @@
"Arn"
]
}
},
{
"Action": [
"ecs:UpdateContainerInstancesState",
"ecs:ListTasks"
],
"Effect": "Allow",
"Resource": {
"Fn::Join": [
"",
[
"arn:aws:ecs:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":container-instance/*"
]
]
}
}
],
"Version": "2012-10-17"
Expand Down Expand Up @@ -614,6 +635,37 @@
"EcsClusterDefaultAutoScalingGroupLifecycleHookDrainHookRoleA38EC83B"
]
},
"ScheduledEc2TaskScheduledEventRuleFE2376A2": {
"Type": "AWS::Events::Rule",
"Properties": {
"ScheduleExpression": "rate(1 minute)",
"State": "ENABLED",
"Targets": [
{
"Arn": {
"Fn::GetAtt": [
"EcsCluster97242B84",
"Arn"
]
},
"EcsParameters": {
"TaskCount": 2,
"TaskDefinitionArn": {
"Ref": "ScheduledEc2TaskScheduledTaskDef56328BA4"
}
},
"Id": "awsecsintegecsScheduledEc2TaskScheduledTaskDef18FB4348",
"Input": "{}",
"RoleArn": {
"Fn::GetAtt": [
"ScheduledEc2TaskScheduledTaskDefEventsRole64113C5F",
"Arn"
]
}
}
]
}
},
"ScheduledEc2TaskScheduledTaskDefTaskRoleC3FA127C": {
"Type": "AWS::IAM::Role",
"Properties": {
Expand Down Expand Up @@ -829,37 +881,6 @@
}
]
}
},
"ScheduledEc2TaskScheduledEventRuleFE2376A2": {
"Type": "AWS::Events::Rule",
"Properties": {
"ScheduleExpression": "rate(1 minute)",
"State": "ENABLED",
"Targets": [
{
"Arn": {
"Fn::GetAtt": [
"EcsCluster97242B84",
"Arn"
]
},
"EcsParameters": {
"TaskCount": 2,
"TaskDefinitionArn": {
"Ref": "ScheduledEc2TaskScheduledTaskDef56328BA4"
}
},
"Id": "awsecsintegecsScheduledEc2TaskScheduledTaskDef18FB4348",
"Input": "{}",
"RoleArn": {
"Fn::GetAtt": [
"ScheduledEc2TaskScheduledTaskDefEventsRole64113C5F",
"Arn"
]
}
}
]
}
}
},
"Parameters": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,7 @@
"Action": [
"ecs:ListContainerInstances",
"ecs:SubmitContainerStateChange",
"ecs:SubmitTaskStateChange",
"ecs:UpdateContainerInstancesState",
"ecs:ListTasks"
"ecs:SubmitTaskStateChange"
],
"Effect": "Allow",
"Resource": {
Expand All @@ -616,6 +614,29 @@
"Arn"
]
}
},
{
"Action": [
"ecs:UpdateContainerInstancesState",
"ecs:ListTasks"
],
"Effect": "Allow",
"Resource": {
"Fn::Join": [
"",
[
"arn:aws:ecs:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":container-instance/*"
]
]
}
}
],
"Version": "2012-10-17"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 +626,7 @@
"Action": [
"ecs:ListContainerInstances",
"ecs:SubmitContainerStateChange",
"ecs:SubmitTaskStateChange",
"ecs:UpdateContainerInstancesState",
"ecs:ListTasks"
"ecs:SubmitTaskStateChange"
],
"Effect": "Allow",
"Resource": {
Expand All @@ -637,6 +635,29 @@
"Arn"
]
}
},
{
"Action": [
"ecs:UpdateContainerInstancesState",
"ecs:ListTasks"
],
"Effect": "Allow",
"Resource": {
"Fn::Join": [
"",
[
"arn:aws:ecs:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":container-instance/*"
]
]
}
}
],
"Version": "2012-10-17"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,7 @@
"Action": [
"ecs:ListContainerInstances",
"ecs:SubmitContainerStateChange",
"ecs:SubmitTaskStateChange",
"ecs:UpdateContainerInstancesState",
"ecs:ListTasks"
"ecs:SubmitTaskStateChange"
],
"Effect": "Allow",
"Resource": {
Expand All @@ -616,6 +614,29 @@
"Arn"
]
}
},
{
"Action": [
"ecs:UpdateContainerInstancesState",
"ecs:ListTasks"
],
"Effect": "Allow",
"Resource": {
"Fn::Join": [
"",
[
"arn:aws:ecs:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":container-instance/*"
]
]
}
}
],
"Version": "2012-10-17"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,7 @@
"Action": [
"ecs:ListContainerInstances",
"ecs:SubmitContainerStateChange",
"ecs:SubmitTaskStateChange",
"ecs:UpdateContainerInstancesState",
"ecs:ListTasks"
"ecs:SubmitTaskStateChange"
],
"Effect": "Allow",
"Resource": {
Expand All @@ -616,6 +614,29 @@
"Arn"
]
}
},
{
"Action": [
"ecs:UpdateContainerInstancesState",
"ecs:ListTasks"
],
"Effect": "Allow",
"Resource": {
"Fn::Join": [
"",
[
"arn:aws:ecs:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":container-instance/*"
]
]
}
}
],
"Version": "2012-10-17"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,7 @@
"Action": [
"ecs:ListContainerInstances",
"ecs:SubmitContainerStateChange",
"ecs:SubmitTaskStateChange",
"ecs:UpdateContainerInstancesState",
"ecs:ListTasks"
"ecs:SubmitTaskStateChange"
],
"Effect": "Allow",
"Resource": {
Expand All @@ -460,6 +458,29 @@
"Arn"
]
}
},
{
"Action": [
"ecs:UpdateContainerInstancesState",
"ecs:ListTasks"
],
"Effect": "Allow",
"Resource": {
"Fn::Join": [
"",
[
"arn:aws:ecs:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":container-instance/*"
]
]
}
}
],
"Version": "2012-10-17"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,7 @@
"Action": [
"ecs:ListContainerInstances",
"ecs:SubmitContainerStateChange",
"ecs:SubmitTaskStateChange",
"ecs:UpdateContainerInstancesState",
"ecs:ListTasks"
"ecs:SubmitTaskStateChange"
],
"Effect": "Allow",
"Resource": {
Expand All @@ -260,6 +258,29 @@
"Arn"
]
}
},
{
"Action": [
"ecs:UpdateContainerInstancesState",
"ecs:ListTasks"
],
"Effect": "Allow",
"Resource": {
"Fn::Join": [
"",
[
"arn:aws:ecs:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":container-instance/*"
]
]
}
}
],
"Version": "2012-10-17"
Expand Down

0 comments on commit 150e3a8

Please sign in to comment.