Skip to content

Commit

Permalink
Allow instances to kill themselves via ASG custom health check
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas North committed Jul 8, 2020
1 parent b20f4c3 commit 3a55d5a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- type: added
m: Allow instances to set themselves as unhealthy so that Autoscaling can kill them.
jira: PLAT-4678
owner: tomnorth
11 changes: 11 additions & 0 deletions iam_child.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ data "aws_iam_policy_document" "bastion_service_assume_role_in_parent" {
var.assume_role_arn,
]
}

# Allow instances to mark themselves unhealthy
statement {
effect = "Allow"

actions = [
"autoscaling:SetInstanceHealth"
]

resources = ["*"]
}
}

resource "aws_iam_policy" "bastion_service_assume_role_in_parent" {
Expand Down

0 comments on commit 3a55d5a

Please sign in to comment.