juju_integration (Resource)

A resource that represents a Juju Integration.

Example Usage

resource "juju_integration" "this" {
  model = juju_model.development.name
  via   = "10.0.0.0/24,10.0.1.0/24"

  application {
    name     = juju_application.wordpress.name
    endpoint = "db"
  }

  application {
    name     = juju_application.percona-cluster.name
    endpoint = "server"
  }

  # Add any RequiresReplace schema attributes of
  # an application in this integration to ensure
  # it is recreated if one of the applications
  # is Destroyed and Recreated by terraform. E.G.:
  lifecycle {
    replace_triggered_by = [
      juju_application.wordpress.name,
      juju_application.wordpress.model,
      juju_application.wordpress.constraints,
      juju_application.wordpress.placement,
      juju_application.wordpress.charm.name,
      juju_application.percona-cluster.name,
      juju_application.percona-cluster.model,
      juju_application.percona-cluster.constraints,
      juju_application.percona-cluster.placement,
      juju_application.percona-cluster.charm.name,
    ]
  }
}

Schema

Required

  • model (String) The name of the model to operate in.

Optional

  • application (Block Set) The two applications to integrate. (see below for nested schema)

  • via (String) A comma separated list of CIDRs for outbound traffic.

Read-Only

  • id (String) The ID of this resource.

Nested Schema for application

Optional:

  • endpoint (String) The endpoint name. This attribute may not be used at the same time as the offer_url.

  • name (String) The name of the application. This attribute may not be used at the same time as the offer_url.

  • offer_url (String) The URL of a remote application. This attribute may not be used at the same time as name and endpoint.

Notes

When creating this resource the offer_url property will show (known after apply) if a name or name and endpoint are supplied as below:

  + resource "juju_integration" "this" {
      + id    = (known after apply)
      + model = "this"
      + via   = "10.0.0.0/24,10.0.1.0/24"

      + application {
          + endpoint  = (known after apply)
          + name      = "one"
          + offer_url = (known after apply)
        }
    }

This is due to an integration requiring a name/endpoint combination or an offer_url, but not both bits of data together.

Import

Import is supported using the following syntax:

# Integrations can be imported by using the format: model_name:provider_app_name:endpoint:requirer_app_name:endpoint, for example:
$ terraform import juju_integration.wordpress_db development:percona-cluster:server:wordpress:db