Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

These scripts are used to distribute an AMI to all regions of AWS and publish it publicly in the community AMI repository.

License

Notifications You must be signed in to change notification settings

ZertoPublic/zAMI-Distibutor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

zAMI-Distibutor

These scripts are used to distribute an AMI to all regions of AWS and publish it publicly in the community AMI repository.

Getting Started

The purpose of these scripts are to publish an Amazon Machine Image (AMI) to all regions of AWS. This allows for anyone in the world using AWS to deploy an EC2 Instance from your AMI.

If you are unable to publish your AMI to the AWS Marketplace, the Community AMI repository is a great alterantive for those sharing free to use AMI templates. That is where this script publishes to.

There is also a script included to remove your published AMIs from all regions once you are no longer offering them. For exmaple if you have an older version of your AMI that needs retired you can remove it with the "zAMI-Deleter.ps1" script.

Prerequisites

  • Make sure that you have the AWS Tools for windows installed on the machine you will run these scripts from. It can be downloaded here: https://aws.amazon.com/powershell/
  • You will need to have already created an AMI in one region. By default the script assumes it will be in us-east-1 (Northern Virginia). If you created your initial AMI if a different region, you will need to update the zAMI-Deployer.ps1 script accordingly.
  • Your AMI's ID
  • Your IAM Access Key and Secret Key

Installing

To use these scripts you will need to enable allow PowerShell to run unsigned scripts. To do that simply execute this command before trying to run the scripts.

Set-ExecutionPolicy Unrestricted

Usage

Add additional notes about how to deploy this on a live system

zAMI-Deployer.ps1

There are two ways to run the zAMI-Deployer.ps1 script. You can either add your IAM Access key, Secret key, and your AMI ID to the script before running it, or you will be prompted to enter the information during runtime. The choice is yours.

To run the script simply execute it.

ex.

.\zAMI-Deployer.ps1

If you have not modified the script with your IAM keys and your AMI Id you will be prompted for them. Once all of the needed information has been added the script will find the AMI, then copy it to all regions. Once it has been copied to all regions the source AMI will be marked as public. Next a loop process will start and check to make sure all of the AMI clone processes have completed, once they are all clones will be marked as public. Lastly a CSV file will be generated with a list of AMI ID's as well as the region they are in. Retain this csv file so when you want to unpublish the AMIs you can use the zAMI-Deleter.ps1 script.

zAMI-Deleter.ps1

This script will take the csv file that was generated by the zAMI-Deployer.ps1 script and remove the AMI's from whatever region they are in. To use this script simply execute it with the csv file as a parameter.

ex.

.\zAMI-Deleter.ps1 version-1.csv

All AMI's listed in the version-1.csv file will be removed from AWS and perminently deleted.

Versioning

This script is considered the initial release and version 1.0.0

Authors

Contributors

License

This project is licensed under the GNU GPLv3 License - see the LICENSE.md file for details

Acknowledgments

  • Google
  • AWS Documentation
  • etc

About

These scripts are used to distribute an AMI to all regions of AWS and publish it publicly in the community AMI repository.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published