-
Notifications
You must be signed in to change notification settings - Fork 4
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
[WIP] State management, variables, and config encryption #79
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ff75eea
to
d52216b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
At present Touchdown is a great way of freezing a set of cloud resources into a reproducible idempotent bundle. But it isn't really a configuration management system, as there is no configuration of that bundle. Out of the box you can't deploy the same environment twice, once with
m1.small
and then again withm3.medium
instances. You'd have to edit theTouchdownfile
. This PR considers what aTouchdownfile
would look like if we embraced the resource graph system to describe a configuration system.Storage
First of all we need an abstraction for the storage of blobs of data.
It needs to support S3:
It needs to support encryption:
GPG too:
(It should just work if you wrapped GPG in KMS and vice versa too).
The data format itself is just another layer. For ConfigParser it is just:
FIXME: Naming things is hard.
file
orstreamable
orobj
orobject
. (stream
isn't right as its not a stream, its more of a stream factory)Settings
Each setting would be a resource as well:
There would by type information and validation metadata:
A Django secret key varies between environments. But it is generated according to a recipe and theres no reason to set it to a particular value.
When this variable is first consumed it is generated using the value callable and stored in the settings object.
The cleanest mechanism for mapping a variable to a resource would be like this:
There is no mechanism for doing this presently - the
min
attribute of anautoscaling_group
must be an integer or a serializer. The type validation of serializers is also weaker than it could be. The setter needs updating to be able to acquire a suitable serializer for one of these variables.This approach decouples the
Touchdownfile
definition from the backing store. The sameTouchdownfile
could persist state to local disk, github API, S3. It also allows layering - the resources can be GPG or KMS encrypted.UI enhancements
A new show subcommand to see the current state of a settings file (complete with default values set):
The new
show
command would eventually work on any named resource - you could use it on an autoscaling group to see its current state for example.A new
get
command for seeing the current value of a setting:And a new
set
command:A
refresh
command would cause computed variables to be regenerated and the state store to be updated.