项目作者: shahadarsh

项目描述 :
Workshop exercises for hashicorp products
高级语言: HCL
项目地址: git://github.com/shahadarsh/hashicorp-workshop.git
创建时间: 2017-09-28T01:57:12Z
项目社区:https://github.com/shahadarsh/hashicorp-workshop

开源协议:MIT License

下载


HashiCorp Workshop

Exercises for Hashicorp Workshop

Prerequisites

Create AWS account

All exercises require an AWS account so create an account if you don’t have it

Create IAM user

  1. Go to your AWS console & create IAM user by following instructions here
  2. Create a user with name “usr_hashicorp” with Programmatic access & in Admin group
  3. Save “Access key ID” & “Secret access key” somewhere locally

Install AWS CLI

Install AWS CLI following instructions here

Workshop Steps

Configure AWS CLI with a profile

Configure AWS CLI by typing aws configure in your terminal & following the instructions
This profile will be used for access_key, secret_key etc.

Build AMI using Packer

Read Here

Use Terraform to provision EC2 instances

Read Here

Testing for Terraform

Destroy all instances/AMI

  1. Go to terraform/nginx directory
  2. terraform plan -destroy -var-file="../terraform.tfvars" -var "ami=${ami_id}"
  3. terraform destroy -var-file="../terraform.tfvars" -var "ami=${ami_id}"

  4. aws ec2 deregister-image --image-id ${ami_id}

  5. Go to terraform/vpc directory

  6. terraform plan -destroy
  7. terraform destroy