Skip to content

Commit c68b363

Browse files
committed
fix s3 backend credentials not being passed through
1 parent 4313880 commit c68b363

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

.github/workflows/tofu.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ env:
2020
TF_VAR_fastly_api_key: ${{ secrets.fastly_api_key }}
2121
TF_VAR_porkbun_api_key: ${{ secrets.porkbun_api_key }}
2222
TF_VAR_porkbun_secret_key: ${{ secrets.porkbun_secret_key }}
23-
AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }}
24-
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }}
23+
TF_VAR_aws_access_key_id: ${{ secrets.aws_access_key_id }}
24+
TF_VAR_aws_secret_access_key: ${{ secrets.aws_secret_access_key }}
2525

2626
jobs:
2727
validate:
@@ -32,6 +32,8 @@ jobs:
3232
- uses: opentofu/setup-opentofu@v1
3333
with:
3434
tofu_version_file: .opentofu-version
35+
- name: Tofu Init (Staging)
36+
run: tofu init -var-file="env-staging.tfvars" -input=false
3537
- name: Tofu Validate
3638
run: tofu validate -no-color
3739
- name: Tofu Format Check

backend.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ terraform {
1010
bucket = "tofu-remote-state"
1111
key = local.env_key_map[var.env]
1212
region = "us-east"
13-
profile = "fastly-us-east"
13+
access_key = var.aws_access_key_id
14+
secret_key = var.aws_secret_access_key
1415
skip_credentials_validation = true
1516
skip_region_validation = true
1617
use_path_style = true
18+
use_lockfile = true
1719
endpoints = {
1820
s3 = "https://us-east.object.fastlystorage.app"
1921
}

variables.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,12 @@ variable "porkbun_api_key" {
2424

2525
variable "porkbun_secret_key" {
2626
type = string
27+
}
28+
29+
variable "aws_access_key_id" {
30+
type = string
31+
}
32+
33+
variable "aws_secret_access_key" {
34+
type = string
2735
}

0 commit comments

Comments
 (0)