-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathvirtual_route.tf
35 lines (29 loc) · 932 Bytes
/
virtual_route.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
variable "virtual_route_http_virtual_router_name" {
type = "string"
default = ""
}
variable "virtual_route_http_match_prefix" {
type = "string"
default = "/"
}
variable "virtual_route_http_weighted_targets" {
type = "list"
default = []
}
resource "aws_appmesh_route" "default" {
count = "${var.virtual_route_http_virtual_router_name != "" ? 1 : 0}"
name = "${format("%s%sroute", var.virtual_route_http_virtual_router_name, module.label.delimiter)}"
mesh_name = "${local.app_mesh_id}"
virtual_router_name = "${var.virtual_route_http_virtual_router_name}"
spec {
http_route {
match {
prefix = "${var.virtual_route_http_match_prefix}"
}
action {
weighted_target = ["${var.virtual_route_http_weighted_targets}"]
}
}
}
depends_on = ["aws_appmesh_virtual_service.router", "aws_appmesh_virtual_service.node"]
}