Contact Us 1-800-596-4880

Managed Omni Gateway Resources

Use Managed Omni Gateway resources to manage gateway instances and retrieve gateway details in Anypoint Platform.

anypoint_managed_omni_gateway

Use the anypoint_managed_omni_gateway resource to manage a CloudHub 2.0 Managed Omni Gateway instance in Anypoint Platform. The gateway can be deployed to a dedicated private space or a shared space.

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.

Gateway name is immutable: The gateway name can’t be changed after creation. The provider raises a plan-time error if you attempt to rename it. To rename a gateway, replace the terraform apply -replace=<resource_address> resource.

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>

anypoint_managed_omni_gateway Data Source

Use the anypoint_managed_omni_gateway data source to read the full details of a single managed Omni Gateway instance by ID.

Example Usage

data "anypoint_managed_omni_gateway" "gw" {
  id              = var.gateway_id
  environment_id  = var.environment_id
  organization_id = var.organization_id
}

output "gateway_public_url" {
  value = data.anypoint_managed_omni_gateway.gw.ingress.public_url
}

Required Arguments

  • id - The gateway ID.

  • environment_id - The environment ID where the gateway is deployed.

Optional Arguments

  • organization_id - The organization ID. If not specified, uses the organization from provider credentials.

Read-Only Attributes

  • name - The name of the gateway.

  • target_id - The ID of the deployment target (private or shared space).

  • target_name - The name of the deployment target.

  • target_type - The type of deployment target (for example, private-space).

  • runtime_version - The Omni Gateway runtime version.

  • release_channel - The release channel (lts or edge).

  • size - The gateway instance size (small or large).

  • status - The current status of the gateway (for example, APPLYING, RUNNING).

  • desired_status - The desired status of the gateway (for example, STARTED).

  • status_message - A descriptive status message.

  • api_limit - The maximum number of API instances this gateway can host.

  • date_created - Timestamp when the gateway was created.

  • last_updated - Timestamp when the gateway was last updated.

  • ingress - (Object) Ingress configuration. See Nested Schema for ingress.

  • properties - (Object) Runtime properties. See Nested Schema for properties.

  • logging - (Object) Logging configuration. See Nested Schema for logging.

  • port_configuration - (Object) Port configuration. See Nested Schema for port_configuration.

Nested Schema for ingress

  • public_url - The public URL for the gateway.

  • internal_urls - (List of String) Internal URLs for the gateway.

  • forward_ssl_session - Whether SSL session forwarding is enabled.

  • last_mile_security - Whether last-mile security is enabled.

Nested Schema for properties

  • upstream_response_timeout - Timeout in seconds for upstream responses.

  • connection_idle_timeout - Timeout in seconds for idle connections.

Nested Schema for logging

  • level - The log level.

  • forward_logs - Whether log forwarding is enabled.

Nested Schema for port_configuration

  • ingress - (Object) Ingress port configuration.

    • port - The port number.

    • protocol - The protocol (for example, TCP).

  • egress - (Object) Egress port configuration.

    • port - The port number.

    • protocol - The protocol (for example, TCP).

anypoint_managed_omni_gateways Data Source

Use the anypoint_managed_omni_gateways data source to list all managed Omni Gateway instances in an environment.

Example Usage

data "anypoint_managed_omni_gateways" "all" {
  organization_id = var.organization_id
  environment_id  = var.environment_id
}

output "gateway_names" {
  value = [for gw in data.anypoint_managed_omni_gateways.all.gateways : gw.name]
}

Required Arguments

  • environment_id - The environment ID.

Optional Arguments

  • organization_id - The organization ID. If not specified, uses the organization from provider credentials.

Read-Only Attributes

  • id - Composite identifier <organization_id>/<environment_id>.

  • gateways - (List of Object) The list of managed Omni Gateway instances. See Nested Schema for gateways.

Nested Schema for gateways

  • id - The gateway ID.

  • name - The name of the gateway.

  • target_id - The ID of the deployment target.

  • status - The current status of the gateway (for example, APPLYING, RUNNING, RUNNING).

  • date_created - Timestamp when the gateway was created.

  • last_updated - Timestamp when the gateway was last updated.