{"repo":"xsalazar/terraform-github-actions-example","free":true,"listed":false,"github":"https://github.com/xsalazar/terraform-github-actions-example","clone":"git clone https://github.com/xsalazar/terraform-github-actions-example.git","description":"Small examples showing how to use Terraform GitHub Actions within a repository","language":"HCL","stars":23,"topics":["terraform","github-actions"],"license":null,"category":"deployment-docker-iac","readme_excerpt":"Terraform GitHub Actions Examples This repository is a set of small examples that show how to use the official Terraform GitHub Actions to run on your personal repositories. Getting Started The official Terraform documentation can be found here Setting up secrets In order to run terraform plan or terraform apply , you will potentially need to setup credentials to allow for the workflow to properly communicate with any cloud providers you may be using. In this example, since I am setting up an AWS provider and creating an EC2 instance, I need to pass through AWS credentials. You provision these per-repository. You can setup these secrets by going to the repository Settings Secrets Add new secret. Once created, you can reference those secrets from the workflow by using ${{ secrets.AWS ACCESS KEY ID }} or ${{ secrets.AWS SECRET ACCESS KEY }} . This Action uses the configure-aws-credentials Action to set up the environment. It is worth noting that GITHUB TOKEN is automatically provided to workflows, and you do not need to manually set this up. Actions terraform fmt You can see an example of this command being run in this pull request. terraform validate You can see an example of this command being run in this pull request. terraform plan You can see an example of this command being run in this pull request. The plan output is too long to include here, but you can expand the output in the original comment.","default_branch":null,"files":null,"tree":[],"storefront":"/r/xsalazar","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/xsalazar/terraform-github-actions-example/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}