Skip to content

Fails to invoke Lambda functions after updating v6.7.7 #4775

@kota65535

Description

@kota65535

After updating to 6.7.7, Lambda function (webhooks, scale-up, etc) began failing. No logs were generated, and it appeared the invocations were failing at an early stage. By manually executing the function, I encountered the following message:

Lambda was unable to decrypt the environment variables because KMS access was denied.
Please check the function's KMS key settings.
KMS Exception: AccessDeniedExceptionKMS Message: User: arn:aws:sts::361854753178:assumed-role/gha-action-scale-up-lambda-role/gha-scale-up is not authorized to perform: kms:Decrypt on resource: arn:aws:kms:ap-northeast-1:361854753178:key/362d8837-9815-4940-9267-80ba3b8d39f5 because no resource-based policy allows the kms:Decrypt action (Service: Kms, Status Code: 400, Request ID: 11fd6876-0959-4fb6-9eac-a297562a772a) (SDK Attempt Count: 1)

This is a known issue documented in the aws_lambda_function resource documentation. When you recreate a Lambda function's IAM role, it may lose the KMS permissions required to decrypt environment variables. To resolve this issue, we need to recreate the function.

The IAM role are recreated due to the IAM role name changes in this PR #4696.

Some ideas to fix this issue:

  1. Configure the replace_triggered_by lifecycle rule to ensure roles and functions are recreated simultaneously.
  2. Do not change existing IAM role names unless they exceed 64 characters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions