Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r/aws_appmesh_gateway_route: New resource #15638

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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