Skip to content

feat: reduce API Gateway capacity and add email notification monitoring for excessive usage #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 25, 2025

Conversation

socraticDevBlog
Copy link
Owner

@socraticDevBlog socraticDevBlog commented Mar 24, 2025

feat: reduce API Gateway capacity and add email notification monitoring for excessive usage

@socraticDevBlog socraticDevBlog self-assigned this Mar 24, 2025
Copy link

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Show Plan

terraform
random_string.random: Refreshing state... [id=sZHL]
data.archive_file.layer_zip: Reading...
data.archive_file.lambda_zip: Reading...
data.archive_file.lambda_zip: Read complete after 0s [id=8a42fc87503ed542a35cbade99b4bf8f3c5d0a79]
aws_apigatewayv2_api.http_lambda: Refreshing state... [id=exj5m66tib]
aws_dynamodb_table.paste: Refreshing state... [id=paste]
aws_iam_role.lambda_exec: Refreshing state... [id=LambdaDdbPost]
aws_cloudwatch_log_group.api_gw: Refreshing state... [id=/aws/api_gw/pastebin-sZHL]
aws_s3_bucket.lambda_bucket: Refreshing state... [id=pastebin20231223003519593600000001]
aws_cloudwatch_log_group.lambda_logs: Refreshing state... [id=/aws/lambda/pastebin-sZHL]
aws_iam_policy.lambda_exec_role: Refreshing state... [id=arn:aws:iam::127449185323:policy/lambda-tf-pattern-ddb-post]
aws_sns_topic.budget_notification: Refreshing state... [id=arn:aws:sns:ca-central-1:127449185323:BudgetNotificationTopic]
data.archive_file.layer_zip: Read complete after 1s [id=ddf8ff49e0c57a8c741ab92470a336ab5ad7a25e]
aws_cloudwatch_metric_alarm.budget_alarm: Refreshing state... [id=MonthlyChargeAlarm]
aws_lambda_layer_version.dependencies_layer: Refreshing state... [id=arn:aws:lambda:ca-central-1:127449185323:layer:python-layer:91]
aws_sns_topic_subscription.email_alerts["budget_notification"]: Refreshing state... [id=arn:aws:sns:ca-central-1:127449185323:BudgetNotificationTopic:6fac9d94-197f-4a31-b6ee-8c9702c91d24]
aws_iam_role_policy_attachment.lambda_policy: Refreshing state... [id=LambdaDdbPost-20231223010623714500000001]
aws_s3_bucket_ownership_controls.lambda_bucket: Refreshing state... [id=pastebin20231223003519593600000001]
aws_s3_object.this: Refreshing state... [id=src.zip]
aws_s3_bucket_acl.private_bucket: Refreshing state... [id=pastebin20231223003519593600000001,private]
aws_lambda_function.apigw_lambda_ddb: Refreshing state... [id=pastebin-sZHL]
aws_lambda_permission.api_gw: Refreshing state... [id=AllowExecutionFromAPIGateway]
aws_apigatewayv2_integration.apigw_lambda: Refreshing state... [id=v3fnxm6]
aws_apigatewayv2_route.write["POST /paste/api"]: Refreshing state... [id=eicvmug]
aws_apigatewayv2_route.write["POST /paste"]: Refreshing state... [id=arq6oei]
aws_apigatewayv2_route.read["GET /paste/api/pastes"]: Refreshing state... [id=i7knacg]
aws_apigatewayv2_route.read["GET /paste/api"]: Refreshing state... [id=95ed56b]
aws_apigatewayv2_route.read["GET /paste"]: Refreshing state... [id=pd3pcd6]
aws_apigatewayv2_route.read["OPTIONS /paste"]: Refreshing state... [id=1y3pfqk]
aws_apigatewayv2_stage.default: Refreshing state... [id=$default]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # aws_apigatewayv2_stage.default will be updated in-place
  ~ resource "aws_apigatewayv2_stage" "default" {
        id                    = "$default"
        name                  = "$default"
        tags                  = {}
        # (10 unchanged attributes hidden)

      - route_settings {
          - data_trace_enabled       = false -> null
          - detailed_metrics_enabled = false -> null
          - route_key                = "GET /paste" -> null
          - throttling_burst_limit   = 5 -> null
          - throttling_rate_limit    = 2 -> null
            # (1 unchanged attribute hidden)
        }
      - route_settings {
          - data_trace_enabled       = false -> null
          - detailed_metrics_enabled = false -> null
          - route_key                = "GET /paste/api" -> null
          - throttling_burst_limit   = 5 -> null
          - throttling_rate_limit    = 2 -> null
            # (1 unchanged attribute hidden)
        }
      - route_settings {
          - data_trace_enabled       = false -> null
          - detailed_metrics_enabled = false -> null
          - route_key                = "GET /paste/api/pastes" -> null
          - throttling_burst_limit   = 5 -> null
          - throttling_rate_limit    = 2 -> null
            # (1 unchanged attribute hidden)
        }
      - route_settings {
          - data_trace_enabled       = false -> null
          - detailed_metrics_enabled = false -> null
          - route_key                = "OPTIONS /paste" -> null
          - throttling_burst_limit   = 5 -> null
          - throttling_rate_limit    = 2 -> null
            # (1 unchanged attribute hidden)
        }
      - route_settings {
          - data_trace_enabled       = false -> null
          - detailed_metrics_enabled = false -> null
          - route_key                = "POST /paste" -> null
          - throttling_burst_limit   = 2 -> null
          - throttling_rate_limit    = 1 -> null
            # (1 unchanged attribute hidden)
        }
      - route_settings {
          - data_trace_enabled       = false -> null
          - detailed_metrics_enabled = false -> null
          - route_key                = "POST /paste/api" -> null
          - throttling_burst_limit   = 2 -> null
          - throttling_rate_limit    = 1 -> null
            # (1 unchanged attribute hidden)
        }
      + route_settings {
          + data_trace_enabled       = false
          + detailed_metrics_enabled = false
          + logging_level            = (known after apply)
          + route_key                = "GET /paste"
          + throttling_burst_limit   = 1
          + throttling_rate_limit    = 1
        }
      + route_settings {
          + data_trace_enabled       = false
          + detailed_metrics_enabled = false
          + logging_level            = (known after apply)
          + route_key                = "GET /paste/api"
          + throttling_burst_limit   = 1
          + throttling_rate_limit    = 1
        }
      + route_settings {
          + data_trace_enabled       = false
          + detailed_metrics_enabled = false
          + logging_level            = (known after apply)
          + route_key                = "GET /paste/api/pastes"
          + throttling_burst_limit   = 1
          + throttling_rate_limit    = 1
        }
      + route_settings {
          + data_trace_enabled       = false
          + detailed_metrics_enabled = false
          + logging_level            = (known after apply)
          + route_key                = "OPTIONS /paste"
          + throttling_burst_limit   = 1
          + throttling_rate_limit    = 1
        }
      + route_settings {
          + data_trace_enabled       = false
          + detailed_metrics_enabled = false
          + logging_level            = (known after apply)
          + route_key                = "POST /paste"
          + throttling_burst_limit   = 1
          + throttling_rate_limit    = 1
        }
      + route_settings {
          + data_trace_enabled       = false
          + detailed_metrics_enabled = false
          + logging_level            = (known after apply)
          + route_key                = "POST /paste/api"
          + throttling_burst_limit   = 1
          + throttling_rate_limit    = 1
        }

        # (2 unchanged blocks hidden)
    }

  # aws_cloudwatch_metric_alarm.api_requests_alarm will be created
  + resource "aws_cloudwatch_metric_alarm" "api_requests_alarm" {
      + actions_enabled                       = true
      + alarm_actions                         = (known after apply)
      + alarm_description                     = "Alarm for API Gateway requests exceeding 10,000 in the evaluation period."
      + alarm_name                            = "APIGatewayRequestAlarm"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanOrEqualToThreshold"
      + dimensions                            = {
          + "ApiId" = "exj5m66tib"
        }
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 1
      + id                                    = (known after apply)
      + metric_name                           = "Count"
      + namespace                             = "AWS/ApiGateway"
      + period                                = 1200
      + statistic                             = "Sum"
      + tags_all                              = (known after apply)
      + threshold                             = 1000
      + treat_missing_data                    = "missing"
    }

  # aws_lambda_layer_version.dependencies_layer must be replaced
