# juju_enable_ha (Action)

Enables high availability (HA) on a Juju controller by ensuring the desired number of controller units are running.

## Example Usage

```terraform
resource "juju_controller" "this" {
  name = "my-controller"
  # ...
}

action "juju_enable_ha" "this" {
  api_addresses = juju_controller.this.api_addresses
  ca_cert       = juju_controller.this.ca_cert
  username      = juju_controller.this.username
  password      = juju_controller.this.password
  units         = 3
}
```

<!-- action schema generated by tfplugindocs -->

## Schema

### Required

- `api_addresses` (List of String) API addresses of the target controller. Reference from the controller resource: juju_controller.<name>.api_addresses.
- `ca_cert` (String) CA certificate of the target controller. Reference from the controller resource: juju_controller.<name>.ca_cert.
- `password` (String) Admin password for the target controller. Reference from the controller resource: juju_controller.<name>.password.
- `units` (Number) Desired number of controller units. Must be an odd number and at least 3. Increasing the number of units is supported; decreasing is not possible via this action and must be done manually via the Juju CLI.
- `username` (String) Admin username for the target controller. Reference from the controller resource: juju_controller.<name>.username.

### Optional

- `constraints` (String) Optional placement constraints for newly provisioned controller units (e.g. “mem=8G cores=4”). Only used on Juju < 4.0 controllers; on Juju >= 4.0 new controller units inherit the constraints set at bootstrap time (bootstrap_constraints), mirroring the Juju CLI’s “juju add-unit” which accepts no constraints.
- `to` (List of String) Optional list of placement directives for new controller units (e.g. [“lxd:0”, “lxd:1”]).
