Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write GitHub Actions for running Terraform stages #30

Closed
9 tasks done
chelseybeck opened this issue Jan 30, 2024 · 2 comments
Closed
9 tasks done

Write GitHub Actions for running Terraform stages #30

chelseybeck opened this issue Jan 30, 2024 · 2 comments

Comments

@chelseybeck
Copy link
Member

chelseybeck commented Jan 30, 2024

Dependencies

Overview

In order to manage IAM resources as code using Terraform, we will need the ability to run a plan on PR creation and an apply when the PR is merged into main.

@dflook created some pretty great GitHub Actions that work well with this workflow. We could follow this established pattern

Action Items

  • Create a GitHub Action (GHA) terraform-plan.yaml for the Terraform plan workflow

    • action is triggered on PR creation | example using dflook's GitHub action
      • only when files end in .tf
        • we will have readme and other files in these directories, and we don't want changes there to trigger this workflow
    • results of the plan are written back to the PR as a comment
  • Create a GHA terraform-apply.yaml for the Terraform apply workflow

    • action is triggered on PR merge to main
      • only when files end in .tf

Resources/Instructions

DevOps Security code repository | PM a CoP lead in Slack if you don't already have access.

dflook GitHub Actions

@Tyson-miller wrote a GitHub Action for running Terraform plan on incubator projects...though our needs are simpler

@chelseybeck
Copy link
Member Author

Update: this is almost complete. Next time we meet, we can limit both actions to only kick off when terraform files are changed or when files are changed inside of the terraform directory. We prob don't need both.

@chelseybeck chelseybeck transferred this issue from hackforla/ops May 16, 2024
@chelseybeck
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

7 participants