-/+ resource "aws_lambda_layer_version" "dependencies_layer" {
      ~ arn                         = "arn:aws:lambda:ca-central-1:127449185323:layer:python-layer:91" -> (known after apply)
      ~ code_sha256                 = "D8R4UERl0wtWJmuFmb2UcBccE/r26HxDwCMCnrvUWD4=" -> (known after apply)
      - compatible_architectures    = [] -> null
      ~ created_date                = "2025-02-07T23:39:44.096+0000" -> (known after apply)
      ~ id                          = "arn:aws:lambda:ca-central-1:127449185323:layer:python-layer:91" -> (known after apply)
      ~ layer_arn                   = "arn:aws:lambda:ca-central-1:127449185323:layer:python-layer" -> (known after apply)
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      ~ source_code_hash            = "140cacc6a1778f50e336b62be0094ce3abee0537" -> "ddf8ff49e0c57a8c741ab92470a336ab5ad7a25e" # forces replacement
      ~ source_code_size            = 17528323 -> (known after apply)
      ~ version                     = "91" -> (known after apply)
        # (6 unchanged attributes hidden)
    }

  # aws_sns_topic.api_requests_notification will be created
  + resource "aws_sns_topic" "api_requests_notification" {
      + arn                         = (known after apply)
      + beginning_archive_time      = (known after apply)
      + content_based_deduplication = false
      + fifo_topic                  = false
      + id                          = (known after apply)
      + name                        = "APIRequestsNotificationTopic"
      + name_prefix                 = (known after apply)
      + owner                       = (known after apply)
      + policy                      = (known after apply)
      + signature_version           = (known after apply)
      + tags_all                    = (known after apply)
      + tracing_config              = (known after apply)
    }

  # aws_sns_topic_subscription.email_alerts["api_requests_notification"] will be created
  + resource "aws_sns_topic_subscription" "email_alerts" {
      + arn                             = (known after apply)
      + confirmation_timeout_in_minutes = 1
      + confirmation_was_authenticated  = (known after apply)
      + endpoint                        = (sensitive value)
      + endpoint_auto_confirms          = false
      + filter_policy_scope             = (known after apply)
      + id                              = (known after apply)
      + owner_id                        = (known after apply)
      + pending_confirmation            = (known after apply)
      + protocol                        = "email"
      + raw_message_delivery            = false
      + topic_arn                       = (known after apply)
    }

  # aws_sns_topic_subscription.email_subscription has moved to aws_sns_topic_subscription.email_alerts["budget_notification"]
    resource "aws_sns_topic_subscription" "email_alerts" {
        id                              = "arn:aws:sns:ca-central-1:127449185323:BudgetNotificationTopic:6fac9d94-197f-4a31-b6ee-8c9702c91d24"
        # (16 unchanged attributes hidden)
    }

