Skip to content

Commit d27fe0c

Browse files
authored
CCM-9051: remove legacy KMS key (#507)
1 parent f0641a3 commit d27fe0c

18 files changed

+16
-89
lines changed

infrastructure/terraform/components/sandbox/module_backend_api.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ module "backend_api" {
2121
letter_suppliers = var.letter_suppliers
2222

2323
kms_key_arn = data.aws_kms_key.sandbox.arn
24-
dynamodb_kms_key_arn = data.aws_kms_key.sandbox.arn
2524

2625
send_to_firehose = false
2726
}

infrastructure/terraform/modules/backend-api/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ No requirements.
1414
| <a name="input_cognito_config"></a> [cognito\_config](#input\_cognito\_config) | Cognito config | <pre>object({<br/> USER_POOL_ID : string,<br/> USER_POOL_CLIENT_ID : string<br/> })</pre> | n/a | yes |
1515
| <a name="input_component"></a> [component](#input\_component) | The variable encapsulating the name of this component | `string` | n/a | yes |
1616
| <a name="input_csi"></a> [csi](#input\_csi) | CSI from the parent component | `string` | n/a | yes |
17-
| <a name="input_dynamodb_kms_key_arn"></a> [dynamodb\_kms\_key\_arn](#input\_dynamodb\_kms\_key\_arn) | KMS Key ARN for encrypting DynamoDB data. If not given, a key will be created. | `string` | `""` | no |
1817
| <a name="input_enable_backup"></a> [enable\_backup](#input\_enable\_backup) | Enable Backups for the DynamoDB table? | `bool` | `true` | no |
1918
| <a name="input_enable_proofing"></a> [enable\_proofing](#input\_enable\_proofing) | Enable proofing feature flag | `bool` | n/a | yes |
2019
| <a name="input_environment"></a> [environment](#input\_environment) | The name of the tfscaffold environment | `string` | n/a | yes |

infrastructure/terraform/modules/backend-api/dynamodb_table_templates.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ resource "aws_dynamodb_table" "templates" {
2626

2727
server_side_encryption {
2828
enabled = true
29-
kms_key_arn = local.dynamodb_kms_key_arn
29+
kms_key_arn = var.kms_key_arn
3030
}
3131

3232
tags = {

infrastructure/terraform/modules/backend-api/kms_key_dynamo.tf

Lines changed: 0 additions & 6 deletions
This file was deleted.

infrastructure/terraform/modules/backend-api/locals.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ locals {
5050
ENABLE_PROOFING = var.enable_proofing
5151
}
5252

53-
dynamodb_kms_key_arn = var.dynamodb_kms_key_arn == "" ? aws_kms_key.dynamo[0].arn : var.dynamodb_kms_key_arn
54-
5553
mock_letter_supplier_name = "WTMMOCK"
5654

5755
use_sftp_letter_supplier_mock = lookup(var.letter_suppliers, local.mock_letter_supplier_name, null) != null

infrastructure/terraform/modules/backend-api/module_create_letter_template_lambda.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ data "aws_iam_policy_document" "create_letter_template_lambda_policy" {
6262
]
6363

6464
resources = [
65-
local.dynamodb_kms_key_arn,
6665
var.kms_key_arn
6766
]
6867
}

infrastructure/terraform/modules/backend-api/module_create_template_lambda.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ data "aws_iam_policy_document" "create_template_lambda_policy" {
6161
]
6262

6363
resources = [
64-
local.dynamodb_kms_key_arn
64+
var.kms_key_arn
6565
]
6666
}
6767
}

infrastructure/terraform/modules/backend-api/module_delete_template_lambda.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ data "aws_iam_policy_document" "delete_template_lambda_policy" {
6161
]
6262

6363
resources = [
64-
local.dynamodb_kms_key_arn
64+
var.kms_key_arn
6565
]
6666
}
6767
}

infrastructure/terraform/modules/backend-api/module_get_template_lambda.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ data "aws_iam_policy_document" "get_template_lambda_policy" {
6161
]
6262

6363
resources = [
64-
local.dynamodb_kms_key_arn
64+
var.kms_key_arn
6565
]
6666
}
6767
}

infrastructure/terraform/modules/backend-api/module_lambda_process_proof.tf

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ data "aws_iam_policy_document" "process_proof" {
6464
}
6565

6666
statement {
67-
sid = "AllowKMSAccessDynamoDB"
67+
sid = "AllowKMSAccess"
6868
effect = "Allow"
6969

7070
actions = [
@@ -75,20 +75,6 @@ data "aws_iam_policy_document" "process_proof" {
7575
"kms:ReEncrypt*",
7676
]
7777

78-
resources = [
79-
local.dynamodb_kms_key_arn,
80-
]
81-
}
82-
83-
statement {
84-
sid = "AllowKMSAccessSQSDLQ"
85-
effect = "Allow"
86-
87-
actions = [
88-
"kms:Decrypt",
89-
"kms:GenerateDataKey",
90-
]
91-
9278
resources = [
9379
var.kms_key_arn,
9480
]

0 commit comments

Comments
 (0)