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

Add App Mesh Virtual Gateway Target Ports #29064

Merged
merged 38 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
45ae3ac
Tests for gateway route target port
benmurden Jan 24, 2023
eacf2e3
Implement Gateway Route taget port
benmurden Jan 24, 2023
c4bc856
Fix test HCL indentations
benmurden Jan 24, 2023
43916a5
Add changelog text
benmurden Jan 24, 2023
c27f7f3
Update documentation for target port
benmurden Jan 24, 2023
3f8be7d
Creating Appmesh Virtual Router Data Source
alowder94 Feb 6, 2023
cf6ae24
Adding Changelog
alowder94 Feb 7, 2023
3a181ad
Updates to pass linting and fmt testing
alowder94 Feb 9, 2023
aefe8b4
Merge commit '3a181ad6d3977502734f83f9464bbc7dfb64412d' into HEAD
ewbankkit Mar 24, 2023
33195b1
Merge branch 'main' into HEAD
ewbankkit Mar 24, 2023
1ae3d0f
r/aws_appmesh_virtual_router: Alphabetize attributes.
ewbankkit Mar 24, 2023
fd47b31
r/aws_appmesh_virtual_router: Tidy up resource Create, Update and Del…
ewbankkit Mar 24, 2023
4c25fde
r/aws_appmesh_virtual_router: Tidy up resource Read.
ewbankkit Mar 24, 2023
b71b24b
r/aws_appmesh_virtual_router: Tidy up acceptance tests.
ewbankkit Mar 24, 2023
904192a
Correct CHANGELOG entry.
ewbankkit Mar 24, 2023
5b24de5
Use 'resource.ComposeAggregateTestCheckFunc'.
ewbankkit Mar 24, 2023
8224a2f
d/aws_appmesh_virtual_router: Tidy up.
ewbankkit Mar 24, 2023
e188203
d/aws_appmesh_virtual_router: Update documentation.
ewbankkit Mar 24, 2023
4582bee
r/aws_appmesh_gateway_route: Alphabetize attributes.
ewbankkit Mar 24, 2023
16f919b
r/aws_appmesh_gateway_route: Tidy up resource Create, Update and Delete.
ewbankkit Mar 24, 2023
01e67d4
r/aws_appmesh_gateway_route: Tidy up resource Read.
ewbankkit Mar 24, 2023
af8869f
r/aws_appmesh_gateway_route: Tidy up acceptance tests.
ewbankkit Mar 24, 2023
83635c4
d/aws_appmesh_route: Cosmetics.
ewbankkit Mar 24, 2023
c9098e3
d/aws_appmesh_gateway_route: New data source.
ewbankkit Mar 24, 2023
360df73
Tweak CHANGELOG entry.
ewbankkit Mar 24, 2023
22ed632
Acceptance test output:
ewbankkit Mar 24, 2023
e2e43c3
Fix terrafmt error.
ewbankkit Mar 24, 2023
73912de
Fix terrafmt error in documentation.
ewbankkit Mar 24, 2023
126c4bf
r/aws_appmesh_gateway_route: Add 'spec.priority'.
ewbankkit Mar 24, 2023
14f7eec
r/aws_appmesh_virtual_node: Add 'spec.service_discovery.dns.ip_prefer…
ewbankkit Mar 24, 2023
5199edf
r/aws_appmesh_route: Add 'spec.http_route.match.query_parameter' and …
ewbankkit Mar 25, 2023
91bda96
r/aws_appmesh_route: Add 'spec.http_route.match.path' and 'spec.http2…
ewbankkit Mar 25, 2023
7a4af68
Fix terrafmt error.
ewbankkit Mar 25, 2023
2c077b3
r/aws_appmesh_gateway_route: Dedup 'spec.http_route' and 'spec.http2_…
ewbankkit Mar 25, 2023
5803045
r/aws_appmesh_gateway_route: Add 'header' to the 'spec.http_route.mat…
ewbankkit Mar 25, 2023
3f8b5d0
r/aws_appmesh_gateway_route: Add 'path' to the 'spec.http_route.match…
ewbankkit Mar 25, 2023
745692d
r/aws_appmesh_gateway_route: Add 'query_parameter' to the 'spec.http_…
ewbankkit Mar 25, 2023
cec988d
r/aws_appmesh_virtual_router: 'spec.listener' is Optional.
ewbankkit Mar 25, 2023
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
3 changes: 3 additions & 0 deletions .changelog/29064.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/aws_appmesh_gateway_route: Add `port` to `target` block in order to support Virtual Services with multiple listeners.
```
21 changes: 12 additions & 9 deletions internal/service/appmesh/appmesh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ func TestAccAppMesh_serial(t *testing.T) {

testCases := map[string]map[string]func(t *testing.T){
"GatewayRoute": {
"basic": testAccGatewayRoute_basic,
"disappears": testAccGatewayRoute_disappears,
"grpcRoute": testAccGatewayRoute_GRPCRoute,
"grpcRouteWithPort": testAccGatewayRoute_GRPCRouteWithPort,
"httpRoute": testAccGatewayRoute_HTTPRoute,
"httpRouteWithPort": testAccGatewayRoute_HTTPRouteWithPort,
"http2Route": testAccGatewayRoute_HTTP2Route,
"http2RouteWithPort": testAccGatewayRoute_HTTP2RouteWithPort,
"tags": testAccGatewayRoute_Tags,
"basic": testAccGatewayRoute_basic,
"disappears": testAccGatewayRoute_disappears,
"grpcRoute": testAccGatewayRoute_GRPCRoute,
"grpcRouteTargetPort": testAccGatewayRoute_GRPCRouteTargetPort,
"grpcRouteWithPort": testAccGatewayRoute_GRPCRouteWithPort,
"httpRoute": testAccGatewayRoute_HTTPRoute,
"httpRouteTargetPort": testAccGatewayRoute_HTTPRouteTargetPort,
"httpRouteWithPort": testAccGatewayRoute_HTTPRouteWithPort,
"http2Route": testAccGatewayRoute_HTTP2Route,
"http2RouteTargetPort": testAccGatewayRoute_HTTP2RouteTargetPort,
"http2RouteWithPort": testAccGatewayRoute_HTTP2RouteWithPort,
"tags": testAccGatewayRoute_Tags,
},
"Mesh": {
"basic": testAccMesh_basic,
Expand Down
23 changes: 22 additions & 1 deletion internal/service/appmesh/gateway_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ func ResourceGatewayRoute() *schema.Resource {
},
},
},
"port": {
Type: schema.TypeInt,
Optional: true,
ValidateFunc: validation.IsPortNumber,
},
},
},
},
Expand Down Expand Up @@ -176,6 +181,11 @@ func ResourceGatewayRoute() *schema.Resource {
},
},
},
"port": {
Type: schema.TypeInt,
Optional: true,
ValidateFunc: validation.IsPortNumber,
},
},
},
},
Expand Down Expand Up @@ -343,6 +353,11 @@ func ResourceGatewayRoute() *schema.Resource {
},
},
},
"port": {
Type: schema.TypeInt,
Optional: true,
ValidateFunc: validation.IsPortNumber,
},
},
},
},
Expand Down Expand Up @@ -755,6 +770,10 @@ func expandGatewayRouteTarget(vRouteTarget []interface{}) *appmesh.GatewayRouteT
routeTarget.VirtualService = virtualService
}

if vPort, ok := mRouteTarget["port"].(int); ok && vPort > 0 {
routeTarget.Port = aws.Int64(int64(vPort))
}

return routeTarget
}

Expand Down Expand Up @@ -914,7 +933,9 @@ func flattenGatewayRouteTarget(routeTarget *appmesh.GatewayRouteTarget) []interf
return []interface{}{}
}

mRouteTarget := map[string]interface{}{}
mRouteTarget := map[string]interface{}{
"port": int(aws.Int64Value(routeTarget.Port)),
}

if virtualService := routeTarget.VirtualService; virtualService != nil {
mVirtualService := map[string]interface{}{
Expand Down
Loading