Skip to content

Commit 39895d1

Browse files
committed
Remove all stale tf references to the dynamodb lock table
1 parent 802dd9d commit 39895d1

7 files changed

Lines changed: 4 additions & 37 deletions

File tree

‎tf/environments/staging/environment.hcl‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# configuration and fed forward to the child modules when required.
55

66
locals {
7-
namespace = "ida"
87
environment = "staging"
98

109
aws_account = 209330743443
@@ -23,7 +22,6 @@ locals {
2322
]
2423
aws_dns_writer_role_name = "DNSWriterRole"
2524

26-
lock_table = "terraform-locks"
2725
oauth_client_id = "zzr1i8b3d4xqi3jb4lkro39r.ida.staging"
2826
postgres_version = 16
2927
opensearch_version = "Elasticsearch_7.7"

‎tf/modules/infra/authorization/README.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
| Name | Description | Type | Default | Required |
4141
|------|-------------|------|---------|:--------:|
4242
| <a name="input_allowed_oidc"></a> [allowed\_oidc](#input\_allowed\_oidc) | Github repos/branches allowed to assume to OIDC role. | `list(map(string))` | n/a | yes |
43-
| <a name="input_lock_table"></a> [lock\_table](#input\_lock\_table) | DynamoDB table holding terraform state locks. | `string` | n/a | yes |
4443

4544
## Outputs
4645

‎tf/modules/infra/authorization/iam.tf‎

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -90,29 +90,6 @@ data "aws_iam_policy_document" "gha_oidc_policy_one" {
9090
resources = ["arn:aws:cloudwatch:${var.aws_region}:${var.aws_account}:*"]
9191
}
9292

93-
statement {
94-
effect = "Allow"
95-
# tfsec:ignore:aws-iam-no-policy-wildcards
96-
actions = [
97-
"dynamodb:Describe*",
98-
]
99-
# tfsec:ignore:aws-iam-no-policy-wildcards
100-
resources = ["*"]
101-
}
102-
103-
statement {
104-
effect = "Allow"
105-
# tfsec:ignore:aws-iam-no-policy-wildcards
106-
actions = [
107-
"dynamodb:DeleteItem",
108-
"dynamodb:Get*",
109-
"dynamodb:PutItem",
110-
]
111-
resources = [
112-
"arn:aws:dynamodb:${var.aws_region}:${var.aws_account}:table/${var.lock_table}",
113-
]
114-
}
115-
11693
statement {
11794
effect = "Allow"
11895
# tfsec:ignore:aws-iam-no-policy-wildcards

‎tf/modules/infra/authorization/variables.tf‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
# Variables for the authorization module.
22

3-
variable "lock_table" {
4-
description = "DynamoDB table holding terraform state locks."
5-
type = string
6-
}
7-
83
variable "allowed_oidc" {
94
description = "Github repos/branches allowed to assume to OIDC role."
105
type = list(map(string))

‎tf/nodes/authorization.hcl‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ terraform {
66

77
locals {
88
env = read_terragrunt_config(find_in_parent_folders("environment.hcl"))
9-
lock_table = local.env.locals.lock_table
109
allowed_oidc = local.env.locals.allowed_oidc
1110
}
1211

1312
inputs = {
14-
lock_table = local.lock_table
1513
allowed_oidc = local.allowed_oidc
1614
}

‎tf/nodes/datastores.hcl‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ terraform {
66

77
locals {
88
env = read_terragrunt_config(find_in_parent_folders("environment.hcl"))
9-
namespace = local.env.locals.namespace
109
admins = local.env.locals.admins
1110
domain = local.env.locals.domain
1211
environment = local.env.locals.environment
1312
opensearch_master_user_secret_name = local.env.locals.opensearch_master_user_secret_name
1413
opensearch_version = local.env.locals.opensearch_version
1514
ports = local.env.locals.ports
1615
postgres_version = local.env.locals.postgres_version
16+
db_name = "ida"
1717
}
1818

1919
inputs = {
@@ -48,7 +48,7 @@ inputs = {
4848
apply_immediately = contains(["development", "staging"], local.environment)
4949
backup_retention_period = 7
5050
cidr_blocks = "0.0.0.0/0"
51-
db_name = local.namespace
51+
db_name = local.db_name
5252
deletion_protection = local.environment == "production"
5353
engine = "postgres"
5454
engine_version = local.postgres_version
@@ -67,6 +67,6 @@ inputs = {
6767
skip_final_snapshot = contains(["development", "staging"], local.environment)
6868
storage_encrypted = true
6969
storage_type = "gp2"
70-
username = local.namespace
70+
username = local.db_name
7171
}
7272
}

‎tf/root.hcl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ locals {
1111
aws_account_dns = 203918846978 # The ida-root account.
1212
aws_dns_writer_role_name = local.environment_vars.locals.aws_dns_writer_role_name
1313

14-
namespace = local.environment_vars.locals.namespace
14+
namespace = "ida"
1515
environment = local.environment_vars.locals.environment
1616
}
1717

0 commit comments

Comments
 (0)