Skip to content

Commit 9ac764e

Browse files
authored
Merge pull request #56 from appvia/s3-statelock
feat: version bumps, switch to s3 state locking instead of dynamodb
2 parents 6b4737c + 35f3c37 commit 9ac764e

5 files changed

+29
-11
lines changed

.github/workflows/terraform-destroy.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ on:
145145
type: string
146146

147147
terraform-version:
148-
default: "1.7.1"
148+
default: "1.11.2"
149149
description: "The version of terraform to use"
150150
required: false
151151
type: string
@@ -249,7 +249,7 @@ jobs:
249249
-backend-config="bucket=${{ inputs.aws-account-id }}-${{ inputs.aws-region }}-tfstate" \
250250
-backend-config="key=${{ steps.state-key.outputs.name }}" \
251251
-backend-config="encrypt=true" \
252-
-backend-config="dynamodb_table=${{ inputs.aws-account-id }}-${{ inputs.aws-region }}-tflock" \
252+
-backend-config="use_lockfile=true" \
253253
-backend-config="region=${{ inputs.aws-region }}" \
254254
${{ inputs.terraform-init-extra-args }}
255255
- name: Terraform Validate
@@ -377,7 +377,7 @@ jobs:
377377
-backend-config="bucket=${{ inputs.aws-account-id }}-${{ inputs.aws-region }}-tfstate" \
378378
-backend-config="key=${{ steps.state-key.outputs.name }}" \
379379
-backend-config="encrypt=true" \
380-
-backend-config="dynamodb_table=${{ inputs.aws-account-id }}-${{ inputs.aws-region }}-tflock" \
380+
-backend-config="use_lockfile=true" \
381381
-backend-config="region=${{ inputs.aws-region }}" \
382382
${{ inputs.terraform-init-extra-args }}
383383
- name: Download tfplan

.github/workflows/terraform-drift.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ on:
7979
type: string
8080

8181
terraform-version:
82-
default: "1.7.1"
82+
default: "1.11.2"
8383
description: "The version of terraform to use"
8484
required: false
8585
type: string
@@ -161,7 +161,13 @@ jobs:
161161
fi
162162
- name: Terraform Init
163163
id: init
164-
run: terraform -chdir=${{ inputs.terraform-dir }} init -backend-config="bucket=${{ inputs.aws-account-id }}-${{ inputs.aws-region }}-tfstate" -backend-config="key=${{ steps.state-key.outputs.name }}" -backend-config="encrypt=true" -backend-config="dynamodb_table=${{ inputs.aws-account-id }}-${{ inputs.aws-region }}-tflock" -backend-config="region=${{ inputs.aws-region }}"
164+
run: |
165+
terraform -chdir=${{ inputs.terraform-dir }} init \
166+
-backend-config="bucket=${{ inputs.aws-account-id }}-${{ inputs.aws-region }}-tfstate" \
167+
-backend-config="key=${{ steps.state-key.outputs.name }}" \
168+
-backend-config="encrypt=true" \
169+
-backend-config="use_lockfile=true" \
170+
-backend-config="region=${{ inputs.aws-region }}"
165171
- name: Terraform Validate
166172
id: validate
167173
run: terraform -chdir=${{ inputs.terraform-dir }} validate -no-color

.github/workflows/terraform-module-validation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ on:
7575
type: string
7676

7777
terraform-version:
78-
default: "1.9.0"
78+
default: "1.11.2"
7979
description: "The version of terraform to use"
8080
required: false
8181
type: string

.github/workflows/terraform-plan-and-apply-aws.yml

+16-4
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,13 @@ on:
179179
type: number
180180

181181
terraform-version:
182-
default: "1.9.0"
182+
default: "1.11.2"
183183
description: "The version of terraform to use"
184184
required: false
185185
type: string
186186

187187
trivy-version:
188-
default: "v0.56.2"
188+
default: "v0.60.0"
189189
description: "The version of trivy to use"
190190
required: false
191191
type: string
@@ -452,7 +452,13 @@ jobs:
452452
git config --global url."https://x-access-token:${{steps.get_workflow_token.outputs.token}}@github.com/".insteadOf "https://github.com/"
453453
- name: Terraform Init
454454
id: init
455-
run: terraform -chdir=${{ inputs.terraform-dir }} init -backend-config="bucket=${{ inputs.aws-account-id }}-${{ inputs.aws-region }}-tfstate" -backend-config="key=${{ steps.state-key.outputs.name }}" -backend-config="encrypt=true" -backend-config="dynamodb_table=${{ inputs.aws-account-id }}-${{ inputs.aws-region }}-tflock" -backend-config="region=${{ inputs.aws-region }}"
455+
run: |
456+
terraform -chdir=${{ inputs.terraform-dir }} init \
457+
-backend-config="bucket=${{ inputs.aws-account-id }}-${{ inputs.aws-region }}-tfstate" \
458+
-backend-config="key=${{ steps.state-key.outputs.name }}" \
459+
-backend-config="encrypt=true" \
460+
-backend-config="use_lockfile=true" \
461+
-backend-config="region=${{ inputs.aws-region }}"
456462
- name: Terraform Validate
457463
id: validate
458464
run: terraform -chdir=${{ inputs.terraform-dir }} validate -no-color
@@ -805,7 +811,13 @@ jobs:
805811
git config --global url."https://x-access-token:${{steps.get_workflow_token.outputs.token}}@github.com/".insteadOf "https://github.com/"
806812
- name: Terraform Init
807813
id: init
808-
run: terraform -chdir=${{ inputs.terraform-dir }} init -backend-config="bucket=${{ inputs.aws-account-id }}-${{ inputs.aws-region }}-tfstate" -backend-config="key=${{ steps.state-key.outputs.name }}" -backend-config="encrypt=true" -backend-config="dynamodb_table=${{ inputs.aws-account-id }}-${{ inputs.aws-region }}-tflock" -backend-config="region=${{ inputs.aws-region }}"
814+
run: |
815+
terraform -chdir=${{ inputs.terraform-dir }} init \
816+
-backend-config="bucket=${{ inputs.aws-account-id }}-${{ inputs.aws-region }}-tfstate" \
817+
-backend-config="key=${{ steps.state-key.outputs.name }}" \
818+
-backend-config="encrypt=true" \
819+
-backend-config="use_lockfile=true" \
820+
-backend-config="region=${{ inputs.aws-region }}"
809821
- name: Download tfplan
810822
uses: actions/download-artifact@v4
811823
with:

docs/terraform-drift.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ OPTIONAL INPUTS:
5555
- `terraform-lock-timeout` - Default: "30s"
5656
- `terraform-state-key` - Default: <repo-name>.tfstate
5757
- `terraform-values-file` - Default: <environment>.tfvars
58-
- `terraform-version` - Default: "1.7.1"
58+
- `terraform-version` - Default: "1.11.2"
5959
- `working-directory` - Default: "."
6060

6161
**Note:** This template may change over time, so it is recommended that you point to a tagged version rather than the main branch.

0 commit comments

Comments
 (0)