Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Components should allow resources to be passed as "requires" #279

Open
fawadasaurus opened this issue May 25, 2023 · 0 comments
Open

Components should allow resources to be passed as "requires" #279

fawadasaurus opened this issue May 25, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@fawadasaurus
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Resources should be able to be separated from components and applications. This would allow for better devops control and environmental changes.

Propose a solution
Components should be able to require an resource. This way the resources are not tied to the component. The component can then expect the resource to be provided to them without having to manage the component itself. By using the requires interface, it keeps the integration to components consistent.

name: oauth_db
kind: wick/component@v1
requires:
  - name: DBADDR
     kind: wick/resource/url@v1
  - name: other_component
     kind: wick/interface@v1
     operations:
        - name: do_something
           inputs:
             - name: something
                type: string
           outputs:
             - name: bar
                type: string
component:
  kind: wick/component/sql@v1
  resource: DBADDR
  tls: false
  operations:
    - name: insert_card
      inputs:
        - name: card_number
          type: string
        - name: card_type
          type: string
      outputs:
        - name: output
          type: object
      query: |
        INSERT INTO cards (card_number, card_type)
        VALUES ($1, $2)
        ON CONFLICT (card_number) DO UPDATE SET card_number = cards.card_number
        RETURNING id
      arguments:
        - card_number
        - card_type

Describe alternatives you've considered
None

Additional context
None

@fawadasaurus fawadasaurus added enhancement New feature or request triage To be triaged labels May 25, 2023
@jsoverson jsoverson removed the triage To be triaged label Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants