Skip to content

Commit df1808b

Browse files
committed
CCM-8585: tf cleanup
1 parent e83b5b8 commit df1808b

File tree

7 files changed

+13
-68
lines changed

7 files changed

+13
-68
lines changed

infrastructure/terraform/components/app/module_backend_api.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ module "backend_api" {
99
region = var.region
1010
group = var.group
1111
csi = local.csi
12-
csi_global = local.csi_global
1312
log_retention_in_days = var.log_retention_in_days
1413

1514
shared_kms_key_arn = module.kms.key_arn

infrastructure/terraform/components/sandbox/locals_tfscaffold.tf

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,6 @@ locals {
1010
"",
1111
)
1212

13-
# CSI for use in resources with a global namespace, i.e. S3 Buckets
14-
csi_global = replace(
15-
format(
16-
"%s-%s-%s-%s-%s",
17-
var.project,
18-
var.aws_account_id,
19-
var.region,
20-
var.environment,
21-
var.component,
22-
),
23-
"_",
24-
"",
25-
)
26-
2713
default_tags = merge(
2814
var.default_tags,
2915
{

infrastructure/terraform/components/sandbox/module_backend_api.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ module "backend_api" {
77
region = var.region
88
group = var.group
99
csi = local.csi
10-
csi_global = local.csi_global
1110
log_retention_in_days = var.log_retention_in_days
1211

1312
shared_kms_key_arn = module.kms.key_arn

infrastructure/terraform/components/sandbox/module_kms.tf

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,5 @@ module "kms" {
1010
name = "main"
1111
deletion_window = var.kms_deletion_window
1212
alias = "alias/${local.csi}"
13-
key_policy_documents = [data.aws_iam_policy_document.kms.json]
1413
iam_delegation = true
1514
}
16-
17-
data "aws_iam_policy_document" "kms" {
18-
# '*' resource scope is permitted in access policies as as the resource is itself
19-
# https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-services.html
20-
21-
statement {
22-
sid = "AllowCloudWatchEncrypt"
23-
effect = "Allow"
24-
25-
principals {
26-
type = "Service"
27-
28-
identifiers = [
29-
"logs.${var.region}.amazonaws.com",
30-
"sns.amazonaws.com",
31-
]
32-
}
33-
34-
actions = [
35-
"kms:Encrypt*",
36-
"kms:Decrypt*",
37-
"kms:ReEncrypt*",
38-
"kms:GenerateDataKey*",
39-
"kms:Describe*"
40-
]
41-
42-
resources = [
43-
"*",
44-
]
45-
}
46-
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ No requirements.
1313
| <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 |
1414
| <a name="input_component"></a> [component](#input\_component) | The variable encapsulating the name of this component | `string` | `"api"` | no |
1515
| <a name="input_csi"></a> [csi](#input\_csi) | CSI from the parent component | `string` | n/a | yes |
16-
| <a name="input_csi_global"></a> [csi\_global](#input\_csi\_global) | Global CSI from the parent component | `string` | n/a | yes |
1716
| <a name="input_enable_backup"></a> [enable\_backup](#input\_enable\_backup) | Enable Backups for the DynamoDB table? | `bool` | `true` | no |
1817
| <a name="input_enable_letters"></a> [enable\_letters](#input\_enable\_letters) | Enable letters feature flag | `bool` | n/a | yes |
1918
| <a name="input_environment"></a> [environment](#input\_environment) | The name of the tfscaffold environment | `string` | n/a | yes |
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
locals {
2-
csi = "${var.csi}-${var.component}"
3-
csi_global = "${var.csi_global}-${var.component}"
2+
csi = "${var.csi}-${var.component}"
43

54
lambdas_source_code_dir = abspath("${path.module}/../../../../lambdas")
65

76
openapi_spec = templatefile("${path.module}/spec.tmpl.json", {
8-
AWS_REGION = var.region
9-
APIG_EXECUTION_ROLE_ARN = aws_iam_role.api_gateway_execution_role.arn
10-
AUTHORIZER_LAMBDA_ARN = module.authorizer_lambda.function_arn
11-
CREATE_LAMBDA_ARN = module.create_template_lambda.function_arn
7+
AWS_REGION = var.region
8+
APIG_EXECUTION_ROLE_ARN = aws_iam_role.api_gateway_execution_role.arn
9+
AUTHORIZER_LAMBDA_ARN = module.authorizer_lambda.function_arn
10+
CREATE_LAMBDA_ARN = module.create_template_lambda.function_arn
1211
CREATE_LETTER_LAMBDA_ARN = module.create_letter_template_lambda.function_arn
13-
UPDATE_LAMBDA_ARN = module.update_template_lambda.function_arn
14-
GET_LAMBDA_ARN = module.get_template_lambda.function_arn
15-
LIST_LAMBDA_ARN = module.list_template_lambda.function_arn
12+
UPDATE_LAMBDA_ARN = module.update_template_lambda.function_arn
13+
GET_LAMBDA_ARN = module.get_template_lambda.function_arn
14+
LIST_LAMBDA_ARN = module.list_template_lambda.function_arn
1615
})
1716

1817
backend_lambda_entrypoints = {
19-
create_template = "src/templates/create.ts"
18+
create_template = "src/templates/create.ts"
2019
create_letter_template = "src/templates/create-letter.ts"
21-
get_template = "src/templates/get.ts"
22-
update_template = "src/templates/update.ts"
23-
list_template = "src/templates/list.ts"
24-
template_client = "src/index.ts"
20+
get_template = "src/templates/get.ts"
21+
update_template = "src/templates/update.ts"
22+
list_template = "src/templates/list.ts"
23+
template_client = "src/index.ts"
2524
}
2625
}

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ variable "csi" {
4747
description = "CSI from the parent component"
4848
}
4949

50-
variable "csi_global" {
51-
type = string
52-
description = "Global CSI from the parent component"
53-
}
54-
5550
variable "log_retention_in_days" {
5651
type = number
5752
description = "The retention period in days for the Cloudwatch Logs events to be retained, default of 0 is indefinite"

0 commit comments

Comments
 (0)