How to manage machines¶
See also:
juju
| Machine
Add a machine¶
To add a machine to a model, in your Terraform plan add a resource of the juju_machine
type, specifying the model.
resource "juju_machine" "machine_0" {
model = juju_model.development.name
}
You can optionally specify a base, a name, regular constraints, storage constraints, etc. You can also specify a private_key_file
, public_key_file
, and ssh_address
– that will allow you to add to the model an existing, manual machine (rather than a virtual one provisioned for you by the cloud).
See more:
juju_machine
(resource)
Manage constraints for a machine¶
See also:
juju
| Constraint
To set constraints for a machine, in your Terraform plan, in the machine resource definition, set the constraints attribute to the desired quotes-enclosed, space separated list of key=value pairs. For example:
resource "juju_machine" "machine_0" {
model = juju_model.development.name
name = "machine_0"
constraints = "tags=my-machine-tag"
}
See more:
juju_machine
(resource)
Remove a machine¶
See also:
juju
| Removing things
To remove a machine, remove its resource definition from your Terraform plan.
See more:
juju_machine
(resource)
Contributors: @alhama7a, @cderici, @tmihoc