aws / aws/aws-cdk

(settings): ability to specific developer's local settings via cdk.local.json

Open
#29,821 2 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/core effort/medium feature-request p3
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
71

Description

### Describe the feature

I'd want my developers to be able to specify certain context settings via untracked `cdk.local.json` file.
Something similar to `.env.local` that is untracked and presents an opportunity for developers to configure their stacks without stepping on each other toes.

I am aware that there is `~/cdk.json` being a global configuration developer can apply but this particular's setting issue is its global impact on anything that's developed/deployed whereas I am looking for more isolated approach that allows to define settings per project.

### Use Case

Point here is not to bloat either `cdk.json` or `cdk.context.json` files that are tracked, or in my case can be tracked when it comes to `cdk.context.json`. Reason for not tracking `cdk.context.json` lies in a fact that my organization develops various services as L3 components (packaged as NPM packages) that are combined with `preview`. Preview actually uses the L3 component to deploy isolated micro service. Given that all developers have their accounts it would be quite problematic to manage `cdk.context.json` if it were submitted to repository.

Later all components are integrated in bigger application which itself can benefit from `cdk.local.json` allowing developers to test integration.

### Proposed Solution

Modify [settings.ts](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk/lib/settings.ts) by adding `export const PROJECT_LOCAL_CONFIG = 'cdk.local.json';` and adjusting code to load it up similarly to `USER_DEFAULTS`.

### Other Information

_No response_

### Acknowledgements

- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.137.0

### Environment details (OS name and version, etc.)

MacOS Sierra

Contributor guide

Open the contributing guide

Research direction

Start in packages/aws-cdk/lib/settings.ts and trace how USER_DEFAULTS and project configuration are loaded. Verify the proposed cdk.local.json is isolated to the current project, does not alter global settings, and can provide the requested developer-specific context without changing tracked configuration behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
infrastructure
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.