From 762cc409741f502e01ee9f264fe28a25118c0dc9 Mon Sep 17 00:00:00 2001 From: Volodymyr Popov Date: Mon, 24 Feb 2025 16:52:58 +0200 Subject: [PATCH] small fixes --- .github/workflows/deploy_to_aws.yml | 4 ++++ deployment/terraform/lambda.tf | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy_to_aws.yml b/.github/workflows/deploy_to_aws.yml index 7d2811655..c04136c17 100644 --- a/.github/workflows/deploy_to_aws.yml +++ b/.github/workflows/deploy_to_aws.yml @@ -173,6 +173,10 @@ jobs: for id in $(aws cloudfront list-distributions --query "DistributionList.Items[*].Id" --output text); do domains=$(aws cloudfront get-distribution-config --id $id --query "DistributionConfig.Aliases.Items" --output text) if [[ "$domains" == "$CLOUDFRONT_DOMAIN" ]]; then + if [ ! -z "$CLOUDFRONT_DISTRIBUTION_ID" ]; then + echo "Error: Multiple CloudFront distributions found for domain: $CLOUDFRONT_DOMAIN" + exit 1 + fi echo "Found Distribution ID: $id for Domain: $CLOUDFRONT_DOMAIN" CLOUDFRONT_DISTRIBUTION_ID=$id fi diff --git a/deployment/terraform/lambda.tf b/deployment/terraform/lambda.tf index 102a8191c..587d0dca1 100644 --- a/deployment/terraform/lambda.tf +++ b/deployment/terraform/lambda.tf @@ -140,7 +140,7 @@ data "archive_file" "lambda_edge_redirect_to_s3_origin" { resource "aws_lambda_function" "redirect_to_s3_origin" { filename = "redirect_to_s3_origin.zip" source_code_hash = data.archive_file.lambda_edge_redirect_to_s3_origin.output_base64sha256 - function_name = "func${local.short}RedirectoToS3origin" + function_name = "func${local.short}RedirectToS3origin" role = aws_iam_role.lambda_edge_redirect_to_s3_origin handler = "index.handler" publish = true