Skip to content

chrisb3ll/terraform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform

Example Infrastructure Provisioning

You will need

Environment Variables

  • export AWS_ACCESS_KEY_ID="yourAWSAccessKey"
  • export AWS_SECRET_ACCESS_KEY="yourAWSSecretKey"
  • export AWS_DEFAULT_REGION="yourAWSDefaultRegion"

Environment variable management is personal preference.
You could use direnv.

Key pairs

Terraform cannot create new key pairs, only import existing.
As a manual step either way, please create a key pair in the console.
Default expected is terraform_key.

Start

A simple bash wrapper tf.sh is available for use:

  usage: ./tf.sh [ -a value -e value -x 'value(s)' ]

     -a --> action: plan, push, apply
     -e --> environment: management, dev, test, prod etc.
     -x --> extra options: terraform args (optional)

Roles

Roles, in the context of this project, are a collection of Terraform configuration files.

shared:
Default
Re-usable configuration for creating similar environments (e.g. dev, tst, prd) Number of instances, IP address etc. defined in variable files

envName:
Specific configuration for non generic environment creation. (e.g. mgt)

Recommendations

  • Create a VPC per environment or role (dev, tst, mgt etc.)
  • Use a minimum two availability zones per VPC

About

Example Terraform Project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published