Skip to content

Commit

Permalink
Add custom stack example
Browse files Browse the repository at this point in the history
  • Loading branch information
Amplifiyer committed Dec 18, 2024
1 parent 0174d70 commit 0493224
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,18 @@ export const preSignUpTrigger = defineFunction({
resourceGroupName: 'auth',
});
```

If you are unable to resolve this error using function's `resourceGroupName` property, please create an issue [here](https://github.com/aws-amplify/amplify-backend/issues/new/choose)

### Circular dependency error with with a custom stack

If you are creating cdk resources and assigning them to a CustomStack, you might also run into this issue. Your error message would look like "The CloudFormation deployment failed due to circular dependency found between nested stacks [storage1234ABCD, auth5678XYZ, **MYCustomStack0123AB**]

To resolve this, try creating your resources in the same stack as the resources you are trying to interact with. For example, if a custom resource such as `sqs` needs to interact with the s3 resource created by `defineStorage`, you can create that `sqs` resource in the stack created by Amplify. You can reference the existing Amplify created stack like

```ts title="backend.ts"
const queue = new sqs.Queue(backend.storage.stack, 'MyCustomQueue');
```

## Circular dependency error between resources in the same stack

If you see this error "The CloudFormation deployment failed due to circular dependency found between resources [resource1, resource2] in a single stack", that means the resources themselves have a circular dependency in the same stack. For handling such errors, see https://aws.amazon.com/blogs/infrastructure-and-automation/handling-circular-dependency-errors-in-aws-cloudformation/

0 comments on commit 0493224

Please sign in to comment.