{"id":19717119,"url":"https://github.com/xsalazar/terraform-github-actions-example","last_synced_at":"2025-07-01T12:33:17.803Z","repository":{"id":47108044,"uuid":"216604308","full_name":"xsalazar/terraform-github-actions-example","owner":"xsalazar","description":"Small examples showing how to use Terraform GitHub Actions within a repository","archived":false,"fork":false,"pushed_at":"2023-01-07T01:22:43.000Z","size":264,"stargazers_count":23,"open_issues_count":3,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-29T20:39:49.732Z","etag":null,"topics":["github-actions","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xsalazar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"xsalazar"}},"created_at":"2019-10-21T15:37:57.000Z","updated_at":"2023-02-10T18:14:44.000Z","dependencies_parsed_at":"2023-02-06T10:30:33.844Z","dependency_job_id":null,"html_url":"https://github.com/xsalazar/terraform-github-actions-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xsalazar/terraform-github-actions-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsalazar%2Fterraform-github-actions-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsalazar%2Fterraform-github-actions-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsalazar%2Fterraform-github-actions-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsalazar%2Fterraform-github-actions-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xsalazar","download_url":"https://codeload.github.com/xsalazar/terraform-github-actions-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsalazar%2Fterraform-github-actions-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262963340,"owners_count":23391796,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","terraform"],"created_at":"2024-11-11T22:44:43.801Z","updated_at":"2025-07-01T12:33:17.739Z","avatar_url":"https://github.com/xsalazar.png","language":"HCL","readme":"# Terraform GitHub Actions Examples\nThis repository is a set of small examples that show how to use the official [Terraform GitHub Actions](https://github.com/hashicorp/setup-terraform) to run on your personal repositories.\n\n## Getting Started\nThe official Terraform documentation can be found [here](https://www.terraform.io/docs/github-actions/index.html)\n\n### Setting up secrets\nIn 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.\n\nYou provision these per-repository. You can setup these secrets by going to the repository Settings \u003e Secrets \u003e Add new secret.\n\n![Adding secrets](assets/secrets.png)\n\nOnce 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](https://github.com/aws-actions/configure-aws-credentials) Action to set up the environment.\n\nIt is worth noting that `GITHUB_TOKEN` is [automatically provided](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token) to workflows, and you do not need to manually set this up.\n\n## Actions\n\n### `terraform fmt`\nYou can see an example of this command being run in [this pull request](https://github.com/xsalazar/terraform-github-actions-example/pull/19).\n![terraform fmt](assets/format.png)\n\n### `terraform validate`\nYou can see an example of this command being run in [this pull request](https://github.com/xsalazar/terraform-github-actions-example/pull/21).\n![terraform validate](assets/validate.png)\n\n### `terraform plan`\nYou can see an example of this command being run in [this pull request](https://github.com/xsalazar/terraform-github-actions-example/pull/20). The plan output is too long to include here, but you can expand the output in the original comment.\n![terraform plan](assets/plan.png)\n","funding_links":["https://github.com/sponsors/xsalazar"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxsalazar%2Fterraform-github-actions-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxsalazar%2Fterraform-github-actions-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxsalazar%2Fterraform-github-actions-example/lists"}