- 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-repository-name repository using the following command:
git clone https://github.com/aws-quickstart/terraform-repository-name
-
Change directory to the root repository directory.
cd /terraform-repository-name/
-
Change to the deploy directory.
cd setup_workspace
.
-
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
orterraform apply -var-file="$HOME/.aws/terraform.tfvars"
.Terraform apply
is run remotely in Terraform Cloud.