juju_action (Data Source)

A data source representing a Juju action. The action’s result is fetched via its ID and awaited during the data source read. This allows actions to be run outside of Terraform and their results consumed by other resources.

Example Usage

data "juju_action" "action" {
  model_uuid = juju_model.development.uuid
  action_id  = juju_action.action.action_id
}

# The action output can be used by other resources. For example, to
# fetch a nested value from a JSON string result:
locals {
  application_proxied_url = jsondecode(data.juju_action.action.output.proxied-endpoints)[juju_application.traefik.name].url
}

Schema

Required

  • action_id (String) The ID of the action whose result is fetched.

  • model_uuid (String) The UUID of the model where the action was run.

Read-Only

  • id (String) The ID of this resource.

  • output (String) The output of the action as a JSON string. Use jsondecode() to extract values from it.