Plan: 4 to add, 1 to change, 1 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "tfplan"

Pushed by: @socraticDevBlog, Action: pull_request

Copy link

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Show Plan

terraform
data.archive_file.layer_zip: Reading...
data.archive_file.lambda_zip: Reading...
random_string.random: Refreshing state... [id=sZHL]
data.archive_file.lambda_zip: Read complete after 0s [id=8a42fc87503ed542a35cbade99b4bf8f3c5d0a79]
aws_sns_topic.budget_notification: Refreshing state... [id=arn:aws:sns:ca-central-1:127449185323:BudgetNotificationTopic]
aws_cloudwatch_log_group.lambda_logs: Refreshing state... [id=/aws/lambda/pastebin-sZHL]
aws_iam_role.lambda_exec: Refreshing state... [id=LambdaDdbPost]
aws_iam_policy.lambda_exec_role: Refreshing state... [id=arn:aws:iam::127449185323:policy/lambda-tf-pattern-ddb-post]
aws_s3_bucket.lambda_bucket: Refreshing state... [id=pastebin20231223003519593600000001]
aws_cloudwatch_log_group.api_gw: Refreshing state... [id=/aws/api_gw/pastebin-sZHL]
aws_dynamodb_table.paste: Refreshing state... [id=paste]
aws_apigatewayv2_api.http_lambda: Refreshing state... [id=exj5m66tib]
aws_cloudwatch_metric_alarm.budget_alarm: Refreshing state... [id=MonthlyChargeAlarm]
aws_sns_topic_subscription.email_alerts["budget_notification"]: Refreshing state... [id=arn:aws:sns:ca-central-1:127449185323:BudgetNotificationTopic:6fac9d94-197f-4a31-b6ee-8c9702c91d24]
aws_iam_role_policy_attachment.lambda_policy: Refreshing state... [id=LambdaDdbPost-20231223010623714500000001]
aws_s3_bucket_ownership_controls.lambda_bucket: Refreshing state... [id=pastebin20231223003519593600000001]
aws_s3_object.this: Refreshing state... [id=src.zip]
aws_s3_bucket_acl.private_bucket: Refreshing state... [id=pastebin20231223003519593600000001,private]
data.archive_file.layer_zip: Read complete after 1s [id=77b9a39995bd070e57a59a6a4f71455fce2a4f28]
aws_lambda_layer_version.dependencies_layer: Refreshing state... [id=arn:aws:lambda:ca-central-1:127449185323:layer:python-layer:91]
aws_lambda_function.apigw_lambda_ddb: Refreshing state... [id=pastebin-sZHL]
aws_lambda_permission.api_gw: Refreshing state... [id=AllowExecutionFromAPIGateway]
aws_apigatewayv2_integration.apigw_lambda: Refreshing state... [id=v3fnxm6]
aws_apigatewayv2_route.read["GET /paste"]: Refreshing state... [id=pd3pcd6]
aws_apigatewayv2_route.read["GET /paste/api"]: Refreshing state... [id=95ed56b]
aws_apigatewayv2_route.read["OPTIONS /paste"]: Refreshing state... [id=1y3pfqk]
aws_apigatewayv2_route.read["GET /paste/api/pastes"]: Refreshing state... [id=i7knacg]
aws_apigatewayv2_route.write["POST /paste/api"]: Refreshing state... [id=eicvmug]
aws_apigatewayv2_route.write["POST /paste"]: Refreshing state... [id=arq6oei]
aws_apigatewayv2_stage.default: Refreshing state... [id=$default]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # aws_apigatewayv2_stage.default will be updated in-place
  ~ resource "aws_apigatewayv2_stage" "default" {
        id                    = "$default"
        name                  = "$default"
        tags                  = {}
        # (10 unchanged attributes hidden)

      - route_settings {
          - data_trace_enabled       = false -> null
          - detailed_metrics_enabled = false -> null
          - route_key                = "GET /paste" -> null
          - throttling_burst_limit   = 5 -> null
          - throttling_rate_limit    = 2 -> null
            # (1 unchanged attribute hidden)
        }
      - route_settings {
          - data_trace_enabled       = false -> null
          - detailed_metrics_enabled = false -> null
          - route_key                = "GET /paste/api" -> null
          - throttling_burst_limit   = 5 -> null
          - throttling_rate_limit    = 2 -> null
            # (1 unchanged attribute hidden)
        }
      - route_settings {
          - data_trace_enabled       = false -> null
          - detailed_metrics_enabled = false -> null
          - route_key                = "GET /paste/api/pastes" -> null
          - throttling_burst_limit   = 5 -> null
          - throttling_rate_limit    = 2 -> null
            # (1 unchanged attribute hidden)
        }
      - route_settings {
          - data_trace_enabled       = false -> null
          - detailed_metrics_enabled = false -> null
          - route_key                = "OPTIONS /paste" -> null
          - throttling_burst_limit   = 5 -> null
          - throttling_rate_limit    = 2 -> null
            # (1 unchanged attribute hidden)
        }
      - route_settings {
          - data_trace_enabled       = false -> null
          - detailed_metrics_enabled = false -> null
          - route_key                = "POST /paste" -> null
          - throttling_burst_limit   = 2 -> null
          - throttling_rate_limit    = 1 -> null
            # (1 unchanged attribute hidden)
        }
      - route_settings {
          - data_trace_enabled       = false -> null
          - detailed_metrics_enabled = false -> null
          - route_key                = "POST /paste/api" -> null
          - throttling_burst_limit   = 2 -> null
          - throttling_rate_limit    = 1 -> null
            # (1 unchanged attribute hidden)
        }
      + route_settings {
          + data_trace_enabled       = false
          + detailed_metrics_enabled = false
          + logging_level            = (known after apply)
          + route_key                = "GET /paste"
          + throttling_burst_limit   = 1
          + throttling_rate_limit    = 1
        }
      + route_settings {
          + data_trace_enabled       = false
          + detailed_metrics_enabled = false
          + logging_level            = (known after apply)
          + route_key                = "GET /paste/api"
          + throttling_burst_limit   = 1
          + throttling_rate_limit    = 1
        }
      + route_settings {
          + data_trace_enabled       = false
          + detailed_metrics_enabled = false
          + logging_level            = (known after apply)
          + route_key                = "GET /paste/api/pastes"
          + throttling_burst_limit   = 1
          + throttling_rate_limit    = 1
        }
      + route_settings {
          + data_trace_enabled       = false
          + detailed_metrics_enabled = false
          + logging_level            = (known after apply)
          + route_key                = "OPTIONS /paste"
          + throttling_burst_limit   = 1
          + throttling_rate_limit    = 1
        }
      + route_settings {
          + data_trace_enabled       = false
          + detailed_metrics_enabled = false
          + logging_level            = (known after apply)
          + route_key                = "POST /paste"
          + throttling_burst_limit   = 1
          + throttling_rate_limit    = 1
        }
      + route_settings {
          + data_trace_enabled       = false
          + detailed_metrics_enabled = false
          + logging_level            = (known after apply)
          + route_key                = "POST /paste/api"
          + throttling_burst_limit   = 1
          + throttling_rate_limit    = 1
        }

        # (2 unchanged blocks hidden)
    }

  # aws_cloudwatch_metric_alarm.api_requests_alarm will be created
  + resource "aws_cloudwatch_metric_alarm" "api_requests_alarm" {
      + actions_enabled                       = true
      + alarm_actions                         = (known after apply)
      + alarm_description                     = "Alarm for API Gateway requests exceeding 10,000 in the evaluation period."
      + alarm_name                            = "APIGatewayRequestAlarm"
      + arn                                   = (known after apply)
      + comparison_operator                   = "GreaterThanOrEqualToThreshold"
      + dimensions                            = {
          + "ApiId" = "exj5m66tib"
        }
      + evaluate_low_sample_count_percentiles = (known after apply)
      + evaluation_periods                    = 1
      + id                                    = (known after apply)
      + metric_name                           = "Count"
      + namespace                             = "AWS/ApiGateway"
      + period                                = 1200
      + statistic                             = "Sum"
      + tags_all                              = (known after apply)
      + threshold                             = 1000
      + treat_missing_data                    = "missing"
    }

  # aws_lambda_layer_version.dependencies_layer must be replaced
