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

jtheo/aws-ec2-assign-elastic-ip

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

This is a clone of discobean/aws-ec2-assign-elastic-ip 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 
    --tag-name Application 
    --tag-value minecraft 

Usage (when specifying instanceid/region):

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

Building

$ ./build.sh
$ ls -1 bin/
aws-ec2-assign-elastic-ip-darwin-amd64
aws-ec2-assign-elastic-ip-darwin-arm64
aws-ec2-assign-elastic-ip-linux-amd64
aws-ec2-assign-elastic-ip-linux-arm64

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

Packages

No packages published

Languages

  • Go 85.6%
  • Shell 14.4%