DMCDeploy
Our goal is to implement infrastructure as code. Terraform.io was chosen to aid in this process because it is provider agnostic, open source and with good community support and documentation. Full instructions for how to use it can be found at https://terraform.io/.
Steps to create a Deployment:
- Install Terraform
- https://terraform.io/downloads.html – follow the instructions for your system
- make sure the path variables are properly set
debian based systems
$ echo "export PATH=$PATH:/path/to/terraform" >> ~/.bashrc
source ~/.bashrc
- verify install with: $ terraform -v
- Clone the DMCDeploy repo you want
- production – $ git clone https://bitbucket.org/DigitalMfgCommons/dmcdeploy.git
- development – git clone https://bitbucket.org/DigitalMfgCommons/dmcdeploy_dev.git
- Ensure that you have aws keys created for the appropriate region where you want to deploy to and that you have downloaded the appropriate .pem files
- Configure the variables found in terraform.tfvars
access_key = "your aws key"
secret_key = "your aws secret key"
key_name = "alexTERRA2" << make sure no .pem and make sure the key is configured for the appropriate aws region
key_full_path = "~/Desktop/aws/tf/test/DMCFrontEnd/alexTERRA2.pem" << full path to your pem file including the file
stackPrefix = "alex2" << this prefix will be added to all infrastructure elements created so that your stack can be identified form others
activeMqRootPass = "admin" << the admin root pass for activemq
activeMqUserPass = "user" << the user pass for activemq
stackPrefix = "alexGG" << prefix for the stack to be deployed so multiple stacks can coexist
release = "hot" << will determine which release to pull from 'hot'=master/newest code [for dev always use hot] 'alpha'=alpha release when available
aws_region = "us-west-2" << will deploy in Oregon region 'us-east-1' will deploy in Virginia
- Create a terraform plan named "a"
- $ terraform plan -out a
- This does not create infrastructure but allows one to visualize and verify the infrastructure that will be created
- $ terraform plan -out a
- Deploy the infrastructure created by plan "a"
- $ terraform apply a
- To bring down the infrastructure you deployed
- $ terraform destroy