Skip to content

Commit

Permalink
add resourceGroupName
Browse files Browse the repository at this point in the history
  • Loading branch information
ykethan committed Nov 28, 2024
1 parent 7a57277 commit 1a00cd6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,14 @@ export const myDemoFunction = defineFunction({
entry: './path/to/handler.ts' // this path should either be absolute or relative to the current file
});
```

## `resourceGroupName`

By default, functions are grouped together in a resource group named `function`. You can override this to group related function with other Amplify resources like `auth`, `data`, `storage`, or separate them into your own custom group.
This is typically useful when you have resources that depend on each other and you want to group them together.

```ts title="amplify/functions/my-demo-function/resource.ts"
export const myDemoFunction = defineFunction({
resourceGroupName: 'data'
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import { defineFunction } from "@aws-amplify/backend";

export const myDynamoDBFunction = defineFunction({
name: "dynamoDB-function",
resourceGroupName: "data",
});
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { defineFunction, defineStorage } from "@aws-amplify/backend";

export const storage = defineStorage({
name: 'myProjectFiles',
resourceGroupName: "storage",
triggers: {
onUpload: defineFunction({
entry: './on-upload-handler.ts'
Expand Down

0 comments on commit 1a00cd6

Please sign in to comment.