liveBook · Manning

CRUD

As explained in Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform

CRUD operations are the four fundamental capabilities for creating, retrieving, modifying, and removing a resource.

CRUD reduces infrastructure automation to four capabilities: create a resource, read its metadata, update its properties, and delete it when it is no longer needed. section 2.1

Apply the operations in sequence when expressing an infrastructure change:

  • Create a GCP server. section 2.1
  • Read the server to verify its existence and specifications, such as Ubuntu 18.04. section 2.1
  • Update properties, such as adding a publicly accessible network address. section 2.1
  • Delete the server when it is no longer required. section 2.1

Scripted infrastructure changes

A script can update packages, read SSH keys, update users, and conditionally update IP tables. This imperative sequence resembles an instruction manual, but extensive change histories become difficult to reproduce reliably. section 2.1

How Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform covers it

How deep it goes
Defines four operations and their imperative ordering, then warns that stepwise change does not scale.
Examples
Uses a GCP server, Ubuntu 18.04, network access, SSH keys, users, and IP tables as concrete operations.
What you can do after
Build it from scratch by decomposing infrastructure scripts into ordered create, read, update, and delete actions.
How it connects
Connects infrastructure as code with imperative style, reproducibility, immutability, and modular design.

Also explained in

Compare how 11 books explain CRUD →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform. The section links point to the parts of the book it draws on.