Comments (2)
Hey @kekami 👋 thanks for raising this! I do think we need a bit of an explainer on how to work with custom resources in practice (with other Amplify-managed resources). To answer the immediate question think of backend.ts
as your App.tsx
but for your backend, and custom resources as your backend components. It's where everything comes together and resources are wired into the backend.
For custom resources (or custom constructs), you'd define construct props and set the prop values' type to the corresponding CDK resource. There's a couple of blog posts on writing custom constructs, like this one from bobbyhadz.com. Thinking about these custom resources as components, defining the inputs as props allows your construct to be portable.
Not sure if exporting backend would result in circular dependencies from a CDK perspective.
It may create a circular dependency, but it will create a circular reference if you were to import the backend into your custom construct, then import and initialize your custom construct in the backend.ts
file
from docs.
Hey @kekami 👋 thanks for raising this! I do think we need a bit of an explainer on how to work with custom resources in practice (with other Amplify-managed resources). To answer the immediate question think of
backend.ts
as yourApp.tsx
but for your backend, and custom resources as your backend components. It's where everything comes together and resources are wired into the backend.For custom resources (or custom constructs), you'd define construct props and set the prop values' type to the corresponding CDK resource. There's a couple of blog posts on writing custom constructs, like this one from bobbyhadz.com. Thinking about these custom resources as components, defining the inputs as props allows your construct to be portable.
Not sure if exporting backend would result in circular dependencies from a CDK perspective.
It may create a circular dependency, but it will create a circular reference if you were to import the backend into your custom construct, then import and initialize your custom construct in the
backend.ts
file
Sorry for the late response @josefaidt . Thanks for the clarification and an absolutely amazing response! 💫
from docs.
Related Issues (20)
- document function `Cannot find module '$amplify/env/say-hello'` error on nextjs frontend build
- Flutter Quickstart Gen2 - example will not run HOT 3
- The displayed command information is outdated
- [Gen2] Rest API setup will cause error "Subscribe only available for AWS AppSync endpoint"
- Nuxt SSR guide for Gen 2 is incorrect about Amplify support HOT 1
- Docs are missing an explanation of model's authorization operations
- add auth example for federating with Google, Facebook, etc.
- The client code for Android and Flutter are in typescript language
- Callout for errors like: TypeError: Cannot read properties of null (reading 'id')
- Provide example of how to reference resources for AppSync API's
- Clarify what "base project directory" means HOT 1
- Typescript step debugging instructions for Amplify Gen 2
- Quickstart "npx ampx sandbox" issue HOT 1
- add errors to API documentation
- document Auth0 example on auth
- AWS Amplify Gen 2 with Next.js 14: Implementing ISR for App Router
- New Amplify Docs are almost unusable HOT 2
- Next.js code on React auth page
- Suggested RDS database setup instructions lead to typescript error HOT 1
- Swift Quickstart Guide skips over Github integration and dead link for Github integration guide
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docs.