juju_model (Resource)¶
A resource that represent a Juju Model.
Example Usage¶
resource "juju_model" "this" {
name = "development"
cloud {
name = "aws"
region = "eu-west-1"
}
config = {
logging-config = "<root>=INFO"
development = true
no-proxy = "jujucharms.com"
update-status-hook-interval = "5m"
}
timeouts {
create = "60m" # default is 30m
}
}
Schema¶
Required¶
name(String) The name to be assigned to the model. Changing this value will require the model to be destroyed and recreated by terraform.
Optional¶
agent_version(String) The model’s Juju agent version. This is computed from the controller and can be set on an existing model to request an upgrade.annotations(Map of String) Annotations for the modelcloud(Block List) Juju Cloud where the model will operate. Changing this value will cause the model to be destroyed and recreated by terraform. (see below for nested schema)config(Map of String) Override default model configuration. You may also set the ‘secret-backend’ key here for backward compatibility with Juju 3, but the recommended approach is to use the secret_backend attribute.constraints(String) Constraints imposed to this modelcredential(String) Credential used to add the modelsecret_backend(String) The name of the secret backend to use for this model. On Juju 4+, this uses the dedicated model-secret-backend API. On Juju 3, it falls back to setting the ‘secret-backend’ model config key. Use this instead of setting ‘secret-backend’ in the config block.target_controller(String) Only useful with JAAS - the backing controller where the model will be created. If not set, a random controller the user has access to supporting the desired cloud will be used.
Read-Only¶
id(String) The ID of this resource.type(String) Type of the model. Set by the Juju’s API serveruuid(String) The uuid of the model
Nested Schema for cloud¶
Required:
name(String) The name of the cloud
Optional:
region(String) The region of the cloud
Import¶
Import is supported using the following syntax:
# Models can be imported using the model's uuid
$ terraform import juju_model.development a3c2c72a-75f6-43b9-9b2d-d85d5449cb2f
Limitations of Import¶
Any entries of the config attribute specified in the Terraform configuration are ignored. You can add entries to the config map and manage them using Terraform after import.
Once imported you must add the desired model configuration and run a Terraform apply. This will report no changes but Terraform will be tracking the specified model configuration.
The limitation is intentional. It exists as, without it, Terraform would import all model configuration including defaults. It may not be desirable to manage defaults using Terraform.