Skip to content

bdwyertech/go-aws-asg-status

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS ASG Status

Build Status

This is a tool to update an instances status within an ASG. This can be handy if you have to update or troubleshoot the instance and do not want the instance to serve traffic or be replaced during the process.

Supported Arguments

  • enter-standby
  • exit-standby
  • healthy
  • unhealthy
  • status

Sample IAM Policy

This policy is locked down to scope IAM permissions to instances within its own ASG. It leverages the built-in tags created by AWS CloudFormation.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
            	"autoscaling:Describe*",
            	"ec2:DescribeTags"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
            	"autoscaling:EnterStandby",
            	"autoscaling:ExitStandby",
                "autoscaling:SetInstanceHealth"
            ],
            "Resource": "*",
            "Condition": {
                "StringEquals": {
                    "autoscaling:ResourceTag/aws:cloudformation:stack-id": "${aws:ResourceTag/aws:cloudformation:stack-id}",
                    "autoscaling:ResourceTag/aws:cloudformation:logical-id": "${aws:ResourceTag/aws:cloudformation:logical-id}"
                }
            }
        }
    ]
}

Unfortunately, you cannot use the AWS ASG-defined tags in conditional access policies.

For example, this condition does not work:

"autoscaling:ResourceTag/aws:autoscaling:groupName": "${aws:ResourceTag/aws:autoscaling:groupName}"

About

Simplified use of AWS Autoscaling Group Instance Status functionality

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •