Skip to content

Commit 30dec83

Browse files
committed
CCM-8572: reshuffle
1 parent 51aa9d4 commit 30dec83

File tree

13 files changed

+25
-141
lines changed

13 files changed

+25
-141
lines changed

infrastructure/terraform/components/app/module_backend_api.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ module "backend_api" {
88
aws_account_id = var.aws_account_id
99
region = var.region
1010
group = var.group
11-
component = var.component
1211
csi = local.csi
1312
log_retention_in_days = var.log_retention_in_days
1413
kms_key_arn = module.kms.key_arn

infrastructure/terraform/components/sandbox/module_backend_api.tf

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

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,17 @@ No requirements.
2828
|------|--------|---------|
2929
| <a name="module_authorizer_build"></a> [authorizer\_build](#module\_authorizer\_build) | ../typescript-build-zip | n/a |
3030
| <a name="module_authorizer_lambda"></a> [authorizer\_lambda](#module\_authorizer\_lambda) | ../lambda-function | n/a |
31+
| <a name="module_build_get_s3_object_tags_lambda"></a> [build\_get\_s3\_object\_tags\_lambda](#module\_build\_get\_s3\_object\_tags\_lambda) | ../typescript-build-zip | n/a |
3132
| <a name="module_build_template_client"></a> [build\_template\_client](#module\_build\_template\_client) | ../typescript-build-zip | n/a |
3233
| <a name="module_build_template_lambda"></a> [build\_template\_lambda](#module\_build\_template\_lambda) | ../typescript-build-zip | n/a |
3334
| <a name="module_create_template_lambda"></a> [create\_template\_lambda](#module\_create\_template\_lambda) | ../lambda-function | n/a |
3435
| <a name="module_get_template_lambda"></a> [get\_template\_lambda](#module\_get\_template\_lambda) | ../lambda-function | n/a |
36+
| <a name="module_lambda_get_s3_object_tags"></a> [lambda\_get\_s3\_object\_tags](#module\_lambda\_get\_s3\_object\_tags) | ../lambda-function | n/a |
3537
| <a name="module_list_template_lambda"></a> [list\_template\_lambda](#module\_list\_template\_lambda) | ../lambda-function | n/a |
3638
| <a name="module_object_tagging_enrichment_quarantine"></a> [object\_tagging\_enrichment\_quarantine](#module\_object\_tagging\_enrichment\_quarantine) | ../s3-object-tagging-enrichment | n/a |
3739
| <a name="module_s3bucket_internal"></a> [s3bucket\_internal](#module\_s3bucket\_internal) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket | v1.0.8 |
3840
| <a name="module_s3bucket_quarantine"></a> [s3bucket\_quarantine](#module\_s3bucket\_quarantine) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/s3bucket | v1.0.8 |
41+
| <a name="module_sqs_tags_added"></a> [sqs\_tags\_added](#module\_sqs\_tags\_added) | git::https://github.com/NHSDigital/nhs-notify-shared-modules.git//infrastructure/modules/sqs | v1.0.8 |
3942
| <a name="module_update_template_lambda"></a> [update\_template\_lambda](#module\_update\_template\_lambda) | ../lambda-function | n/a |
4043
## Outputs
4144

infrastructure/terraform/modules/s3-object-tagging-enrichment/cloudwatch_event_rule_object_tags_added.tf renamed to infrastructure/terraform/modules/backend-api/cloudwatch_event_rule_object_tags_added.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ resource "aws_cloudwatch_event_rule" "tags_added" {
77
detailType = ["Object Tags Added"]
88
detail = {
99
bucket = {
10-
name = [var.source_bucket.name]
10+
name = [module.s3bucket_quarantine.id]
1111
}
1212
}
1313
})

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
locals {
2-
csi = "${var.csi}-${var.module}"
2+
csi = "${var.csi}-${var.component}"
33

44
lambdas_source_code_dir = abspath("${path.module}/../../../../lambdas")
55

infrastructure/terraform/modules/s3-object-tagging-enrichment/module_lambda_get_s3_object_tags.tf renamed to infrastructure/terraform/modules/backend-api/module_lambda_get_s3_object_tags.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,14 @@ data "aws_iam_policy_document" "get_s3_object_tags" {
5252
resources = ["${var.source_bucket.arn}/*"]
5353
}
5454
}
55+
56+
module "build_get_s3_object_tags_lambda" {
57+
source = "../typescript-build-zip"
58+
59+
source_code_dir = abspath("${path.module}/../../../../lambdas/get-s3-object-tags")
60+
61+
entrypoints = [
62+
"src/get-s3-object-tags.ts"
63+
]
64+
}
65+

infrastructure/terraform/modules/s3-object-tagging-enrichment/module_sqs_tags_added.tf renamed to infrastructure/terraform/modules/backend-api/module_sqs_tags_added.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ module "sqs_tags_added" {
66
environment = var.environment
77
project = var.project
88
region = var.region
9-
module = "ote"
109
name = var.id
1110

1211
sqs_kms_key_arn = var.kms_key_arn

infrastructure/terraform/modules/s3-object-tagging-enrichment/pipes_pipe_tags_added.tf renamed to infrastructure/terraform/modules/backend-api/pipes_pipe_tags_added.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ resource "aws_pipes_pipe" "tags_added" {
44
role_arn = aws_iam_role.pipe.arn
55

66
source = module.sqs_tags_added.sqs_queue_arn
7-
target = var.target_event_bus_arn
7+
target = data.aws_cloudwatch_event_bus.default.arn
88
enrichment = module.lambda_get_s3_object_tags.function_arn
99

1010
target_parameters {
1111
eventbridge_event_bus_parameters {
1212
detail_type = "object-tags-enriched"
13-
source = var.output_event_source
14-
resources = [var.source_bucket.arn]
13+
source = "templates.${var.environment}.${var.project}"
14+
resources = [module.s3bucket_quarantine.arn]
1515
}
1616
}
1717
}
@@ -81,7 +81,7 @@ data "aws_iam_policy_document" "pipe" {
8181
effect = "Allow"
8282
actions = ["events:PutEvent"]
8383
resources = [
84-
var.target_event_bus_arn
84+
data.aws_cloudwatch_event_bus.default.arn
8585
]
8686
}
8787
}

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,13 @@ variable "group" {
2828
}
2929

3030

31-
variable "component" {
32-
type = string
33-
description = "The variable encapsulating the name of the component"
34-
}
31+
##
32+
# tfscaffold variables specific to this component
33+
##
3534

36-
variable "module" {
35+
variable "component" {
3736
type = string
38-
description = "The variable encapsulating the name of this module"
37+
description = "The variable encapsulating the name of this component"
3938
default = "api"
4039
}
4140

infrastructure/terraform/modules/s3-object-tagging-enrichment/README.md

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

0 commit comments

Comments
 (0)