Authors: David Wright (dwright@hashicorp.com) and Tony Vattahil (tonynv@amazon.com)
To deploy the Terraform Amazon Aurora module, do the following:
- Install Terraform. For instructions and a video tutorial, see Install Terraform.
- Sign up and log into Terraform Cloud. (There is a free tier available.)
- Configure Terraform Cloud API access. Run the following to generate a Terraform Cloud token from the command line interface:
terraform login
Export TERRAFORM_CONFIG
export TERRAFORM_CONFIG="$HOME/.terraform.d/credentials.tfrc.json"
-
Configure the AWS Command Line Interface (AWS CLI). For more information, see Configuring the AWS CLI.
-
If you don't have git installed, install git.
-
Clone this aws-quickstart/terraform-aws-rds_aurora repository using the following command:
git clone https://github.com/aws-quickstart/terraform-aws-rds_aurora
-
Change directory to the root repository directory.
cd terraform-aws-rds_aurora/
-
Change to the deploy directory.
- For a new virtual private cloud (VPC), use
cd setup_workspace
. - For an existing VPC, pass the VPC ID directly to the module.
- For a new virtual private cloud (VPC), use
-
To perform operations locally, do the following:
a. Initialize the deploy directory. Run
terraform init
.
b. Start a Terraform run using the configuration files in your deploy directory. Runterraform apply
orterraform apply -var-file="$HOME/.aws/terraform.tfvars"
. -
Change to the deploy directory with
cd ../deploy
. -
Run
terraform init
. -
Run
terraform apply
or Runterraform apply -var-file="$HOME/.aws/terraform.tfvars"
.Terraform apply
is remotely run in Terraform Cloud.