Code Monkey home page Code Monkey logo

terraform's Introduction

tfaction-getting-started

Getting Started with tfaction.

In this getting started, you create a repository from the template repository and set up tfaction and manage GitHub Issue Label with Terraform.

You would know how to set up tfaction and how tfaction works.

Steps

Set up.

  1. Create a repository from this template repository
  2. Create required resources with Terraform
  3. Create Personal Access Token
  4. Fix the template and tfaction-root.yaml

Let's tfaction.

  1. Scaffold a working directory
  2. Create a pull request

Create required resources with Terraform

Create the following resources.

  • IAM OpenID Connect provider
  • S3 Buckets
  • IAM Roles
$ cd aws/github-terraform-ci
$ vi main.tf # Change local values
$ terraform init
$ terraform plan
$ terraform apply

After this getting started, clean up resources.

$ terraform destroy

Create Personal Access Token

We recommend using GitHub App instead of Personal Access Token, but in this getting started let's use a personal access token. Create a Personal Access Token and set it as GitHub Actions Secret.

https://github.com/settings/tokens/new

Secret Name: GH_PERSONAL_ACCESS_TOKEN

https://docs.github.com/en/actions/security-guides/encrypted-secrets

Required permission: https://suzuki-shunsuke.github.io/tfaction/docs/config/github-token

Fix the template and tfaction-root.yaml

$ vi tfaction-root.yaml
$ vi templates/github/main.tf
$ git add tfaction-root.yaml templates/github
$ git checkout -b update-template
$ git commit -m "update template"
$ git push origin update-template
$ gh pr create -t "update template" -b "update template"

Please merge the pull request.

Scaffold a working directory

Please run GitHub Actions Workflow scaffold-working-directory.

$ gh workflow run scaffold-working-directory.yaml -f target=github/foo

Then a pull request would be created.

Please merge the pull request.

Create a pull request

The working directory github/foo was created. Let's add an issue request label with Terraform.

$ git fetch origin main
$ git checkout -b add-issue-label origin/main
$ vi github/foo/label.tf

label.tf

resource "github_issue_label" "bar" {
  repository  = "tfaction-getting-started" # CHANGE
  name        = "bar"
  color       = "FF0000"
  description = "bar"
}
$ git add github/foo/label.tf
$ git commit -m "add an issue label"
$ git push origin add-issue-label
$ gh pr create -t "add an issue label" -b "add an issue label"

image

Please confirm the result of terraform plan and merge the pull request. Then terraform apply would be run in the main branch.

image

LICENSE

MIT

terraform's People

Contributors

44smkn avatar renovate-bot avatar renovate[bot] avatar

Watchers

 avatar

terraform's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency aquasecurity/tfsec to v1.28.10 (aws/isucon11-qualify)
  • chore(deps): update dependency aquasecurity/tfsec to v1.28.10 (aws/private-isu)
  • chore(deps): update dependency aquasecurity/tfsec to v1.28.10 (modules/eks-with-karpenter)
  • chore(deps): update dependency int128/ghcp to v1.13.3 ()
  • chore(deps): update dependency minamijoyo/tfmigrate to v0.3.24 ()
  • chore(deps): update dependency cli/cli to v2.55.0 ()
  • chore(deps): update dependency hashicorp/terraform to v1.9.5 (aws/isucon11-qualify)
  • chore(deps): update dependency hashicorp/terraform to v1.9.5 (aws/private-isu)
  • chore(deps): update dependency hashicorp/terraform to v1.9.5 (modules/eks-with-karpenter)
  • chore(deps): update dependency open-policy-agent/conftest to v0.55.0 (aws/isucon11-qualify)
  • chore(deps): update dependency open-policy-agent/conftest to v0.55.0 (aws/private-isu)
  • chore(deps): update dependency reviewdog/reviewdog to v0.20.1 ()
  • chore(deps): update dependency suzuki-shunsuke/ci-info to v2.3.0 ()
  • chore(deps): update dependency terraform-docs/terraform-docs to v0.18.0 ()
  • chore(deps): update dependency terraform-linters/tflint to v0.53.0 (aws/private-isu)
  • chore(deps): update dependency terraform-linters/tflint to v0.53.0 (modules/eks-with-karpenter)
  • chore(deps): update dependency terraform-linters/tflint-ruleset-aws to v0.32.0 (modules/eks-with-karpenter)
  • chore(deps): update suzuki-shunsuke/tfaction action to v0.7.3 (.github/workflows)
  • chore(deps): update terraform aws to v4.67.0 (templates/aws)
  • chore(deps): update terraform github.com/suzuki-shunsuke/terraform-aws-tfaction to v0.2.1 (aws/github-terraform-ci)
  • chore(deps): update terraform terraform-aws-modules/eks/aws to v18.31.2 (modules/eks-with-karpenter)
  • chore(deps): update actions/checkout action to v4 (.github/workflows)
  • chore(deps): update aquaproj/aqua-installer action to v3 (.github/workflows)
  • chore(deps): update aws-actions/configure-aws-credentials action to v4 (.github/workflows)
  • chore(deps): update dependency aquaproj/aqua to v2 (.github/workflows)
  • chore(deps): update dependency aquaproj/aqua-registry to v4 ()
  • chore(deps): update dependency aquaproj/aqua-registry to v4 (aws/eks)
  • chore(deps): update dependency aquaproj/aqua-registry to v4 (aws/isucon11-qualify)
  • chore(deps): update dependency aquaproj/aqua-registry to v4 (aws/private-isu)
  • chore(deps): update dependency aquaproj/aqua-registry to v4 (modules/eks-with-karpenter)
  • chore(deps): update dependency aquaproj/aqua-renovate-config to v2 ()
  • chore(deps): update dependency suzuki-shunsuke/github-comment to v6 ()
  • chore(deps): update dependency suzuki-shunsuke/tfcmt to v4 ()
  • chore(deps): update suzuki-shunsuke/github-action-renovate-config-validator action to v1 (.github/workflows)
  • chore(deps): update suzuki-shunsuke/tfaction action to v1 (.github/workflows)
  • chore(deps): update terraform aws to v5 (aws/eks)
  • chore(deps): update terraform aws to v5 (aws/github-terraform-ci)
  • chore(deps): update terraform aws to v5 (aws/isucon11-qualify)
  • chore(deps): update terraform aws to v5 (aws/private-isu)
  • chore(deps): update terraform aws to v5 (templates/aws)
  • chore(deps): update terraform github to v6 (templates/github)
  • chore(deps): update terraform terraform-aws-modules/eks/aws to v20 (modules/eks-with-karpenter)
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/actionlint.yaml
  • actions/checkout v3
  • aquaproj/aqua-installer v1.2.0
  • suzuki-shunsuke/github-action-actionlint v0.1.3
