§ Concepts
What a plan reaches
Change one setting, replace a root key, add a zone or run two applies on one estate, and see which resources each plan reaches and which locks each apply holds.
pravo records which resource reads which. A plan starts at the change and follows the edges for as long as a value changes. The resources it does not reach are neither validated nor planned, and their records are not read from the providers: a plan reads the records of the resources it reaches and of the resources they read, and only when a record is older than its refresh age. The Graph: line counts what was planned, skipped, read and not read.
An apply locks the resources that its plan writes, and nothing else. Two applies that write different resources run at the same time. The estate below is a small certificate authority with several zones, planned by the real binary.
- created
- updated in place
- replaced
- skipped
- locked
15a: services: {api: {}, web: {}}
16+b: services: {api: {}, web: {renewal_hours: 48}}
16-b: services: {api: {}, web: {}}
17c: services: {api: {}, web: {}}
# service.b.web.cert (tls_locally_signed_cert) will be updated in-place
Plan: 0 to add, 1 to change, 0 to destroy.
Graph: planned 1 of 39, 38 unchanged and skipped, 4 refreshed, 35 not read.
cert: tls.#Resource.tls_locally_signed_cert & {
cert_request_pem: csr.cert_request_pem
ca_private_key_pem: issuer_key
ca_cert_pem: issuer_cert
validity_period_hours: 2160
early_renewal_hours: renewal_hours
allowed_uses: ["server_auth"]
}
1of 39
nodes planned
Graph: planned 1 of 39, 38 unchanged and skipped, 4 refreshed, 35 not read.
fig. 3 One certificate gets a longer renewal window, an attribute that the provider updates in place. 1 of 39 nodes are planned. The file that holds the certificate and the 37 other nodes are skipped.
The four changes
- Change a setting. One certificate gets a longer renewal window, an attribute that the provider updates in place. 1 of 39 nodes are planned. The file that holds the certificate and the 37 other nodes are skipped.
Graph: planned 1 of 39, 38 unchanged and skipped, 4 refreshed, 35 not read. - Replace a root key. The root key changes its curve, which cannot change in place. The key is replaced, and the replacement follows the edges to every certificate below it and to the files that hold them: 21 of 39 nodes. The 18 keys and certificate requests that do not read the root are skipped.
Graph: planned 21 of 39, 18 unchanged and skipped, 33 refreshed, 6 not read. - Add a zone. A fourth zone, d, joins the specification. Its 4 resources are created, and the 39 existing nodes are skipped: planned 4 of 43.
Graph: planned 4 of 43, 39 unchanged and skipped, 2 refreshed, 37 not read. - Two applies at once. Ana replaces the key of zone a and Bob replaces the key of zone b. The two plans share no node and no output, so both applies hold their locks at once: 16 locks, two holders. Both applies complete.
Plans explains the rule with the commands that print each result. State describes the locks, and Lab 2 runs two applies at once.