This repository demonstrates how to set up an AWS instance using Terraform and how to test it using Terratest.
- Terraform >= 0.14
- Go >= 1.15
- AWS CLI configured with Admin-level credentials
- GitHub Account (Optional, if you wish to set up CI/CD)
.
├── .github
│ └── workflows
│ └── ci.yml
├── Makefile
├── README.md
├── terraform
│ ├── main.tf
│ ├── outputs.tf
│ └── variables.tf
└── tests
├── go.mod
└── main_test.go
- Navigate to the
terraform
directory:
cd terraform
- Initialize Terraform:
terraform init
- Apply the Terraform code:
terraform apply
- Navigate to the
tests
directory:
cd tests
- Run the tests:
go test
Or you can use the provided Makefile to run the tests:
make test