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_virtual_gateway: New resource #15611

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
29 changes: 29 additions & 0 deletions aws/internal/service/appmesh/finder/finder.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package finder

import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/appmesh"
)

// 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) {
input := &appmesh.DescribeVirtualGatewayInput{
MeshName: aws.String(meshName),
VirtualGatewayName: aws.String(virtualGatewayName),
}
if meshOwner != "" {
input.MeshOwner = aws.String(meshOwner)
}

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

if output == nil {
return nil, nil
}

return output.VirtualGateway, nil
}
1 change: 1 addition & 0 deletions aws/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ func Provider() *schema.Provider {
"aws_appautoscaling_scheduled_action": resourceAwsAppautoscalingScheduledAction(),
"aws_appmesh_mesh": resourceAwsAppmeshMesh(),
"aws_appmesh_route": resourceAwsAppmeshRoute(),
"aws_appmesh_virtual_gateway": resourceAwsAppmeshVirtualGateway(),
"aws_appmesh_virtual_node": resourceAwsAppmeshVirtualNode(),
"aws_appmesh_virtual_router": resourceAwsAppmeshVirtualRouter(),
"aws_appmesh_virtual_service": resourceAwsAppmeshVirtualService(),
Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_appmesh_mesh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func init() {
"aws_appmesh_virtual_service",
"aws_appmesh_virtual_router",
"aws_appmesh_virtual_node",
"aws_appmesh_virtual_gateway",
},
})
}
Expand Down
9 changes: 9 additions & 0 deletions aws/resource_aws_appmesh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ func TestAccAWSAppmesh_serial(t *testing.T) {
"tcpRouteTimeout": testAccAwsAppmeshRoute_tcpRouteTimeout,
"tags": testAccAwsAppmeshRoute_tags,
},
"VirtualGateway": {
"backendDefaults": testAccAwsAppmeshVirtualGateway_BackendDefaults,
"basic": testAccAwsAppmeshVirtualGateway_basic,
"disappears": testAccAwsAppmeshVirtualGateway_disappears,
"listenerHealthChecks": testAccAwsAppmeshVirtualGateway_ListenerHealthChecks,
"logging": testAccAwsAppmeshVirtualGateway_Logging,
"tags": testAccAwsAppmeshVirtualGateway_Tags,
"tls": testAccAwsAppmeshVirtualGateway_TLS,
},
"VirtualNode": {
"basic": testAccAwsAppmeshVirtualNode_basic,
"backendDefaults": testAccAwsAppmeshVirtualNode_backendDefaults,
Expand Down
Loading