-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from iron-security/fix/apply
fix: run in multiple plans
- Loading branch information
Showing
15 changed files
with
129 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,9 +28,8 @@ jobs: | |
name: Authenticate to Google Cloud | ||
uses: google-github-actions/[email protected] | ||
with: | ||
token_format: access_token | ||
access_token_lifetime: 900s | ||
workload_identity_provider: projects/1049058775616/locations/global/workloadIdentityPools/main-pool/providers/github | ||
workload_identity_provider: projects/1049058775616/locations/global/workloadIdentityPools/main-pool/providers/github-sa-provider | ||
service_account: [email protected] | ||
create_credentials_file: true | ||
- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: test | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- helm/ | ||
- kubernetes/ | ||
|
||
env: | ||
TF_LOG: INFO | ||
TF_VAR_cf_email: ${{ secrets.TF_VAR_CF_EMAIL }} | ||
TF_VAR_cf_api_key: ${{ secrets.TF_VAR_CF_API_KEY }} | ||
TF_VAR_github_token: ${{ secrets.TF_VAR_GITHUB_TOKEN }} | ||
|
||
jobs: | ||
|
||
test-infra: | ||
|
||
name: terraform infrastructure | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
steps: | ||
- | ||
uses: actions/checkout@v3 | ||
- | ||
uses: hashicorp/setup-terraform@v2 | ||
- | ||
name: Terraform fmt | ||
run: terraform fmt -check=true | ||
- | ||
name: Authenticate to Google Cloud | ||
uses: google-github-actions/[email protected] | ||
with: | ||
access_token_lifetime: 900s | ||
workload_identity_provider: projects/1049058775616/locations/global/workloadIdentityPools/main-pool/providers/github-sa-provider | ||
service_account: [email protected] | ||
create_credentials_file: true | ||
- | ||
name: Terraform Init | ||
run: terraform init | ||
- | ||
name: Terraform Validate | ||
run: terraform validate -no-color | ||
- | ||
name: Terraform Plan | ||
run: terraform plan -no-color -lock=false -input=false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- | ||
name: Cleanup | ||
if: always() | ||
run: rm "${GOOGLE_APPLICATION_CREDENTIALS}" || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
terraform { | ||
required_providers { | ||
github = {} | ||
github = { | ||
source = "integrations/github" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ variable "cf_account_id" { | |
variable "github_token" {} | ||
|
||
# github org/owner slug | ||
variable "github_owner" { | ||
variable "github_org" { | ||
default = "iron-security" | ||
} | ||
|
||
|
@@ -30,10 +30,4 @@ variable "gcloud_region" { | |
# the full email address of the terraform service account | ||
variable "gcp_serviceaccount_email" { | ||
default = "[email protected]" | ||
} | ||
|
||
# this indicates that we skip the helm/kubernetes providers and only run the google one | ||
# this fixes a nasty limitation of Terraform where you can't plan/apply on things that are | ||
# not known yet, like the kubernetes cluster credentials/hostname, resulting | ||
# in errors like "Error: Get "http://localhost/api/v1/namespaces": dial tcp [::1]:80: connect: connection refused" | ||
//variable "skip_kubernetes_deploy" {default = false} | ||
} |