Implements a retry policy for HTTP routing in AWS App Mesh, handling retries and timeouts for Service B.

Terraform Template

resource "aws_appmesh_route" "serviceb" {
  mesh_name = "aws_appmesh_mesh.simple.id"
  name = "serviceB-route"

  spec {

    http_route {

      action {

        weighted_target {
          virtual_node = "aws_appmesh_virtual_node.serviceb.name"
          weight = 100
        }
      }

      match {
        prefix = /
      }

      retry_policy {
        http_retry_events = "server-error"
        max_retries = "1"
        per_retry_timeout = "[object Object]"
      }
    }
  }
  virtual_router_name = "aws_appmesh_virtual_router.serviceb.name"
}