-/+ resource "aws_lambda_layer_version" "dependencies_layer" {
      ~ arn                         = "arn:aws:lambda:ca-central-1:127449185323:layer:python-layer:91" -> (known after apply)
      ~ code_sha256                 = "D8R4UERl0wtWJmuFmb2UcBccE/r26HxDwCMCnrvUWD4=" -> (known after apply)
      - compatible_architectures    = [] -> null
      ~ created_date                = "2025-02-07T23:39:44.096+0000" -> (known after apply)
      ~ id                          = "arn:aws:lambda:ca-central-1:127449185323:layer:python-layer:91" -> (known after apply)
      ~ layer_arn                   = "arn:aws:lambda:ca-central-1:127449185323:layer:python-layer" -> (known after apply)
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      ~ source_code_hash            = "140cacc6a1778f50e336b62be0094ce3abee0537" -> "77b9a39995bd070e57a59a6a4f71455fce2a4f28" # forces replacement
      ~ source_code_size            = 17528323 -> (known after apply)
      ~ version                     = "91" -> (known after apply)
        # (6 unchanged attributes hidden)
    }

  # aws_sns_topic.api_requests_notification will be created
  + resource "aws_sns_topic" "api_requests_notification" {
      + arn                         = (known after apply)
      + beginning_archive_time      = (known after apply)
      + content_based_deduplication = false
      + fifo_topic                  = false
      + id                          = (known after apply)
      + name                        = "APIRequestsNotificationTopic"
      + name_prefix                 = (known after apply)
      + owner                       = (known after apply)
      + policy                      = (known after apply)
      + signature_version           = (known after apply)
      + tags_all                    = (known after apply)
      + tracing_config              = (known after apply)
    }

  # aws_sns_topic_subscription.email_alerts["api_requests_notification"] will be created
  + resource "aws_sns_topic_subscription" "email_alerts" {
      + arn                             = (known after apply)
      + confirmation_timeout_in_minutes = 1
      + confirmation_was_authenticated  = (known after apply)
      + endpoint                        = (sensitive value)
      + endpoint_auto_confirms          = false
      + filter_policy_scope             = (known after apply)
      + id                              = (known after apply)
      + owner_id                        = (known after apply)
      + pending_confirmation            = (known after apply)
      + protocol                        = "email"
      + raw_message_delivery            = false
      + topic_arn                       = (known after apply)
    }

  # aws_sns_topic_subscription.email_subscription has moved to aws_sns_topic_subscription.email_alerts["budget_notification"]
    resource "aws_sns_topic_subscription" "email_alerts" {
        id                              = "arn:aws:sns:ca-central-1:127449185323:BudgetNotificationTopic:6fac9d94-197f-4a31-b6ee-8c9702c91d24"
        # (16 unchanged attributes hidden)
    }

