From 512f7298df15f5e252bd796f6a518cdba8601067 Mon Sep 17 00:00:00 2001 From: Shaung Date: Fri, 16 Sep 2022 23:47:39 -0700 Subject: [PATCH] rename batch stories fetch tf to metadata --- cloud_environments/terraform.sh | 2 +- cloud_module/landing_s3_trigger.tf | 4 ++-- cloud_module/sfn_def/batch_stories_def.json | 2 +- cloud_module/stories_sfn.tf | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cloud_environments/terraform.sh b/cloud_environments/terraform.sh index d2fac8b..c882829 100755 --- a/cloud_environments/terraform.sh +++ b/cloud_environments/terraform.sh @@ -34,7 +34,7 @@ if ( # https://github.com/terraform-aws-modules/terraform-aws-step-functions/issues/20 # terraform "$@" \ # -target=module.main.module.scraper_lambda \ - # -target=module.main.module.batch_stories_fetch_parse_lambda + # -target=module.main.module.landing_parse_metadata_lambda terraform "$@" else diff --git a/cloud_module/landing_s3_trigger.tf b/cloud_module/landing_s3_trigger.tf index 037f8b9..ac2303b 100644 --- a/cloud_module/landing_s3_trigger.tf +++ b/cloud_module/landing_s3_trigger.tf @@ -1,7 +1,7 @@ resource "aws_lambda_permission" "allow_bucket" { statement_id = "AllowExecutionFromS3Bucket" action = "lambda:InvokeFunction" - function_name = module.batch_stories_fetch_parse_lambda.lambda_function_arn + function_name = module.landing_parse_metadata_lambda.lambda_function_arn principal = "s3.amazonaws.com" source_arn = data.aws_s3_bucket.archive.arn } @@ -10,7 +10,7 @@ resource "aws_s3_bucket_notification" "bucket_notification" { bucket = data.aws_s3_bucket.archive.id lambda_function { - lambda_function_arn = module.batch_stories_fetch_parse_lambda.lambda_function_arn + lambda_function_arn = module.landing_parse_metadata_lambda.lambda_function_arn events = ["s3:ObjectCreated:*"] filter_prefix = "${local.newssite_economy_alias}/" filter_suffix = ".html" diff --git a/cloud_module/sfn_def/batch_stories_def.json b/cloud_module/sfn_def/batch_stories_def.json index 004544a..e5fa2e7 100644 --- a/cloud_module/sfn_def/batch_stories_def.json +++ b/cloud_module/sfn_def/batch_stories_def.json @@ -7,7 +7,7 @@ "Type":"Task", "Resource": "arn:aws:states:::lambda:invoke", "Parameters":{ - "FunctionName": "${BATCH_STORIES_FETCH_PARSE_LAMBDA_ARN}", + "FunctionName": "${LANDING_PARSE_METADATA_LAMBDA_ARN}", "Payload": { "landingS3Key.$": "$.landingS3Key" } diff --git a/cloud_module/stories_sfn.tf b/cloud_module/stories_sfn.tf index 4aa007c..e88a08c 100644 --- a/cloud_module/stories_sfn.tf +++ b/cloud_module/stories_sfn.tf @@ -4,7 +4,7 @@ module batch_stories_sfn { name = "${local.project_name}-batch-stories-sfn" definition = templatefile("${path.module}/sfn_def/batch_stories_def.json", { - BATCH_STORIES_FETCH_PARSE_LAMBDA_ARN = module.batch_stories_fetch_parse_lambda.lambda_function_arn + LANDING_PARSE_METADATA_LAMBDA_ARN = module.landing_parse_metadata_lambda.lambda_function_arn }) # allow step function to invoke other service @@ -14,7 +14,7 @@ module batch_stories_sfn { service_integrations = { lambda = { lambda = [ - module.batch_stories_fetch_parse_lambda.lambda_function_arn + module.landing_parse_metadata_lambda.lambda_function_arn ] } } @@ -27,7 +27,7 @@ module batch_stories_sfn { } -module batch_stories_fetch_parse_lambda { +module landing_parse_metadata_lambda { source = "terraform-aws-modules/lambda/aws" create_function = true function_name = "${local.project_name}-batch-stories-fetch-parse"