Skip to content

Commit

Permalink
PRMP-935 renaming tf resource
Browse files Browse the repository at this point in the history
  • Loading branch information
NogaNHS committed Oct 11, 2024
1 parent 9351a1a commit ea69dbd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions infrastructure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
| <a name="module_generate-document-manifest-alarm"></a> [generate-document-manifest-alarm](#module\_generate-document-manifest-alarm) | ./modules/lambda_alarms | n/a |
| <a name="module_generate-document-manifest-alarm-topic"></a> [generate-document-manifest-alarm-topic](#module\_generate-document-manifest-alarm-topic) | ./modules/sns | n/a |
| <a name="module_generate-document-manifest-lambda"></a> [generate-document-manifest-lambda](#module\_generate-document-manifest-lambda) | ./modules/lambda | n/a |
| <a name="module_generate-stitch-record-alarm"></a> [generate-stitch-record-alarm](#module\_generate-stitch-record-alarm) | ./modules/lambda_alarms | n/a |
| <a name="module_generate-stitch-record-alarm-topic"></a> [generate-stitch-record-alarm-topic](#module\_generate-stitch-record-alarm-topic) | ./modules/sns | n/a |
| <a name="module_generate-stitch-record-lambda"></a> [generate-stitch-record-lambda](#module\_generate-stitch-record-lambda) | ./modules/lambda | n/a |
| <a name="module_generate-lloyd-george-stitch-alarm"></a> [generate-lloyd-george-stitch-alarm](#module\_generate-lloyd-george-stitch-alarm) | ./modules/lambda_alarms | n/a |
| <a name="module_generate-lloyd-george-stitch-alarm-topic"></a> [generate-lloyd-george-stitch-alarm-topic](#module\_generate-lloyd-george-stitch-alarm-topic) | ./modules/sns | n/a |
| <a name="module_generate-lloyd-george-stitch-lambda"></a> [generate-lloyd-george-stitch-lambda](#module\_generate-lloyd-george-stitch-lambda) | ./modules/lambda | n/a |
| <a name="module_lambda-layer-core"></a> [lambda-layer-core](#module\_lambda-layer-core) | ./modules/lambda_layers | n/a |
| <a name="module_lambda-layer-data"></a> [lambda-layer-data](#module\_lambda-layer-data) | ./modules/lambda_layers | n/a |
| <a name="module_lloyd-george-stitch-gateway"></a> [lloyd-george-stitch-gateway](#module\_lloyd-george-stitch-gateway) | ./modules/gateway | n/a |
Expand Down
28 changes: 14 additions & 14 deletions infrastructure/lambda-generate-stitch-record.tf
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
module "generate-stitch-record-alarm" {
module "generate-lloyd-george-stitch-alarm" {
source = "./modules/lambda_alarms"
lambda_function_name = module.generate-stitch-record-lambda.function_name
lambda_timeout = module.generate-stitch-record-lambda.timeout
lambda_name = "generate_stitch_record_handler"
lambda_function_name = module.generate-lloyd-george-stitch-lambda.function_name
lambda_timeout = module.generate-lloyd-george-stitch-lambda.timeout
lambda_name = "generate_lloyd_george_stitch_handler"
namespace = "AWS/Lambda"
alarm_actions = [module.generate-stitch-record-alarm-topic.arn]
ok_actions = [module.generate-stitch-record-alarm-topic.arn]
depends_on = [module.generate-stitch-record-lambda, module.generate-stitch-record-alarm-topic]
alarm_actions = [module.generate-lloyd-george-stitch-alarm-topic.arn]
ok_actions = [module.generate-lloyd-george-stitch-alarm-topic.arn]
depends_on = [module.generate-lloyd-george-stitch-lambda, module.generate-lloyd-george-stitch-alarm-topic]
}

module "generate-stitch-record-alarm-topic" {
module "generate-lloyd-george-stitch-alarm-topic" {
source = "./modules/sns"
sns_encryption_key_id = module.sns_encryption_key.id
current_account_id = data.aws_caller_identity.current.account_id
topic_name = "generate-stitch-record-topic"
topic_name = "generate-lloyd-george-stitch-topic"
topic_protocol = "lambda"
topic_endpoint = module.generate-stitch-record-lambda.lambda_arn
topic_endpoint = module.generate-lloyd-george-stitch-lambda.lambda_arn
delivery_policy = jsonencode({
"Version" : "2012-10-17",
"Statement" : [
Expand All @@ -37,10 +37,10 @@ module "generate-stitch-record-alarm-topic" {
]
})

depends_on = [module.generate-stitch-record-lambda, module.sns_encryption_key]
depends_on = [module.generate-lloyd-george-stitch-lambda, module.sns_encryption_key]
}

module "generate-stitch-record-lambda" {
module "generate-lloyd-george-stitch-lambda" {
source = "./modules/lambda"
name = "GenerateLloydGeorgeStitch"
handler = "handlers.generate_lloyd_george_stitch_handler.lambda_handler"
Expand Down Expand Up @@ -100,13 +100,13 @@ resource "aws_iam_policy" "dynamodb_stream_stitch_policy" {

resource "aws_iam_role_policy_attachment" "policy_generate_stitch_lambda" {
count = local.is_sandbox ? 0 : 1
role = module.generate-stitch-record-lambda.lambda_execution_role_name
role = module.generate-lloyd-george-stitch-lambda.lambda_execution_role_name
policy_arn = try(aws_iam_policy.lambda_audit_splunk_sqs_queue_send_policy[0].arn, null)
}

resource "aws_lambda_event_source_mapping" "dynamodb_stream_stitch" {
event_source_arn = module.stitch_metadata_reference_dynamodb_table.dynamodb_stream_arn
function_name = module.generate-stitch-record-lambda.lambda_arn
function_name = module.generate-lloyd-george-stitch-lambda.lambda_arn
batch_size = 1
starting_position = "TRIM_HORIZON"

Expand Down

0 comments on commit ea69dbd

Please sign in to comment.