This repository contains Terraform code for provisioning and managing cloud infrastructure on Amazon Web Services (AWS) using infrastructure-as-code approach.
Before running the Terraform code, make sure the following requirements are met.
This project is designed for use with Terraform. Verify your installed version with terraform --version and install a compatible release if needed.
- Terraform >= 1.15.0
- terraform-provider-aws version = 6.64.0
To deploy the resources successfully, you can use an IAM user with AdministratorAccess. For a more secure setup, you may also use a more restrictive role or policy that follows the principle of least privilege (PoLP).
From your terminal, navigate to the Terraform configuration directory and run the commands below:
- Run
terraform initto initialize the working directory. - Run
terraform validateto confirm the configuration is syntactically valid and internally consistent. - Run
terraform fmtto format the configuration files according to Terraform conventions. - Run
terraform planto preview the execution plan. - Run
terraform applyto create or update the resources defined in the configuration. - Run
terraform destroyto remove the resources defined in the configuration.
This repository already includes a .pre-commit-config.yaml. Run the following commands to install the hooks locally:
python -m pip install pre-commit
pre-commit install
pre-commit validate-configThis installs the hook into .git/hooks/pre-commit. Once installed, pre-commit runs automatically when you commit changes. By default, it checks only the files included in the commit.
To run all hooks manually, use:
pre-commit run --all-files
pre-commit run <hook_id>https://www.terraform.io/cli https://registry.terraform.io/providers/hashicorp/aws/latest/docs