Skip to content

Commit 2d35eef

Browse files
committed
Remove terrform init backend config
- this is not needed with terraform cloud - test (remove GH_TOKEN)
1 parent 546685a commit 2d35eef

File tree

3 files changed

+7
-25
lines changed

3 files changed

+7
-25
lines changed

.github/workflows/terraform_gh_runner.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ on:
1111
jobs:
1212
terraform_gh_runner:
1313
runs-on: ubuntu-latest
14-
env:
15-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
# env:
15+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1616

1717
steps:
1818
- name: Checkout repository
@@ -29,8 +29,8 @@ jobs:
2929
# Install any dependencies required by your Terraform code
3030
3131
- name: Run Bash Script
32-
env:
33-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
# env:
33+
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3434
run: |
3535
# GitHub repository and access token for github api calls, since GITHUB_TOKEN can't
3636
# be used for this purpose.
@@ -58,6 +58,6 @@ jobs:
5858
- name: Run Terraform
5959
working-directory: ./github-runners/terraform/base
6060
run: |
61-
terraform init-backend-config="organization=subspace" -backend-config="workspaces=${{ secrets.WORKSPACE_NAME }}"
61+
terraform init
6262
terraform plan -var-file=/tmp/terraform.tfvars
6363
terraform apply -auto-approve -var "gh_token=${{ secrets.RUNNER_TOKEN }}" -var-file=/tmp/terraform.tfvars

.github/workflows/terraform_template_deploy.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,6 @@ jobs:
5757
terraform_wrapper: false
5858
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
5959

60-
- name: Setup Remote Config Backend
61-
run: |
62-
cat > /tmp/config.remote.tfbackend <<EOF
63-
workspaces { name = "${{ inputs.tf_workspace_name }}"}
64-
hostname = "app.terraform.io"
65-
organization = "${{ inputs.tf_organization }}"
66-
EOF
67-
6860
- name: Terraform fmt
6961
working-directory: ${{ inputs.project }}/${{ inputs.resource }}
7062
run: terraform fmt -check
@@ -73,8 +65,7 @@ jobs:
7365
- name: Terraform Init for ${{ inputs.project }}/${{ inputs.resource }}
7466
working-directory: ${{ inputs.project }}/${{ inputs.resource }}
7567
run: |
76-
cat /tmp/config.remote.tfbackend
77-
terraform init -backend-config=/tmp/config.remote.tfbackend
68+
terraform init
7869
7970
- name: Terraform Validate
8071
working-directory: ${{ inputs.project }}/${{ inputs.resource }}

.github/workflows/terraform_template_ephemeral_deploy.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,6 @@ jobs:
6161
terraform_wrapper: false
6262
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
6363

64-
- name: Setup Remote Config Backend
65-
run: |
66-
cat > /tmp/config.remote.tfbackend <<EOF
67-
workspaces { name = "${{ inputs.tf_workspace_name }}"}
68-
hostname = "app.terraform.io"
69-
organization = "${{ inputs.tf_organization }}"
70-
EOF
71-
7264
- name: Terraform fmt
7365
working-directory: ${{ inputs.project }}/${{ inputs.instance }}/${{ inputs.resource }}
7466
run: terraform fmt -check
@@ -77,8 +69,7 @@ jobs:
7769
- name: Terraform Init for ${{ inputs.project }}/${{ inputs.instance }}/${{ inputs.resource }}
7870
working-directory: ${{ inputs.project }}/${{ inputs.instance }}/${{ inputs.resource }}
7971
run: |
80-
cat /tmp/config.remote.tfbackend
81-
terraform init -backend-config=/tmp/config.remote.tfbackend
72+
terraform init
8273
8374
- name: Terraform Validate
8475
working-directory: ${{ inputs.project }}/${{ inputs.instance }}/${{ inputs.resource }}

0 commit comments

Comments
 (0)