Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
ykethan committed Dec 13, 2024
1 parent c4202d3 commit 6f77bda
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,22 @@ To add a Lambda layer to your function, follow these steps:
});
```

The Lambda layer is represented by an object of key/value pairs where the key is the module name that is exported from your layer and the value is the ARN of the layer. The key (module name) is used to externalize the module dependency so it doesn't get bundled with your lambda function. A maximum of 5 layers can be attached to a function, and they must be in the same region as the function.
<br/><br/>Alternatively, you can specify the layer as `myLayer:1` where `myLayer` is the name of the layer and `1` is the version of the layer. For example:
The Lambda layer is represented by an object of key/value pairs where the key is the module name that is exported from your layer and the value is the ARN of the layer. The key (module name) is used to externalize the module dependency so it doesn't get bundled with your Lambda function. A maximum of 5 layers can be attached to a function, and they must be in the same region as the function.

<br/>Alternatively, you can specify the layer as `myLayer:1` where `myLayer` is the name of the layer and `1` is the version of the layer. For example:

```ts title="amplify/functions/my-function/resource.ts"
import { defineFunction } from "@aws-amplify/backend";

export const myFunction = defineFunction({
name: "my-function",
layers: {
"module": "myLayer:1"
"some-module": "myLayer:1"
},
});
```

Amplify will automatically convert this to the full layer ARN format `arn:aws:lambda:<region>:<account-id>:layer:myLayer:1` using your existing account id and region.
Amplify will automatically convert this to the full layer ARN format `arn:aws:lambda:<region>:<account-id>:layer:myLayer:1` using your existing account ID and region.

<Callout type="warning">

Expand Down

0 comments on commit 6f77bda

Please sign in to comment.