.github/workflows/apply.yaml
  • actions/checkout v3
  • aquaproj/aqua-installer v1.2.0
  • suzuki-shunsuke/tfaction v0.5.25
  • actions/checkout v3
  • aquaproj/aqua-installer v1.2.0
  • suzuki-shunsuke/tfaction v0.5.25
  • suzuki-shunsuke/tfaction v0.5.25
  • suzuki-shunsuke/tfaction v0.5.25
  • suzuki-shunsuke/tfaction v0.5.25
  • actions/checkout v3
  • aquaproj/aqua-installer v1.2.0
  • suzuki-shunsuke/tfaction v0.5.25
  • suzuki-shunsuke/tfaction v0.5.25
  • suzuki-shunsuke/tfaction v0.5.25
  • suzuki-shunsuke/tfaction v0.5.25
.github/workflows/bootstrap-eks-cluster.yaml
  • actions/checkout v2
  • aquaproj/aqua-installer v1.2.0
  • aws-actions/configure-aws-credentials v1.7.0
.github/workflows/hide_comment.yaml
  • actions/checkout v3
  • aquaproj/aqua-installer v1.2.0
.github/workflows/release-module.yaml
  • actions/checkout v2
  • aquaproj/aqua-installer v1.2.0
  • suzuki-shunsuke/tfaction v0.5.25
.github/workflows/renovate-config-validator.yaml
  • actions/checkout v3
  • suzuki-shunsuke/github-action-renovate-config-validator v0.1.3
.github/workflows/scaffold-module.yaml
  • actions/checkout v2
  • aquaproj/aqua-installer v1.2.0
  • suzuki-shunsuke/tfaction v0.5.25
.github/workflows/scaffold-working-directory.yaml
  • actions/checkout v3
  • aquaproj/aqua-installer v1.2.0
  • suzuki-shunsuke/tfaction v0.5.25
  • suzuki-shunsuke/tfaction v0.5.25
.github/workflows/test.yaml
  • actions/checkout v3
  • aquaproj/aqua-installer v1.2.0
  • suzuki-shunsuke/tfaction v0.5.25
  • actions/checkout v3
  • aquaproj/aqua-installer v1.2.0
  • suzuki-shunsuke/tfaction v0.5.25
  • suzuki-shunsuke/tfaction v0.5.25
  • suzuki-shunsuke/tfaction v0.5.25
  • actions/checkout v3
  • aquaproj/aqua-installer v1.2.0
  • suzuki-shunsuke/tfaction v0.5.25
  • suzuki-shunsuke/tfaction v0.5.25
  • suzuki-shunsuke/tfaction v0.5.25
  • suzuki-shunsuke/tfaction v0.5.25
