"Terraform is an open-source infrastructure as code software tool that enables you to safely and predictably create, change, and improve infrastructure."
This repository creates the following resources on AWS: IAM User Groups, Roles, Policies, and Attachments; S3 buckets; Glue Crawler and Athena. It also builds and tests what's been created with a GitHub Actions workflow.
Content | Description |
---|---|
.github/workflows | Github Actions workflow |
infrastructure | Terraform files |
The GitHub Actions workflow in this repository will initialize, validate, and build a plan for this Terraform project. To run it successfully, you have to insert your AWS Security Credentials (Access Key ID and Secret Access Key) in Github Secrets. This workflow won't deploy anything to your AWS account, so don't worry. If you want it to, though, you can simply add the command apply auto-approve
to it.
You can also run Terraform and test your code locally if you want. Just put your AWS Credentials in the file called provider.tf
and then follow these steps:
-
Initialize Terraform in your repository using the command
terraform init
. You should see this message:
- Then you have to validate what you've created using the command
terraform validate
. If your code is valid, it will show:
- After that, you can build a plan and see everything Terraform is going to deploy using the command
terraform plan
.
- Finally, to deploy your infrastructure to your cloud provider (in this case, AWS), use the command
terraform apply -auto-approve
.
- If this is just a test and you want to delete everything you've created, you don't have to do it manually. You can simply use the command
terraform destroy
. Type 'yes' to confirm the deletion.
When the deletion is completed, you'll see this message:
---------------