juju_credential (Resource)

A resource that represent a credential for a cloud.

Example Usage

resource "juju_credential" "this" {
  name = "creddev"

  cloud {
    name = "localhost"
  }

  auth_type = "certificate"

  attributes = {
    client-cert    = "/srv/cert.crt"
    client-key     = "/srv/cert.key"
    trust-password = "S0m3P@$$w0rd"
  }
}

Schema

Required

  • auth_type (String) Credential authorization type.

  • name (String) The name to be assigned to the credential. Changing this value will cause the credential to be destroyed and recreated by terraform.

Optional

  • attributes (Map of String, Sensitive) Credential attributes accordingly to the cloud

  • client_credential (Boolean) Add credentials to the client.

  • cloud (Block List) Juju Cloud where the credentials will be used to access. (see below for nested schema)

  • controller_credential (Boolean) Add credentials to the controller.

Read-Only

  • id (String) The ID of this resource.

Nested Schema for cloud

Required:

  • name (String) The name of the cloud

Import

Import is supported using the following syntax:

# Credentials can be imported by using the following pattern: 
# credentialname:cloudname:false:true
# Where false means that is not a client credential
# and true means that is a Controller credential
$ terraform import juju_credential.credential creddev:localhost:false:true