Terraform to setup an AWS RDS cluster
- Terraform v0.12.9 - https://www.terraform.io/
Example:
export AWS_ACCOUNT_ID=123456789012
export AWS_ACCESS_KEY_ID=ABCD...
export AWS_SECRET_ACCESS_KEY=abcd...
export AWS_REGION=eu_west1
export master_password=12345678...
$ terraform init
$ terraform validate
$ terraform plan -out=tfplan -input=false
-var "cluster_identifier=aurora-cluster"
-var "aws_account_id=${AWS_ACCOUNT_ID}"
-var "access_key=${AWS_ACCESS_KEY_ID}"
-var "secret_key=${AWS_SECRET_ACCESS_KEY}"
-var "region=${AWS_REGION}"
-var "master_password=${MASTER_PASSWORD}"
$ terraform show
$ terraform apply tfplan
If the RDS instance already exists when you add these lines you will need to run
$ terraform refresh
$ terraform destroy -input=false
-var "cluster_identifier=aurora-cluster"
-var "aws_account_id=${AWS_ACCOUNT_ID}"
-var "access_key=${AWS_ACCESS_KEY_ID}"
-var "secret_key=${AWS_SECRET_ACCESS_KEY}"
-var "region=${AWS_REGION}"
-var "master_password=${MASTER_PASSWORD}"