Resource: aws_appmesh_virtual_gateway

Provides an AWS App Mesh virtual gateway resource.

Example Usage

Basic

resource "aws_appmesh_virtual_gateway" "example" {
  name      = "example-virtual-gateway"
  mesh_name = "example-service-mesh"

  spec {
    listener {
      port_mapping {
        port     = 8080
        protocol = "http"
      }
    }
  }

  tags = {
    Environment = "test"
  }
}

Access Logs and TLS

resource "aws_appmesh_virtual_gateway" "example" {
  name      = "example-virtual-gateway"
  mesh_name = "example-service-mesh"

  spec {
    listener {
      port_mapping {
        port     = 8080
        protocol = "http"
      }

      tls {
        certificate {
          acm {
            certificate_arn = aws_acm_certificate.example.arn
          }
        }

        mode = "STRICT"
      }
    }

    logging {
      access_log {
        file {
          path = "/var/log/access.log"
        }
      }
    }
  }
}

Argument Reference

This resource supports the following arguments:

The spec object supports the following:

The backend_defaults object supports the following:

The client_policy object supports the following:

The tls object supports the following:

The certificate object supports the following:

The file object supports the following:

The sds object supports the following:

The validation object supports the following:

The subject_alternative_names object supports the following:

The match object supports the following:

The trust object supports the following:

The acm object supports the following:

The file object supports the following:

The sds object supports the following:

The listener object supports the following:

The logging object supports the following:

The access_log object supports the following:

The file object supports the following:

The format object supports the following:

The json object supports the following:

The port_mapping object supports the following:

The connection_pool object supports the following:

The grpc connection pool object supports the following:

The http connection pool object supports the following:

The http2 connection pool object supports the following:

The health_check object supports the following:

The tls object supports the following:

The certificate object supports the following:

The acm object supports the following:

The file object supports the following:

The sds object supports the following:

The validation object supports the following:

The subject_alternative_names object supports the following:

The match object supports the following:

The trust object supports the following:

The file object supports the following:

The sds 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 virtual gateway using mesh_name together with the virtual gateway's name. For example:

import {
  to = aws_appmesh_virtual_gateway.example
  id = "mesh/gw1"
}

Using terraform import, import App Mesh virtual gateway using mesh_name together with the virtual gateway's name. For example:

% terraform import aws_appmesh_virtual_gateway.example mesh/gw1