Skip to content

pbradaric/ec2-hosts-update-bash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

EC2 Instances hosts Update Script

About

This shell script gets a list of all running EC2 instances and updates local hosts file with new IP addresses. The list contains the Name tag and IP address for each running EC2 instance.

Prerequisites

This script requires AWS CLI v2 to be installed on the system (https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).

This script expects MFA to be enabled for current IAM account.

This script also requires user to setup new AWS CLI profile named mfa (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html).

Installation

Usage

Run the script and follow the interactive prompt for the first run. All subsequent runs will not have any interactive prompts (unless certain flags are used).

About

EC2 Instances hosts Update Script

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages