Coder Social home page Coder Social logo

Comments (2)

josefaidt avatar josefaidt commented on June 16, 2024

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.

kekami avatar kekami commented on June 16, 2024

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

Sorry for the late response @josefaidt . Thanks for the clarification and an absolutely amazing response! 💫

from docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.