Skip to content

Commit

Permalink
rename batch stories fetch tf to metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
rivernews committed Sep 17, 2022
1 parent 6c6e250 commit 512f729
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cloud_environments/terraform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cloud_module/landing_s3_trigger.tf
Original file line number Diff line number Diff line change
@@ -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
}
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion cloud_module/sfn_def/batch_stories_def.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
6 changes: 3 additions & 3 deletions cloud_module/stories_sfn.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
]
}
}
Expand All @@ -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"
Expand Down

0 comments on commit 512f729

Please sign in to comment.