Skip to content

Automatically assign Elastic IPs to AWS EC2 Auto Scaling Group instances (golang)

Notifications You must be signed in to change notification settings

discobean/aws-ec2-assign-elastic-ip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-ec2-assign-elastic-ip (go)

This is inspired from skymill/aws-ec2-assign-elastic-ip except that:

  1. It is written in go
  2. Allows to select from a Pool of EIPs by using tag key/values

Usage (instanceid/region from metadata):

./aws-ec2-assign-elastic-ip-darwin-amd64 
    --eiptagkey Application 
    --eiptagvalue minecraft 

Usage (when specifying instanceid/region):

./aws-ec2-assign-elastic-ip-darwin-amd64 
    --eiptagkey Application 
    --eiptagvalue minecraft 
    --region ap-southeast-2 
    --instanceid i-0f0e97a20a05ce74b

Building

$ make build
$ ls -1 build/*
build/aws-ec2-assign-elastic-ip-darwin-amd64
build/aws-ec2-assign-elastic-ip-linux-amd64
build/aws-ec2-assign-elastic-ip-linux-arm
build/aws-ec2-assign-elastic-ip-windows-amd64

Instance permissions required

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AllowDescribeAssociate",
            "Effect": "Allow",
            "Action": [
                "ec2:DescribeAddresses",
                "ec2:AssociateAddress"
            ],
            "Resource": "*"
        }
    ]
}

About

Automatically assign Elastic IPs to AWS EC2 Auto Scaling Group instances (golang)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published