Skip to content

Commit 1a00cd6

Browse files
committed
add resourceGroupName
1 parent 7a57277 commit 1a00cd6

File tree

3 files changed

+13
-0
lines changed
  • src/pages/[platform]/build-a-backend/functions

3 files changed

+13
-0
lines changed

src/pages/[platform]/build-a-backend/functions/configure-functions/index.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,14 @@ export const myDemoFunction = defineFunction({
9090
entry: './path/to/handler.ts' // this path should either be absolute or relative to the current file
9191
});
9292
```
93+
94+
## `resourceGroupName`
95+
96+
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.
97+
This is typically useful when you have resources that depend on each other and you want to group them together.
98+
99+
```ts title="amplify/functions/my-demo-function/resource.ts"
100+
export const myDemoFunction = defineFunction({
101+
resourceGroupName: 'data'
102+
});
103+
```

src/pages/[platform]/build-a-backend/functions/examples/dynamo-db-stream/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import { defineFunction } from "@aws-amplify/backend";
4646

4747
export const myDynamoDBFunction = defineFunction({
4848
name: "dynamoDB-function",
49+
resourceGroupName: "data",
4950
});
5051
```
5152

src/pages/[platform]/build-a-backend/functions/examples/s3-upload-confirmation/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import { defineFunction, defineStorage } from "@aws-amplify/backend";
4444

4545
export const storage = defineStorage({
4646
name: 'myProjectFiles',
47+
resourceGroupName: "storage",
4748
triggers: {
4849
onUpload: defineFunction({
4950
entry: './on-upload-handler.ts'

0 commit comments

Comments
 (0)