AWS CloudFormation scenarios to Update Lambda Function with Layer - 'InvalidParameterValueException'
I'm having trouble with I've looked through the documentation and I'm still confused about I'm working on a project and hit a roadblock..... I am trying to update an AWS Lambda function using CloudFormation to include a new Lambda layer, but I keep running into the following behavior: `An behavior occurred: MyLambdaFunction - InvalidParameterValueException: The layer version arn:aws:lambda:us-east-1:123456789012:layer:my-layer:1 is invalid`. I have verified that the layer exists and is compatible with the runtime of my Lambda function. Here's the relevant part of my CloudFormation template: ```yaml Resources: MyLambdaFunction: Type: AWS::Lambda::Function Properties: FunctionName: MyLambdaFunction Handler: index.handler Role: !GetAtt MyLambdaRole.Arn Runtime: nodejs14.x Code: S3Bucket: my-bucket S3Key: my-lambda-code.zip Layers: - arn:aws:lambda:us-east-1:123456789012:layer:my-layer:1 MemorySize: 128 Timeout: 3 ``` I've double-checked the ARN of the layer and confirmed that it is in the same region as my Lambda function. Additionally, I ensured that the layer has the correct permissions set so that the Lambda function can access it. I even tried redeploying the layer separately and confirmed it was working with another function. What could be causing this scenario? Any insights on how to troubleshoot this particular question would be greatly appreciated! Thanks in advance! This is part of a larger CLI tool I'm building. What's the best practice here?