Skip to content
New issue

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

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

Already on GitHub? # to your account

Set Default Values to Construct Properties using PropertyInjector #693

Open
4 of 11 tasks
pcheungamz opened this issue Jan 28, 2025 · 0 comments
Open
4 of 11 tasks
Labels
status/proposed Newly proposed RFC

Comments

@pcheungamz
Copy link

pcheungamz commented Jan 28, 2025

Description

We would like to propose a framework for organizations to set default values to Construct Properties such as BucketProps.

Key Components:

  • IPropertyInjector - has constructFqn and and inject function that takes in the original BucketProps and returns a BucketProps.
  • PropertyInjectors - A collection of IPropertyInjectors. There is only one IPropertyInjector for a Construct. We can attach PropertyInjectors to any Construct, but the typical use case is to set PropertyInjectors on App, Stage, or Stack.
  • applyInjectors - Constructs such as Bucket will call applyInjectors in their constructors to get the new BucketProps. It calls findInjectorsFromConstruct to find the correct injector to apply to the properties.
  • findInjectorsFromConstruct - This starts from the Construct's parent Node and walk up the Tree to find an IPropertyInjector applicable to this Construct.
  • Constructs that support Property Injection will need a FQN and call applyInjectors.

With this PropertyInjector Framework, AWS and SDO Security orgs can set default properties for builders that meet their security bars.

Roles

Role User
Proposed by @pcheungamz
Author(s) @pcheungamz
API Bar Raiser @rix0rrr
Stakeholders @pcheungamz, @manan-pancholi

See RFC Process for details

Workflow

  • Tracking issue created (label: status/proposed)
  • API bar raiser assigned (ping us at #aws-cdk-rfcs if needed)
  • Kick off meeting
  • RFC pull request submitted (label: status/review)
  • Community reach out (via Slack and/or Twitter)
  • API signed-off (label status/api-approved applied to pull request)
  • Final comments period (label: status/final-comments-period)
  • Approved and merged (label: status/approved)
  • Execution plan submitted (label: status/planning)
  • Plan approved and merged (label: status/implementing)
  • Implementation complete (label: status/done)

Author is responsible to progress the RFC according to this checklist, and
apply the relevant labels to this issue so that the RFC table in README gets
updated.

@pcheungamz pcheungamz added the status/proposed Newly proposed RFC label Jan 28, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
status/proposed Newly proposed RFC
Projects
None yet
Development

No branches or pull requests

1 participant