Basic Commands
Idem provides the idem cli which allows to describe resources but also invoke states.
Idem states are used to make sure resources are in a desired state. The desired state of a resource can be specified in SLS file.
encrypt
Use the acct subsystem to encrypt data, e.g. Encrypt the credentials file
idem encrypt /path/to/credentials.yaml
decrypt
Use the acct subsystem to decrypt data, e.g. an existing encrypted credentials file (*.fernet)
idem decrypt /path/to/credentials_test.yaml.fernet
describe
Commands to run description routines, e.g. Listing and obtaining existing VMs details
idem describe azure.compute.virtual_machines
state
Commands to run idempotent states, e.g. create, update, and in general manage your resources
idem state vm_moff_present.sls
You will use mostly a combination of describe (Discover status and helper for crafting a state file to update resource) and state commands (for managing the resources states),
let’s take a closer look to state operations.
exec
Commands to run execution routines, normally used internally in idem code
Present State
makes sure a resource exists in a desired state. If a resource does not exist, running present will create the resource on the provider. If a resource exists, running present will update the resource on the provider. (Only the values that the Cloud Provider REST API supports can be updated).
You can indicate this state by adding “«Your Provider».«Your Provider Resource».present”
my-virtual-network:
azure.virtual_networks.virtual_networks.present:
Absent State
makes sure a resource does not exist. If a resource exits, running absent will delete the resource. If a resource does not exist, running absent is a no-operation
You can indicate this state by adding “«Your Provider».«Your Provider Resource».absent”
my-virtual-network:
azure.virtual_networks.virtual_networks.absent:
You can learn and learn more about each state at the use cases