» Resource: aws_appmesh_virtual_router
Provides an AWS App Mesh virtual router resource.
» Breaking Changes
Because of backward incompatible API changes (read here and here), aws_appmesh_virtual_router
resource definitions created with provider versions earlier than v2.3.0 will need to be modified:
-
Remove service
service_names
from thespec
argument. AWS has created aaws_appmesh_virtual_service
resource for each of service names. These resource can be imported usingterraform import
. -
Add a
listener
configuration block to thespec
argument.
The Terraform state associated with existing resources will automatically be migrated.
» Example Usage
resource "aws_appmesh_virtual_router" "serviceb" {
name = "serviceB"
mesh_name = "${aws_appmesh_mesh.simple.id}"
spec {
listener {
port_mapping {
port = 8080
protocol = "http"
}
}
}
}
» Argument Reference
The following arguments are supported:
-
name
- (Required) The name to use for the virtual router. -
mesh_name
- (Required) The name of the service mesh in which to create the virtual router. -
spec
- (Required) The virtual router specification to apply.
The spec
object supports the following:
-
listener
- (Required) The listeners that the virtual router is expected to receive inbound traffic from. Currently only one listener is supported per virtual router.
The listener
object supports the following:
-
port_mapping
- (Required) The port mapping information for the listener.
The port_mapping
object supports the following:
-
port
- (Required) The port used for the port mapping. -
protocol
- (Required) The protocol used for the port mapping. Valid values arehttp
andtcp
.
» Attributes Reference
In addition to all arguments above, the following attributes are exported:
-
id
- The ID of the virtual router. -
arn
- The ARN of the virtual router. -
created_date
- The creation date of the virtual router. -
last_updated_date
- The last update date of the virtual router.
» Import
App Mesh virtual routers can be imported using mesh_name
together with the virtual router's name
,
e.g.
$ terraform import aws_appmesh_virtual_router.serviceb simpleapp/serviceB