Skip to content

Commit 74056cc

Browse files
committed
create backend local tf files
1 parent c29d437 commit 74056cc

6 files changed

Lines changed: 12 additions & 7 deletions

File tree

.github/workflows/terraform-apply.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ jobs:
3232
uses: dflook/terraform-apply@v1
3333
with:
3434
path: terraform
35+
backend_config_file: prod.backend.tfvars

.github/workflows/terraform-plan.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ jobs:
3232
uses: dflook/terraform-plan@v1
3333
with:
3434
path: terraform
35+
backend_config_file: prod.backend.tfvars

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
# Ignore variables files
55
*.auto.tfvars
66

7+
# Ignore local development variable file
8+
backend.tfvars
9+
710
# Ignore override files
811
*.tfoverride
912

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ cd terraform
242242
- Next initilize the terraform configuration
243243
244244
```bash
245-
terraform init
245+
terraform init --backend-config=backend.tfvars
246246
```
247247
248248
- Then generate and run an execution plan

terraform/backend.tf

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
terraform {
22
backend "s3" {
3-
bucket = "hfla-ops-terraform-state"
4-
key = "devops-security/terraform.tfstate"
5-
region = "us-west-2"
6-
dynamodb_table = "hfla_ops_terraform_table"
7-
encrypt = true
83
}
9-
}
4+
}

terraform/prod.backend.tfvars

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
bucket = "hfla-ops-terraform-state"
2+
key = "devops-security/terraform.tfstate"
3+
region = "us-west-2"
4+
dynamodb_table = "hfla_ops_terraform_table"
5+
encrypt = true

0 commit comments

Comments
 (0)