Authors: David Wright ([email protected]) and Tony Vattahil ([email protected])
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
--For Mac/Linux
export TERRAFORM_CONFIG="$HOME/.terraform.d/credentials.tfrc.json"
--For Windows
export TERRAFORM_CONFIG="$HOME/AppData/Roaming/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-ia/terraform-aws-rds-aurora repository using the following command:
git clone https://github.com/aws-ia/terraform-aws-rds-aurora.git
-
Change directory to the root repository directory.
cd terraform-aws-rds-aurora/
-
For setting up a new terraform workspace:
cd setup_workspace
terraform init
terraform apply
-
To create new VPC and deploy Aurora module:
- Change to the deploy directory. Run
cd ../deploy
- Initialize the deploy directory. Run
terraform init
. - Start a Terraform run using the configuration files in your deploy directory. Run
terraform apply
orterraform apply -var-file="$HOME/.aws/terraform.tfvars"
(Note: The deployment is remotely run in Terraform Cloud)
For existing VPCs, pass the list of private subnets (var.Private_subnet_ids_p & var.Private_subnet_ids_s) directly to the Aurora module.
- Change to the deploy directory. Run