DataDog / datadog-lambda-js

The Datadog AWS Lambda Library for Node
Apache License 2.0
105 stars 35 forks source link

[Feature Request] Add Support for ca-west-1 region #553

Closed weizhangfd closed 1 month ago

weizhangfd commented 1 month ago

Expected Behavior

I should be able to use lambda runtime layer in ca-west-1 region of AWS.

Actual Behavior

Error creating Lambda Function (xxxxxx): operation error Lambda: CreateFunction, https response error StatusCode: 403, RequestID: cd6f6b1a-799f-4cc2-8a6e-31ee74d7eab5, api error AccessDeniedException: User: arn:aws:sts::xxxxxx is not authorized to perform: lambda:GetLayerVersion on resource: arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Node18-x:99 because no resource-based policy allows the lambda:GetLayerVersion action

Steps to Reproduce the Problem

  1. Attempt to use Datadog-Node18-x:99 on Lambda in ca-west-1 region
  2. Apply Terraform

Specifications

Stacktrace

  api error AccessDeniedException: User: arn:aws:sts::xxxxxx is not authorized to perform: lambda:GetLayerVersion on resource: arn:aws:lambda:us-east-1:464622532012:layer:Datadog-Node18-x:99 because no resource-based policy allows the lambda:GetLayerVersion action
weizhangfd commented 1 month ago

After using layer version 110 we got successful result. :)

purple4reina commented 1 month ago

Glad you got this working! For others who may find this issue looking for guidance, the problem is typically permissions

AccessDeniedException: User: arn:aws:sts::xxxxxx is not authorized to perform: lambda:GetLayerVersion

You will need to make sure you have the lambda:GetLayerVersion permission on whichever role that is looking to pull the layer.