Skip to content

Commit

Permalink
create backend local tf files
Browse files Browse the repository at this point in the history
  • Loading branch information
ale210 committed Jun 30, 2024
1 parent c29d437 commit 74056cc
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/terraform-apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ jobs:
uses: dflook/terraform-apply@v1
with:
path: terraform
backend_config_file: prod.backend.tfvars
1 change: 1 addition & 0 deletions .github/workflows/terraform-plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ jobs:
uses: dflook/terraform-plan@v1
with:
path: terraform
backend_config_file: prod.backend.tfvars
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# Ignore variables files
*.auto.tfvars

# Ignore local development variable file
backend.tfvars

# Ignore override files
*.tfoverride

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ cd terraform
- Next initilize the terraform configuration
```bash
terraform init
terraform init --backend-config=backend.tfvars
```
- Then generate and run an execution plan
Expand Down
7 changes: 1 addition & 6 deletions terraform/backend.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
terraform {
backend "s3" {
bucket = "hfla-ops-terraform-state"
key = "devops-security/terraform.tfstate"
region = "us-west-2"
dynamodb_table = "hfla_ops_terraform_table"
encrypt = true
}
}
}
5 changes: 5 additions & 0 deletions terraform/prod.backend.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bucket = "hfla-ops-terraform-state"
key = "devops-security/terraform.tfstate"
region = "us-west-2"
dynamodb_table = "hfla_ops_terraform_table"
encrypt = true

0 comments on commit 74056cc

Please sign in to comment.