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

add support for full or partially updating Config params from SSM #1318

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

petrkalos
Copy link
Contributor

@petrkalos petrkalos commented Jun 6, 2024

Feature or Bugfix

Feature

Detail

Currently data.all reads the config that is commited to the root directory of the repo.
In this PR we allow customers to customize the params as defined in the config.json (or completely overwrite it) using an SSM parameter (/datall/{ENV}/configjson).
The new workflow will be as follows

  1. Read the config.json (as always)
  2. Read the configjson SSM param and merge it with the contents of config.json (essentially overwriting the specified params)

This is useful for the following cases...

  • Running a CI/CD pipeline directly from GitHub repo and want to customize the behaviour
  • Running multiple stages/envs (dev, uat, prod etc) and want to customize them separately

Relates

Security

Please answer the questions below briefly where applicable, or write N/A. Based on
OWASP 10.

  • Does this PR introduce or modify any input fields or queries - this includes
    fetching data from storage outside the application (e.g. a database, an S3 bucket)?
    • Is the input sanitized?
    • What precautions are you taking before deserializing the data you consume?
    • Is injection prevented by parametrizing queries?
    • Have you ensured no eval or similar functions are used?
  • Does this PR introduce any functionality or component that requires authorization?
    • How have you ensured it respects the existing AuthN/AuthZ mechanisms?
    • Are you logging failed auth attempts?
  • Are you using or adding any cryptographic features?
    • Do you use a standard proven implementations?
    • Are the used keys controlled by the customer? Where are they stored?
  • Are you introducing any new policies/roles/users?
    • Have you used the least-privilege principle? How?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@petrkalos petrkalos closed this Jun 17, 2024
@petrkalos
Copy link
Contributor Author

Closing because @dlpzx pointed out that CDK also reads this config file hence changing it dynamically is not a very good idea. We need to come up with a better plan.

@petrkalos petrkalos reopened this Jun 21, 2024
@petrkalos petrkalos force-pushed the feature/read_config_from_ssm branch from ffec44a to e98581d Compare June 21, 2024 08:48
@petrkalos petrkalos merged commit 1a5f3a2 into main Jun 21, 2024
9 checks passed
@dlpzx dlpzx deleted the feature/read_config_from_ssm branch June 26, 2024 09:26
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

Successfully merging this pull request may close these issues.

3 participants