0

I'm trying to implement AppMesh with ECS using terraform. Once I run terraform apply, during creation of aws_appmesh_gateway_route, I'm getting an error saying:

Error: error creating App Mesh gateway route: BadRequestException: VirtualGatewayName must match ^[a-zA-Z0-9-_]+$.

Here is the code block which I'm using:

resource "aws_appmesh_gateway_route" "test" {
  name                 = "test"
  mesh_name            = "test-appmesh"
  virtual_gateway_name = "aws_appmesh_virtual_gateway.test"

  spec {
    http_route {
      action {
        target {
          virtual_service {
            virtual_service_name = "aws_appmesh_virtual_service.servicea"
          }
        }
      }

      match {
        prefix = "/"
      }
    }
  }
β.εηοιτ.βε
  • 33,893
  • 13
  • 69
  • 83
sthx
  • 1
  • 1

1 Answers1

0

You are providing a string to the virtual_gateway_name argument which has a dot:

aws_appmesh_virtual_gateway . test

Just replace the dot with an underline: aws_appmesh_virtual_gateway_test or with something else which adheres to this pattern ^[a-zA-Z0-9-_]+$.

Ervin Szilagyi
  • 14,274
  • 2
  • 25
  • 40