Skip to content

khoanguyen-st/ec2-mover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

EC2 Mover

Usage

1. Set the necessary environment variables in config.sh file.

2. Run the script:

bash ./mover.sh

What the Script does?

  1. Retrieves the security group IDs, tags, and name of the source instance.
  2. Creates a new AMI from the source instance.
  3. Shares the new AMI with the target AWS account.
  4. Creates a new key pair in the target account.
  5. Launches a new instance in the target account using the shared AMI and the created key pair.
  6. Attaches the source instance's security groups to the new instance.
  7. Copies the source instance's tags to the new instance.
  8. Unshares the AMI with the source account.
  9. Deletes the AMI and its associated snapshots.

Note: This script assumes that the same security group names are used in both the source and target accounts. If a security group does not exist in the target account, the script will create it and copy the inbound rules from the source security group.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages