Resource: aws_appmesh_gateway_route

Provides an AWS App Mesh gateway route resource.

Example Usage

resource "aws_appmesh_gateway_route" "example" {
  name                 = "example-gateway-route"
  mesh_name            = "example-service-mesh"
  virtual_gateway_name = aws_appmesh_virtual_gateway.example.name

  spec {
    http_route {
      action {
        target {
          virtual_service {
            virtual_service_name = aws_appmesh_virtual_service.example.name
          }
        }
      }

      match {
        prefix = "/"
      }
    }
  }

  tags = {
    Environment = "test"
  }
}

Argument Reference

This resource supports the following arguments:

The spec object supports the following:

The grpc_route, http_route and http2_route objects supports the following:

The grpc_route, http_route and http2_route's action object supports the following:

The target object supports the following:

The virtual_service object supports the following:

The http_route and http2_route's action object additionally supports the following:

The rewrite object supports the following:

The hostname object supports the following:

The path object supports the following:

The prefix object supports the following:

The grpc_route's match object supports the following:

The http_route and http2_route's match object supports the following:

The header object supports the following:

The header's match object supports the following:

The range object supports the following:

The hostname object supports the following:

The path object supports the following:

The query_parameter object supports the following:

The query_parameter's match object supports the following:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import App Mesh gateway routes using mesh_name and virtual_gateway_name together with the gateway route's name. For example:

import {
  to = aws_appmesh_gateway_route.example
  id = "mesh/gw1/example-gateway-route"
}

Using terraform import, import App Mesh gateway routes using mesh_name and virtual_gateway_name together with the gateway route's name. For example:

% terraform import aws_appmesh_gateway_route.example mesh/gw1/example-gateway-route