Lambda can't decrypt the container image because KMS access is denied

0

I run lambdas in a multi account context. I have lambdas in A,B,C account and they pull images from an ECR into an account D. On account D there is a Client Managed Key (KMS), used by the ECR and allowed for USE in cross account context.

  • Roles used by the lambdas are allowed to use KMS with right arn KMS
  • KMS Key Policy allow usage in cross account context
  • Lambdas are allowed to pull images in cross account context
  • ECR allow pull images from cross account context

I use cloud formation to deploy theses objects and there is no problem with that. Lambdas work fines until next point.

If i use "aws lambda update-function-code" to update the image, i run into this problem:

"Lambda can't decrypt the container image because KMS access is denied. Check the function's KMS key settings. KMS Exception: AccessDeniedExceptionKMS Message: The ciphertext refers to a customer master key that does not exist, does not exist in this region, or you are not allowed to access."

I m not able to resolve this problem without erasing all the previous stack created and recreate it from start but still impossible to use "update-function-code" without breaking all lambdas.

1개 답변
0

does the KMS policy has kms:Decrypt ? Probably yes but just confirming. Did you look into CloudTrail logs to see more detailed information about the KMS access denied exception?

Niko
답변함 일 년 전
  • Yes, this permission is present..

  • I m currently debugging step by step with cloud trail

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