# juju_cloud (Resource)

A resource that represents a Juju Cloud for an existing controller.

## Example Usage

```terraform
# A minimal example of a juju_cloud resource.
# These are the only required fields.
resource "juju_cloud" "this" {
  name       = "my-cloud"
  type       = "openstack"
  auth_types = ["userpass"]
}

# A fully specified example.
resource "juju_cloud" "this" {
  name = "my-cloud"
  type = "openstack"

  auth_types = ["userpass"]

  endpoint          = "https://cloud.example.com"
  identity_endpoint = "https://identity.example.com"
  storage_endpoint  = "https://storage.example.com"

  ca_certificates = [
    file("${path.module}/ca.pem"),
  ]

  # Note, the first region is the DEFAULT region.
  regions = [
    {
      name              = "default"
      endpoint          = "https://region-default.example.com"
      identity_endpoint = "https://identity-default.example.com"
      storage_endpoint  = "https://storage-default.example.com"
    },
    {
      name = "my-other-region"
    },
  ]
}
```

<!-- schema generated by tfplugindocs -->

## Schema

### Required

- `auth_types` (Set of String) List of supported authentication types by the cloud.
- `name` (String) The name of the cloud in Juju.
- `type` (String) The type of the cloud.

### Optional

- `ca_certificates` (Set of String, Sensitive) List of PEM-encoded X509 certificates for the cloud.
- `endpoint` (String) Optional global endpoint for the cloud.
- `identity_endpoint` (String) Optional global identity endpoint for the cloud.
- `regions` (Attributes List) List of regions for the cloud. The first region in the list is the default region for the cloud. (see [below for nested schema]())
- `storage_endpoint` (String) Optional global storage endpoint for the cloud.
- `target_controller` (String) Only useful with JAAS - the backing controller where the cloud will be added. This field is required when running against a JAAS controller and must not be set otherwise. Changing this value will cause the cloud to be destroyed and recreated by terraform.

### Read-Only

- `id` (String) The ID of this resource.

<a id="nestedatt--regions"></a>

### Nested Schema for `regions`

Required:

- `name` (String) Name of the region.

Optional:

- `endpoint` (String) Region-specific endpoint.
- `identity_endpoint` (String) Region-specific identity endpoint.
- `storage_endpoint` (String) Region-specific storage endpoint.
