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

feature flags should be defined in code not context #20190

Closed
2 tasks
rittneje opened this issue May 3, 2022 · 4 comments
Closed
2 tasks

feature flags should be defined in code not context #20190

rittneje opened this issue May 3, 2022 · 4 comments
Assignees
Labels
@aws-cdk/core Related to core CDK functionality effort/large Large work item – several weeks of effort feature-request A feature should be added or improved.

Comments

@rittneje
Copy link

rittneje commented May 3, 2022

Describe the feature

Currently, AWS CDK uses feature flags defined in cdk.json to opt into or out of certain behavior. However, because these flags are applied globally to the entire app, they inevitably lead to a poor developer experience.

First, they are not easily discoverable. For example, the documentation for UsagePlan does not mention the usagePlanKeyOrderInsensitiveId feature flag, which tends to be necessary when upgrading from v1 to v2.

Second, because they get applied to the entire app instead of individual constructs, once an app is "tainted" there is no way to change the behavior even for new constructs. By extension, I cannot move a stack from one app to another if the relevant feature flags between the two apps are different.

I request that the concept of feature flags within cdk.json be deprecated. Instead, these should be handled in a first-class way inside the CDK code. At minimum, I should be able to define them at the app, stage, and stack level.

Use Case

See above.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.20.0

Environment details (OS name and version, etc.)

Alpine 3.15

@rittneje rittneje added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels May 3, 2022
@github-actions github-actions bot added the @aws-cdk/aws-apigateway Related to Amazon API Gateway label May 3, 2022
@peterwoodworth peterwoodworth added effort/large Large work item – several weeks of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jun 10, 2022
@peterwoodworth
Copy link
Contributor

Regardless of if/when this request gets implemented, the documentation surrounding feature flags needs to be improved.

@peterwoodworth peterwoodworth added documentation This is a problem with documentation. and removed documentation This is a problem with documentation. labels Jun 10, 2022
@Naumel
Copy link
Contributor

Naumel commented Jun 10, 2022

Flagging this as (somewhat) related to #20573, at least the initial pain-points around documentation.

@kaizencc kaizencc added @aws-cdk/core Related to core CDK functionality and removed @aws-cdk/aws-apigateway Related to Amazon API Gateway labels Jun 10, 2022
@kaizencc kaizencc assigned rix0rrr and unassigned otaviomacedo Jun 10, 2022
@rix0rrr
Copy link
Contributor

rix0rrr commented Jul 7, 2022

Agreed on the documentation. As for code: since feature flags are just context values, you can actually configure them in code today.

https://docs.aws.amazon.com/cdk/v2/guide/context.html#context_construct

@rix0rrr rix0rrr closed this as completed Sep 2, 2022
@github-actions
Copy link

github-actions bot commented Sep 2, 2022

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality effort/large Large work item – several weeks of effort feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

6 participants