Skip to content

Commit fa057f4

Browse files
committed
[NDR-108 readding db]
1 parent aa62151 commit fa057f4

File tree

4 files changed

+26
-9
lines changed

4 files changed

+26
-9
lines changed

.github/workflows/terraform-deploy-feature-to-sandbox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383

8484
- name: Terraform Init
8585
id: init
86-
run: terraform init -backend-config=backend.conf
86+
run: terraform init -backend-config=backend.conf -reconfigure
8787
working-directory: ./infrastructure
8888
shell: bash
8989

backup-vault/teraform/main.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ terraform {
66
}
77
}
88
backend "s3" {
9-
use_lockfile = true
10-
region = "eu-west-2"
11-
key = "ndr/terraform.tfstate"
12-
encrypt = true
9+
dynamodb_table = "ndr-backup-terraform-lock"
10+
use_lockfile = true
11+
region = "eu-west-2"
12+
key = "ndr/terraform.tfstate"
13+
encrypt = true
1314
}
1415
}
1516
provider "aws" {

bootstrap/main.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,21 @@ resource "aws_s3_bucket_public_access_block" "public_access_block" {
6868

6969
data "aws_caller_identity" "current" {}
7070

71+
resource "aws_dynamodb_table" "dynamodb_terraform_state_lock" {
72+
name = "ndr-terraform-locks"
73+
hash_key = "LockID"
74+
read_capacity = 20
75+
write_capacity = 20
76+
77+
attribute {
78+
name = "LockID"
79+
type = "S"
80+
}
81+
lifecycle {
82+
prevent_destroy = true
83+
}
84+
}
85+
7186
variable "region" {
7287
type = string
7388
default = "eu-west-2"

infrastructure/main.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ terraform {
1212
}
1313
}
1414
backend "s3" {
15-
use_lockfile = true
16-
region = "eu-west-2"
17-
key = "ndr/terraform.tfstate"
18-
encrypt = true
15+
use_lockfile = true
16+
dynamodb_table = "ndr-terraform-locks"
17+
region = "eu-west-2"
18+
key = "ndr/terraform.tfstate"
19+
encrypt = true
1920
}
2021
}
2122
provider "aws" {

0 commit comments

Comments
 (0)