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

Support way to provide custom ContextProvider #80

Closed
1 of 5 tasks
michirue opened this issue Aug 5, 2019 · 2 comments
Closed
1 of 5 tasks

Support way to provide custom ContextProvider #80

michirue opened this issue Aug 5, 2019 · 2 comments

Comments

@michirue
Copy link

michirue commented Aug 5, 2019

  • I'm submitting a ...

    • πŸͺ² bug report
    • πŸš€ feature request
    • πŸ“š construct library gap
    • ☎️ security issue or vulnerability => Please see policy
    • ❓ support request => Please see note at the top of this template.
  • What is the expected behavior (or behavior of feature suggested)?

In order to resolve arbitrary data from any type of resource in the AWS account the availableContextProvider map should be extendable with custom implementations. (In my current situation I would like to resolve the ARN/ID of a Cognito user pool based on its name like it's available for hosted zones or VPCs.)

One way this could be achieved is to make the provider property on MissingContext a string or function that returns a promise for a string. Then use the provider function directly or resolve from map if value is a string in provideContextValues. Setting up a custom provider could be as easy as calling this.reportMissingContext(...) with a key and function in a stack constructor.

Another way would be to provide an API to modify the the actual availableContextProvider list. It's probably more difficult as it's a static setup right now and I couldn't find any extension points around the "context provider".

Let me know what you think or if you have similar plans already in mind.

@eladb eladb self-assigned this Aug 13, 2019
@eladb eladb transferred this issue from aws/aws-cdk Jan 23, 2020
@eladb
Copy link
Contributor

eladb commented Jan 23, 2020

This is a very interesting idea. I am transferring this to the RFC repo. Please follow the RFC Repo README in order to submit this as an RFC.

@eladb eladb removed their assignment Jan 23, 2020
@eladb
Copy link
Contributor

eladb commented Jun 23, 2020

Duplicate #18

@eladb eladb closed this as completed Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants