Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proposal: Store app context in Parameter Store

See original GitHub issue

CDK uses contexts to store data that is generated the first time an application is run, for use in subsequent application invocations. These contexts contain information such as AMI IDs, availability zones, and so forth. Such storage is needed in order to preserve dynamic values that might change in a later query. Preserving these values prevents an otherwise-working stack from being unnecessarily modified, risking downtime or other availability issues.

Currently the context data is stored in cdk.json in the app’s home directory. Sharing of this data between users is currently done by committing the file into the app’s source code repository. However, this leads to several risks:

  1. There’s no requirement that the file be committed
  2. The file may be committed and pushed upstream, but there’s no synchronization mechanism: nothing prevents Betty from running cdk deploy without having first downloaded the changes pushed upstream by Abigail
  3. If the file is committed, context must be sanitized before making the application public

Instead of keeping this state in the repo, I propose we keep it in SSM Parameter Store instead. It’s purpose built for sharing this information; it’s inexpensive; and better still, its data is scoped by region + account. It resolves all of the problems above AFAICT.

Is anyone aware of any drawbacks to this approach?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

rix0rrrcommented, Mar 6, 2019

No, this is very likely a good idea for multiple reasons. And it meshes well with CloudFormation’s “state lives in the cloud” philosophy.

Thanks for writing it down so lucidly.

cynicaljoycommented, May 1, 2019

I’d imagine this would need to be configureable within the cdk.json as some teams restrict SSM - but I would take advantage of this. We’re currently adding the context file to the .gitignore as some of our values that we pull from SSM are protected, so if the app context was stored in SSM we’d gain version history and could manage the access there of with IAM.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Proposal: Store app context in Parameter Store · Issue #1967
CDK uses contexts to store data that is generated the first time an application is run, for use in subsequent application invocations.
Read more >
Resolving Spring Boot Properties Using the AWS Parameter ...
Learn how to obtain configuration properties for your Spring Boot application using the Parameter Store of the AWS Systems Manager (SSM)
Read more >
Spring Boot and AWS Parameter Store - Source @ Coveo
Storing parameters securely accross multiple environments with employees having different level of access in each of those can be challenging.
Read more >
AWS Systems Manager Parameter Store
Parameter Store, a capability of AWS Systems Manager, provides secure, hierarchical storage for configuration data management and secrets management.
Read more >
Context parameters - Confluence Cloud - Atlassian Developer
Context parameters are additional values pairs that are sent to your app in the request URL from the host application.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found