regex
aqua.yaml
  • aquaproj/aqua-registry v1.11.0
  • cli/cli v2.33.0
  • int128/ghcp v1.13.2
  • minamijoyo/tfmigrate v0.3.15
  • reviewdog/reviewdog v0.14.2
  • suzuki-shunsuke/ci-info v2.1.2
  • suzuki-shunsuke/github-comment v4.5.2
  • suzuki-shunsuke/tfcmt v3.4.2
  • terraform-docs/terraform-docs v0.16.0
aws/eks/aqua.yaml
  • aquaproj/aqua-registry v1.8.0
aws/isucon11-qualify/aqua.yaml
  • aquaproj/aqua-registry v3.162.0
  • open-policy-agent/conftest v0.45.0
  • terraform-linters/tflint v0.46.1
  • aquasecurity/tfsec v1.28.1
  • hashicorp/terraform v1.5.6
aws/private-isu/aqua.yaml
  • aquaproj/aqua-registry v3.162.0
  • open-policy-agent/conftest v0.45.0
  • terraform-linters/tflint v0.46.1
  • aquasecurity/tfsec v1.28.1
  • hashicorp/terraform v1.5.6
modules/eks-with-karpenter/aqua.yaml
  • aquaproj/aqua-registry v1.11.0
  • aquasecurity/tfsec v1.28.1
  • terraform-linters/tflint v0.46.1
  • hashicorp/terraform v1.5.6
.github/workflows/actionlint.yaml
  • aquaproj/aqua v1.38.0
.github/workflows/apply.yaml
  • aquaproj/aqua v1.38.0
  • aquaproj/aqua v1.38.0
  • aquaproj/aqua v1.38.0
.github/workflows/bootstrap-eks-cluster.yaml
  • aquaproj/aqua v1.38.0
.github/workflows/hide_comment.yaml
  • aquaproj/aqua v1.38.0
.github/workflows/release-module.yaml
  • aquaproj/aqua v1.38.0
.github/workflows/scaffold-module.yaml
  • aquaproj/aqua v1.38.0
.github/workflows/scaffold-working-directory.yaml
  • aquaproj/aqua v1.38.0
.github/workflows/test.yaml
  • aquaproj/aqua v1.38.0
  • aquaproj/aqua v1.38.0
  • aquaproj/aqua v1.38.0
renovate.json5
  • aquaproj/aqua-renovate-config 0.1.10
  • aquaproj/aqua-renovate-config 0.1.10
  • aquaproj/aqua-renovate-config 0.1.10
aws/eks/aqua.yaml
  • aquaproj/aqua-registry v1.8.0
aws/isucon11-qualify/aqua.yaml
  • aquaproj/aqua-registry v3.162.0
  • open-policy-agent/conftest v0.45.0
  • terraform-linters/tflint v0.46.1
  • aquasecurity/tfsec v1.28.1
  • hashicorp/terraform v1.5.6
aws/private-isu/aqua.yaml
  • aquaproj/aqua-registry v3.162.0
  • open-policy-agent/conftest v0.45.0
  • terraform-linters/tflint v0.46.1
  • aquasecurity/tfsec v1.28.1
  • hashicorp/terraform v1.5.6
modules/eks-with-karpenter/aqua.yaml
  • aquaproj/aqua-registry v1.11.0
  • aquasecurity/tfsec v1.28.1
  • terraform-linters/tflint v0.46.1
  • hashicorp/terraform v1.5.6
aws/eks/aqua/conftest.yaml
  • open-policy-agent/conftest v0.30.0
aws/eks/aqua/terraform.yaml
  • hashicorp/terraform v1.1.7
aws/eks/aqua/tflint.yaml
  • terraform-linters/tflint v0.34.1
aws/eks/aqua/tfsec.yaml
  • aquasecurity/tfsec v1.8.0
modules/eks-with-karpenter/.tflint.hcl
  • terraform-linters/tflint-ruleset-aws 0.23.1
terraform
aws/eks/main.tf
  • aws 4.0.0
  • hashicorp/terraform >= 1.0
aws/github-terraform-ci/main.tf
  • aws ~> 4.0
  • github.com/suzuki-shunsuke/terraform-aws-tfaction v0.1.4
aws/isucon11-qualify/terraform.tf
  • aws 4.19.0
  • hashicorp/terraform >= 1.0
aws/private-isu/terraform.tf
  • aws 4.19.0
  • hashicorp/terraform >= 1.0
modules/eks-with-karpenter/main.tf
  • aws >= 4.0.0
  • local >= 2.0.0
  • hashicorp/terraform >= 1.0
  • terraform-aws-modules/eks/aws 18.24.1
  • terraform-aws-modules/iam/aws 4.24.1
templates/aws/main.tf
  • aws 4.19.0
  • hashicorp/terraform >= 1.0
templates/github/main.tf
  • github ~> 4.0
  • hashicorp/terraform >= 1.0
tflint-plugin
modules/eks-with-karpenter/.tflint.hcl

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.