Contact Us 1-800-596-4880

Managed Omni Gateway Resources

Use Managed Omni Gateway resources to manage gateway instances deployed in CloudHub 2.0 private spaces.

anypoint_managed_omni_gateway

Use the anypoint_managed_omni_gateway resource to manage a CloudHub 2.0 Managed Omni Gateway instance in Anypoint Platform.

Supported gateway type: This provider currently supports MuleSoft Managed Omni Gateway (CloudHub 2.0) only. Self-managed Omni Gateway will be supported in a future release.

Connected App: This resource requires a standard connected app (client credentials). An admin connected app isn’t needed. The connected app must have relevant scopes.

Tracing note: The Gateway Manager API doesn’t echo back configuration.tracing in POST/PUT responses. The provider retains the plan-requested value in state after create/update so that tracing.enabled = true works correctly. On the next terraform refresh or plan, the provider reads the live value from the API for accurate drift detection.

Example Usage

resource "anypoint_managed_omni_gateway" "example" {
  name           = "my-omni-gateway"
  environment_id = "env-id-here"
  target_id      = "target-private-space-id"

  release_channel = "lts"
  size            = "small"

  ingress = {
    forward_ssl_session = true
    last_mile_security  = true
  }

  properties = {
    upstream_response_timeout = 15
    connection_idle_timeout   = 60
  }

  logging = {
    level        = "info"
    forward_logs = true
  }

  tracing = {
    enabled = false
  }
}

Required Arguments

  • name - The name of the managed Omni Gateway.

  • environment_id - The environment ID where the gateway will be deployed.

  • target_id - The target (private space) ID for the gateway deployment.

Optional Arguments

  • organization_id - Organization ID. If not provided, the organization ID is inferred from the connected app credentials.

  • runtime_version - The Omni Gateway runtime version (for example, 1.9.9). If omitted, the provider auto-selects the latest version for the chosen release_channel.

  • release_channel - The release channel for the gateway. Valid values: lts, edge. Defaults to lts.

  • size - The size of the gateway instance. Valid values: small, large. Defaults to small.

  • ingress - (Block) Ingress configuration for the gateway..

  • properties - (Block) Runtime properties for the gateway..

  • logging - (Block) Logging configuration for the gateway..

  • tracing - (Block) Distributed tracing configuration for the gateway..

Read-Only Attributes

  • id - The unique identifier of the managed Omni Gateway.

  • status - The current status of the managed Omni Gateway.

Nested Schema for ingress

  • public_url - The public URL for the gateway ingress. Auto-derived from the target domain when empty.

  • internal_url - The internal URL for the gateway ingress. Auto-derived from the target domain when empty.

  • forward_ssl_session - Whether to forward SSL sessions to upstream services. Defaults to true.

  • last_mile_security - Whether to enable last-mile security (TLS between gateway and upstream). Defaults to true.

Nested Schema for properties

  • upstream_response_timeout - Timeout in seconds for upstream service responses. Defaults to 15.

  • connection_idle_timeout - Timeout in seconds for idle connections. Defaults to 60.

Nested Schema for logging

  • level - The log level. Valid values: debug, info, warn, error. Defaults to info.

  • forward_logs - Whether to forward logs to Anypoint Monitoring. Defaults to true.

Nested Schema for tracing

  • enabled - Whether distributed tracing is enabled. Defaults to false.

Import

An existing Managed Omni Gateway can be imported using a composite ID. Use the 2-part form for root-org gateways and the 3-part form when the gateway belongs to a Business Group (sub-org).

The gateway_id is the UUID of the gateway visible in Runtime Manager or the Gateway Manager API.

Root org (2-part ID):

import {
  to = anypoint_managed_omni_gateway.imported
  id = "<environment_id>/<gateway_id>"
}

resource "anypoint_managed_omni_gateway" "imported" {
  name           = "<gateway_name>"
  environment_id = "<environment_id>"
  target_id      = "<target_id>"
}

Sub-org (3-part ID):

import {
  to = anypoint_managed_omni_gateway.imported
  id = "<organization_id>/<environment_id>/<gateway_id>"
}

resource "anypoint_managed_omni_gateway" "imported" {
  organization_id = "<organization_id>"
  name            = "<gateway_name>"
  environment_id  = "<environment_id>"
  target_id       = "<target_id>"
}

After adding the import block, run:

# Let Terraform generate the full resource configuration automatically:
terraform plan -generate-config-out=generated.tf

# Or apply the import directly if you have an existing resource block:
terraform apply

Using the CLI (deprecated, Terraform < 1.5)

# Root org:
terraform import anypoint_managed_omni_gateway.imported <environment_id>/<gateway_id>

# Sub-org:
terraform import anypoint_managed_omni_gateway.imported <organization_id>/<environment_id>/<gateway_id>