Skip to content

Commit

Permalink
r/aws_appmesh_gateway_route: New resource.
Browse files Browse the repository at this point in the history
Acceptance test output:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSAppmesh/GatewayRoute'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAppmesh/GatewayRoute -timeout 120m
=== RUN   TestAccAWSAppmesh_serial
=== RUN   TestAccAWSAppmesh_serial/GatewayRoute
=== RUN   TestAccAWSAppmesh_serial/GatewayRoute/httpRoute
=== RUN   TestAccAWSAppmesh_serial/GatewayRoute/http2Route
=== RUN   TestAccAWSAppmesh_serial/GatewayRoute/tags
=== RUN   TestAccAWSAppmesh_serial/GatewayRoute/basic
=== RUN   TestAccAWSAppmesh_serial/GatewayRoute/disappears
=== RUN   TestAccAWSAppmesh_serial/GatewayRoute/grpcRoute
--- PASS: TestAccAWSAppmesh_serial (217.76s)
    --- PASS: TestAccAWSAppmesh_serial/GatewayRoute (217.76s)
        --- PASS: TestAccAWSAppmesh_serial/GatewayRoute/httpRoute (39.85s)
        --- PASS: TestAccAWSAppmesh_serial/GatewayRoute/http2Route (39.84s)
        --- PASS: TestAccAWSAppmesh_serial/GatewayRoute/tags (56.42s)
        --- PASS: TestAccAWSAppmesh_serial/GatewayRoute/basic (22.75s)
        --- PASS: TestAccAWSAppmesh_serial/GatewayRoute/disappears (18.64s)
        --- PASS: TestAccAWSAppmesh_serial/GatewayRoute/grpcRoute (40.27s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	217.848s
  • Loading branch information
ewbankkit committed Oct 14, 2020
1 parent 7b59a6b commit b2b5e4a
Show file tree
Hide file tree
Showing 8 changed files with 1,536 additions and 6 deletions.
24 changes: 24 additions & 0 deletions aws/internal/service/appmesh/finder/finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,30 @@ import (
"github.com/aws/aws-sdk-go/service/appmesh"
)

// GatewayRoute returns the gateway route corresponding to the specified mesh name, virtual gateway name, gateway route name and optional mesh owner.
// Returns an error if no gateway route is found.
func GatewayRoute(conn *appmesh.AppMesh, meshName, virtualGatewayName, gatewayRouteName, meshOwner string) (*appmesh.GatewayRouteData, error) {
input := &appmesh.DescribeGatewayRouteInput{
GatewayRouteName: aws.String(gatewayRouteName),
MeshName: aws.String(meshName),
VirtualGatewayName: aws.String(virtualGatewayName),
}
if meshOwner != "" {
input.MeshOwner = aws.String(meshOwner)
}

output, err := conn.DescribeGatewayRoute(input)
if err != nil {
return nil, err
}

if output == nil {
return nil, nil
}

return output.GatewayRoute, nil
}

// VirtualGateway returns the virtual gateway corresponding to the specified mesh name, virtual gateway name and optional mesh owner.
// Returns an error if no virtual gateway is found.
func VirtualGateway(conn *appmesh.AppMesh, meshName, virtualGatewayName, meshOwner string) (*appmesh.VirtualGatewayData, error) {
Expand Down
1 change: 1 addition & 0 deletions aws/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ func Provider() *schema.Provider {
"aws_appautoscaling_target": resourceAwsAppautoscalingTarget(),
"aws_appautoscaling_policy": resourceAwsAppautoscalingPolicy(),
"aws_appautoscaling_scheduled_action": resourceAwsAppautoscalingScheduledAction(),
"aws_appmesh_gateway_route": resourceAwsAppmeshGatewayRoute(),
"aws_appmesh_mesh": resourceAwsAppmeshMesh(),
"aws_appmesh_route": resourceAwsAppmeshRoute(),
"aws_appmesh_virtual_gateway": resourceAwsAppmeshVirtualGateway(),
Expand Down
Loading

0 comments on commit b2b5e4a

Please sign in to comment.