Creating a Transit gateway with a few VPC's attached to it.
Shows how to use AWS with Terraform to accomplish the following tasks:
- Build an AWS TGW
- Build multiple AWS VPC
- Build multiple AWS Subnet
- Build multiple AWS Route table and route
- Attache VPC's to the TGW
- You must have an AWS account, and have your default credentials and AWS Region configured
- You must have Terraform installed
- As an AWS best practice, grant this code least privilege, or only the permissions required to perform a task. For more information, see Grant Least Privilege in the AWS Identity and Access Management User Guide.
- This code has been tested in us-west-1 AWS Regions only. However it should work in any other region.
- Running this code might result in charges to your AWS account.
It will deploy to the account setup for the aws cli called 'default'
cd AWS_TGW_VPC-s
terraform init
terraform validate
terraform apply --auto-approve
terraform destroy --auto-approve
- clone this Git repo
- cd to the the directory AWS_TGW_VPC-s
- use terraform init command to initialize the Terraform working directory and to download plugins for a provider (aws)
- terraform validate command will validate the code before actual deployment
- terraform plan command will show the execution code before making the actual deployment
- terraform apply
- Alternate command : terraform apply -auto-approve
- terraform destroy
- Alternate command : terraform destroy -auto-approve
- terraform fmt -recursive # A way to format the terraform code