Sign inSign up

particle/awscli

By particle

Updated over 7 years ago

A custom awscli image & bin script to attach a specified EIP to the instance running the container.

Image
0

1.7K

particle/awscli repository overview

This image simply has the awscli & jq installed and runs our custom entrypoint script.

Requires the following ENV VARS:

  • AWS_ACCESS_KEY_ID
    • These two are your basic AWS IAM credentials. The IAM user you use here must have permissions to access EC2/EIPs.
  • AWS_SECRET_ACCESS_KEY
    • These two are your basic AWS IAM credentials. The IAM user you use here must have permissions to access EC2/EIPs.
  • AWS_REGION
    • The AWS region hosting the EC2 instance you want to attach an EIP to. We only use us-east-1 for now.
  • AWS_EIP
    • An existing/already created/provisioned AWS EIP that we want to assign.

Description

Given an AWS credentials, region, and EIP, find the EIP allocation ID, find the instance ID of the EC2 instance running this container and attach the specified EIP to the instance.

Usage

Note we must run the container in --net=host mode or else the container cannot access the EC2 metadata running on the host, and we need that to extract the instance ID of the host.

docker run --net=host -it --rm -e AWS_DEFAULT_REGION='us-east-1' \
-e AWS_ACCESS_KEY_ID='$YOUR-KEY' \
-e AWS_SECRET_ACCESS_KEY='$YOUR-SECRET' \
-e AWS_EIP='$YOUR-EIP' \
particle/awscli:latest

Tag summary

Content type

Image

Digest

Size

30.1 MB

Last updated

over 8 years ago

docker pull particle/awscli