Plan: 4 to add, 1 to change, 1 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "tfplan"

Pushed by: @socraticDevBlog, Action: pull_request

@socraticDevBlog socraticDevBlog changed the title feat: ajuster les limites de throttling et ajouter des alarmes SNS po… feat: reduce API Gateway capacity and add email notification monitoring for excessive usage Mar 24, 2025
@socraticDevBlog socraticDevBlog merged commit 3a84d93 into main Mar 25, 2025
3 checks passed
@socraticDevBlog socraticDevBlog deleted the 20250324-keepcostsafe branch March 25, 2025 00:07
Copy link

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Plan 📖success

Show Plan

terraform
random_string.random: Refreshing state... [id=sZHL]
data.archive_file.layer_zip: Reading...
data.archive_file.lambda_zip: Reading...
data.archive_file.lambda_zip: Read complete after 0s [id=8a42fc87503ed542a35cbade99b4bf8f3c5d0a79]
aws_iam_policy.lambda_exec_role: Refreshing state... [id=arn:aws:iam::127449185323:policy/lambda-tf-pattern-ddb-post]
aws_apigatewayv2_api.http_lambda: Refreshing state... [id=exj5m66tib]
aws_cloudwatch_log_group.api_gw: Refreshing state... [id=/aws/api_gw/pastebin-sZHL]
aws_dynamodb_table.paste: Refreshing state... [id=paste]
aws_sns_topic.api_requests_notification: Refreshing state... [id=arn:aws:sns:ca-central-1:127449185323:APIRequestsNotificationTopic]
aws_cloudwatch_log_group.lambda_logs: Refreshing state... [id=/aws/lambda/pastebin-sZHL]
aws_iam_role.lambda_exec: Refreshing state... [id=LambdaDdbPost]
aws_s3_bucket.lambda_bucket: Refreshing state... [id=pastebin20231223003519593600000001]
aws_sns_topic.budget_notification: Refreshing state... [id=arn:aws:sns:ca-central-1:127449185323:BudgetNotificationTopic]
aws_cloudwatch_metric_alarm.api_requests_alarm: Refreshing state... [id=APIGatewayRequestAlarm]
aws_sns_topic_subscription.email_alerts["budget_notification"]: Refreshing state... [id=arn:aws:sns:ca-central-1:127449185323:BudgetNotificationTopic:6fac9d94-197f-4a31-b6ee-8c9702c91d24]
aws_sns_topic_subscription.email_alerts["api_requests_notification"]: Refreshing state... [id=arn:aws:sns:ca-central-1:127449185323:APIRequestsNotificationTopic:de5dc598-7048-4d4e-973c-99245f26f881]
aws_cloudwatch_metric_alarm.budget_alarm: Refreshing state... [id=MonthlyChargeAlarm]
aws_iam_role_policy_attachment.lambda_policy: Refreshing state... [id=LambdaDdbPost-20231223010623714500000001]
data.archive_file.layer_zip: Read complete after 1s [id=0d2b4da7cb19776d028db524f87ccd29591e89bb]
aws_lambda_layer_version.dependencies_layer: Refreshing state... [id=arn:aws:lambda:ca-central-1:127449185323:layer:python-layer:92]
aws_s3_bucket_ownership_controls.lambda_bucket: Refreshing state... [id=pastebin20231223003519593600000001]
aws_s3_object.this: Refreshing state... [id=src.zip]
aws_s3_bucket_acl.private_bucket: Refreshing state... [id=pastebin20231223003519593600000001,private]
aws_lambda_function.apigw_lambda_ddb: Refreshing state... [id=pastebin-sZHL]
aws_lambda_permission.api_gw: Refreshing state... [id=AllowExecutionFromAPIGateway]
aws_apigatewayv2_integration.apigw_lambda: Refreshing state... [id=v3fnxm6]
aws_apigatewayv2_route.write["POST /paste/api"]: Refreshing state... [id=eicvmug]
aws_apigatewayv2_route.read["OPTIONS /paste"]: Refreshing state... [id=1y3pfqk]
aws_apigatewayv2_route.read["GET /paste"]: Refreshing state... [id=pd3pcd6]
aws_apigatewayv2_route.write["POST /paste"]: Refreshing state... [id=arq6oei]
aws_apigatewayv2_route.read["GET /paste/api"]: Refreshing state... [id=95ed56b]
aws_apigatewayv2_route.read["GET /paste/api/pastes"]: Refreshing state... [id=i7knacg]
aws_apigatewayv2_stage.default: Refreshing state... [id=$default]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # aws_lambda_layer_version.dependencies_layer must be replaced
-/+ resource "aws_lambda_layer_version" "dependencies_layer" {
      ~ arn                         = "arn:aws:lambda:ca-central-1:127449185323:layer:python-layer:92" -> (known after apply)
      ~ code_sha256                 = "xVMqgWD3gh4XxWrFr1Df+6Ba6NDsZcNAK97QOchl+SU=" -> (known after apply)
      - compatible_architectures    = [] -> null
      ~ created_date                = "2025-03-24T23:52:55.408+0000" -> (known after apply)
      ~ id                          = "arn:aws:lambda:ca-central-1:127449185323:layer:python-layer:92" -> (known after apply)
      ~ layer_arn                   = "arn:aws:lambda:ca-central-1:127449185323:layer:python-layer" -> (known after apply)
      + signing_job_arn             = (known after apply)
      + signing_profile_version_arn = (known after apply)
      ~ source_code_hash            = "43cdab8da6e4eb03372264546455515dbeb4f97c" -> "0d2b4da7cb19776d028db524f87ccd29591e89bb" # forces replacement
      ~ source_code_size            = 17556080 -> (known after apply)
      ~ version                     = "92" -> (known after apply)
        # (6 unchanged attributes hidden)
    }

Plan: 1 to add, 0 to change, 1 to destroy.

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "tfplan"

Pushed by: @socraticDevBlog, Action: pull_request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant