Resource: aws_appmesh_virtual_service

Provides an AWS App Mesh virtual service resource.

Example Usage

Virtual Node Provider

resource "aws_appmesh_virtual_service" "servicea" {
  name      = "servicea.simpleapp.local"
  mesh_name = aws_appmesh_mesh.simple.id

  spec {
    provider {
      virtual_node {
        virtual_node_name = aws_appmesh_virtual_node.serviceb1.name
      }
    }
  }
}

Virtual Router Provider

resource "aws_appmesh_virtual_service" "servicea" {
  name      = "servicea.simpleapp.local"
  mesh_name = aws_appmesh_mesh.simple.id

  spec {
    provider {
      virtual_router {
        virtual_router_name = aws_appmesh_virtual_router.serviceb.name
      }
    }
  }
}

Argument Reference

This resource supports the following arguments:

The spec object supports the following:

The provider object supports the following:

The virtual_node object supports the following:

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

import {
  to = aws_appmesh_virtual_service.servicea
  id = "simpleapp/servicea.simpleapp.local"
}

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

% terraform import aws_appmesh_virtual_service.servicea simpleapp/servicea.simpleapp.local