Skip to content

Commit

Permalink
Merge pull request #15611 from ewbankkit/f-aws_appmesh_virtual_gateway
Browse files Browse the repository at this point in the history
r/aws_appmesh_virtual_gateway: New resource
  • Loading branch information
breathingdust authored Oct 14, 2020
2 parents 0f7fa05 + 47fda72 commit a5f58ee
Show file tree
Hide file tree
Showing 7 changed files with 2,060 additions and 0 deletions.
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

0 comments on commit a5f58ee

Please sign in to comment.