This repository provides an example of how to use RunAtlantis for Terraform automation.
- Terraform installed
- Atlantis installed and configured
- A GitHub repository to host your Terraform code
-
Clone the repository:
git clone https://github.com/garovu/run-atlantis-example.git cd run-atlantis-example -
Configure Atlantis:
Create an
atlantis.yamlfile in the root of your repository with the following content:version: 3 projects: - name: example dir: . workspace: default autoplan: when_modified: ["*.tf", "*.tfvars"] enabled: true
-
Create Terraform configuration:
Add your Terraform configuration files in the repository. For example, create a
main.tffile:provider "aws" { region = "us-west-2" } resource "aws_s3_bucket" "example" { bucket = "my-example-bucket" acl = "private" }
-
Initialize Terraform:
terraform init
-
Plan and apply changes:
Commit and push your changes to the repository. Atlantis will automatically run
terraform planandterraform applybased on the configuration inatlantis.yaml. -
Review and approve:
Review the plan output in the pull request comments and approve the changes to apply them.
Feel free to open issues or submit pull requests if you find any bugs or have suggestions for improvements.
This project is licensed under the MIT License - see the LICENSE file for details.