This package synchronizes IaC files with blocks in Nullstone.
- [] Synchronize new blocks defined in IaC files
- [] Add support for
datastores
stanza - Validate overrides file
- Provide validation errors to user if connection target does not exist
- Resolve connections to domains (
global.global.<domain>
) - [] Resolve connections to other stacks/envs
- [] Add support for changing capability connections
This library is used primarily by iac.ApplyConfig located in the nullfire
repo,
which synchronizes IaC files against blocks stored in the database (nullfire
and furion
).
This entails a synchronization of 3 sources:
- Database (a user configured through the UI)
- Primary IaC file (
.nullstone/config.yml
in the git repo) - Overrides IaC file (
.nullstone/<env>.yml
or.nullstone/previews.yml
in the git repo)
This library is intended to be used by enigma
as well as nullstone
to parse and validate IaC files.
Conflicts and weird behavior can arise when synchronizing these 3 sources.
For example, if a user removes a block from their primary IaC file, they could expect one of two outcomes:
- The block is destroyed, then deleted.
- They intended to move the block to an IaC file in another repo. In this scenario, if we followed #1 and destroyed/deleted a postgres cluster, this could be disastrous.
This is how Terraform currently works; however, we have given our users an expectation that GitOps should automatically resolve these types of issues. As a result, we should follow these design principles:
- Use docker-compose as a design compass (It is widely used and users are familiar with the design)
- An authorized user should have the ability to approve/reject destruction.
- A user can easily/rapidly validate and correct issues with their IaC files.
Nullstone runs through a multi-stage process to synchronize configuration.
- Validate (provide validation errors back to user)
- Validate primary+overrides IaC file
- Build list of new blocks, changes in IaC ownership
- Resolve primary+overrides connections
- Add new blocks
- Apply changes to IaC ownership
- Apply primary IaC file to desired changes
- Apply variables
- Apply env variables
- Apply connections
- Apply overrides IaC file to desired changes
- Apply variables
- Apply env variables
- Apply connections