feat!: parameterise snapshot admin username #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR is
This PR parameterises the
db_snapshot_admin_usernameparameter. This is because thecreate_database_serverfunction internally was hardcoding the admin username of snapshots, which we discovered didn't align to our example in CSDA STAC API: https://github.com/NASA-IMPACT/csda-project/issues/753#issuecomment-2504708053With this change, we can now override this value so that when a DB is restored from a snapshot, its admin user just gets a new password generated and we don't lock ourselves out 🎉
As this is a breaking change (changed the default value to be the RDS default value and parameterised it) I've bumped the version - Not sure how we release this, but looks like we just install via git url in the projects that use this.
What I changed
VERSION.flake8just to reduce some linting issues (I envision in another workstream we actally give this repo some TLC in terms of dev tooling)README.mdfor the above changes and removed some unused vars in the other examplescdk_bootstrapped_db/constructs.pydb_snapshot_admin_usernameincdk_boostrapped_db/helpers.py:create_database_serverHow you can test this
If you're using the
create_database_serverfunctionality with a snapshot, you should be able to install this new version and just providedb_snapshot_admin_usernameas the value of the admin user of the snapshot and you should get a cdk diff with no changes to that construct.Or just watch this issue as we tackle it: https://github.com/NASA-IMPACT/csda-project/issues/753