Example Infrastructure Provisioning
- Terraform (v0.6.12+)
- AWS Console Access
- 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.
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
.
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, 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)
- Create a VPC per environment or role (dev, tst, mgt etc.)
- Use a minimum two availability zones per VPC