From 9af0a7a7f6107e63a08bdb29757bb2fb2e767641 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Mon, 6 Jan 2025 19:25:39 +0000 Subject: [PATCH] Regenerated Clients --- .../2abc502f83d1403696c46ab180a2825e.json | 8 + .../3d845081a7094df5ace02909965f74f6.json | 8 + .../internal/endpoints/endpoints.go | 12 + service/iotsecuretunneling/endpoints.go | 114 ++ service/iotsecuretunneling/endpoints_test.go | 1344 ++++++++++++++--- service/supplychain/api_op_CreateInstance.go | 6 + .../api_op_DeleteDataLakeDataset.go | 17 +- .../api_op_ListDataLakeDatasets.go | 9 +- service/supplychain/serializers.go | 5 + 9 files changed, 1320 insertions(+), 203 deletions(-) create mode 100644 .changelog/2abc502f83d1403696c46ab180a2825e.json create mode 100644 .changelog/3d845081a7094df5ace02909965f74f6.json diff --git a/.changelog/2abc502f83d1403696c46ab180a2825e.json b/.changelog/2abc502f83d1403696c46ab180a2825e.json new file mode 100644 index 00000000000..359ada7ecc9 --- /dev/null +++ b/.changelog/2abc502f83d1403696c46ab180a2825e.json @@ -0,0 +1,8 @@ +{ + "id": "2abc502f-83d1-4036-96c4-6ab180a2825e", + "type": "feature", + "description": "Adds dualstack endpoint support for IoT Secure Tunneling", + "modules": [ + "service/iotsecuretunneling" + ] +} \ No newline at end of file diff --git a/.changelog/3d845081a7094df5ace02909965f74f6.json b/.changelog/3d845081a7094df5ace02909965f74f6.json new file mode 100644 index 00000000000..60d481549f9 --- /dev/null +++ b/.changelog/3d845081a7094df5ace02909965f74f6.json @@ -0,0 +1,8 @@ +{ + "id": "3d845081-a709-4df5-ace0-2909965f74f6", + "type": "feature", + "description": "Allow vanity DNS domain when creating a new ASC instance", + "modules": [ + "service/supplychain" + ] +} \ No newline at end of file diff --git a/service/iotfleetwise/internal/endpoints/endpoints.go b/service/iotfleetwise/internal/endpoints/endpoints.go index 74e4daff08a..ad1842ecbab 100644 --- a/service/iotfleetwise/internal/endpoints/endpoints.go +++ b/service/iotfleetwise/internal/endpoints/endpoints.go @@ -142,12 +142,24 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + Variant: endpoints.DualStackVariant, + }: {}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + Variant: endpoints.DualStackVariant, + }: {}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.DualStackVariant, + }: {}, }, }, { diff --git a/service/iotsecuretunneling/endpoints.go b/service/iotsecuretunneling/endpoints.go index cb7c65c1224..f3f334df501 100644 --- a/service/iotsecuretunneling/endpoints.go +++ b/service/iotsecuretunneling/endpoints.go @@ -361,6 +361,63 @@ func (r *resolver) ResolveEndpoint( if _UseDualStack == true { if true == _PartitionResult.SupportsFIPS { if true == _PartitionResult.SupportsDualStack { + if "aws" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://api.iot-tunneling-fips.") + out.WriteString(_Region) + out.WriteString(".api.aws") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if "aws-cn" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://api.iot-tunneling-fips.") + out.WriteString(_Region) + out.WriteString(".api.amazonwebservices.com.cn") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if "aws-us-gov" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://api.iot-tunneling-fips.") + out.WriteString(_Region) + out.WriteString(".api.aws") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } uriString := func() string { var out strings.Builder out.WriteString("https://api.tunneling.iot-fips.") @@ -409,6 +466,63 @@ func (r *resolver) ResolveEndpoint( } if _UseDualStack == true { if true == _PartitionResult.SupportsDualStack { + if "aws" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://api.iot-tunneling.") + out.WriteString(_Region) + out.WriteString(".api.aws") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if "aws-cn" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://api.iot-tunneling.") + out.WriteString(_Region) + out.WriteString(".api.amazonwebservices.com.cn") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if "aws-us-gov" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://api.iot-tunneling.") + out.WriteString(_Region) + out.WriteString(".api.aws") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } uriString := func() string { var out strings.Builder out.WriteString("https://api.tunneling.iot.") diff --git a/service/iotsecuretunneling/endpoints_test.go b/service/iotsecuretunneling/endpoints_test.go index e277b9dede4..96f01ddc688 100644 --- a/service/iotsecuretunneling/endpoints_test.go +++ b/service/iotsecuretunneling/endpoints_test.go @@ -51,12 +51,12 @@ func TestEndpointCase0(t *testing.T) { } } -// For region ap-northeast-1 with FIPS disabled and DualStack disabled +// For region ap-east-1 with FIPS disabled and DualStack enabled func TestEndpointCase1(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("ap-northeast-1"), + Region: ptr.String("ap-east-1"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -67,7 +67,7 @@ func TestEndpointCase1(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.ap-northeast-1.amazonaws.com") + uri, _ := url.Parse("https://api.iot-tunneling.ap-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -88,10 +88,10 @@ func TestEndpointCase1(t *testing.T) { } } -// For region ap-northeast-2 with FIPS disabled and DualStack disabled +// For region ap-northeast-1 with FIPS disabled and DualStack disabled func TestEndpointCase2(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("ap-northeast-2"), + Region: ptr.String("ap-northeast-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -104,7 +104,7 @@ func TestEndpointCase2(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.ap-northeast-2.amazonaws.com") + uri, _ := url.Parse("https://api.tunneling.iot.ap-northeast-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -125,12 +125,12 @@ func TestEndpointCase2(t *testing.T) { } } -// For region ap-south-1 with FIPS disabled and DualStack disabled +// For region ap-northeast-1 with FIPS disabled and DualStack enabled func TestEndpointCase3(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("ap-south-1"), + Region: ptr.String("ap-northeast-1"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -141,7 +141,7 @@ func TestEndpointCase3(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.ap-south-1.amazonaws.com") + uri, _ := url.Parse("https://api.iot-tunneling.ap-northeast-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -162,10 +162,10 @@ func TestEndpointCase3(t *testing.T) { } } -// For region ap-southeast-1 with FIPS disabled and DualStack disabled +// For region ap-northeast-2 with FIPS disabled and DualStack disabled func TestEndpointCase4(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("ap-southeast-1"), + Region: ptr.String("ap-northeast-2"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -178,7 +178,7 @@ func TestEndpointCase4(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.ap-southeast-1.amazonaws.com") + uri, _ := url.Parse("https://api.tunneling.iot.ap-northeast-2.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -199,12 +199,12 @@ func TestEndpointCase4(t *testing.T) { } } -// For region ap-southeast-2 with FIPS disabled and DualStack disabled +// For region ap-northeast-2 with FIPS disabled and DualStack enabled func TestEndpointCase5(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("ap-southeast-2"), + Region: ptr.String("ap-northeast-2"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -215,7 +215,7 @@ func TestEndpointCase5(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.ap-southeast-2.amazonaws.com") + uri, _ := url.Parse("https://api.iot-tunneling.ap-northeast-2.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -236,10 +236,10 @@ func TestEndpointCase5(t *testing.T) { } } -// For region ca-central-1 with FIPS disabled and DualStack disabled +// For region ap-south-1 with FIPS disabled and DualStack disabled func TestEndpointCase6(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("ca-central-1"), + Region: ptr.String("ap-south-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -252,7 +252,7 @@ func TestEndpointCase6(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.ca-central-1.amazonaws.com") + uri, _ := url.Parse("https://api.tunneling.iot.ap-south-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -273,12 +273,12 @@ func TestEndpointCase6(t *testing.T) { } } -// For region ca-central-1 with FIPS enabled and DualStack disabled +// For region ap-south-1 with FIPS disabled and DualStack enabled func TestEndpointCase7(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("ca-central-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), + Region: ptr.String("ap-south-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -289,7 +289,7 @@ func TestEndpointCase7(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot-fips.ca-central-1.amazonaws.com") + uri, _ := url.Parse("https://api.iot-tunneling.ap-south-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -310,10 +310,10 @@ func TestEndpointCase7(t *testing.T) { } } -// For region eu-central-1 with FIPS disabled and DualStack disabled +// For region ap-southeast-1 with FIPS disabled and DualStack disabled func TestEndpointCase8(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("eu-central-1"), + Region: ptr.String("ap-southeast-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -326,7 +326,7 @@ func TestEndpointCase8(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.eu-central-1.amazonaws.com") + uri, _ := url.Parse("https://api.tunneling.iot.ap-southeast-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -347,12 +347,12 @@ func TestEndpointCase8(t *testing.T) { } } -// For region eu-north-1 with FIPS disabled and DualStack disabled +// For region ap-southeast-1 with FIPS disabled and DualStack enabled func TestEndpointCase9(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("eu-north-1"), + Region: ptr.String("ap-southeast-1"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -363,7 +363,7 @@ func TestEndpointCase9(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.eu-north-1.amazonaws.com") + uri, _ := url.Parse("https://api.iot-tunneling.ap-southeast-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -384,10 +384,10 @@ func TestEndpointCase9(t *testing.T) { } } -// For region eu-west-1 with FIPS disabled and DualStack disabled +// For region ap-southeast-2 with FIPS disabled and DualStack disabled func TestEndpointCase10(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("eu-west-1"), + Region: ptr.String("ap-southeast-2"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -400,7 +400,7 @@ func TestEndpointCase10(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.eu-west-1.amazonaws.com") + uri, _ := url.Parse("https://api.tunneling.iot.ap-southeast-2.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -421,12 +421,12 @@ func TestEndpointCase10(t *testing.T) { } } -// For region eu-west-2 with FIPS disabled and DualStack disabled +// For region ap-southeast-2 with FIPS disabled and DualStack enabled func TestEndpointCase11(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("eu-west-2"), + Region: ptr.String("ap-southeast-2"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -437,7 +437,7 @@ func TestEndpointCase11(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.eu-west-2.amazonaws.com") + uri, _ := url.Parse("https://api.iot-tunneling.ap-southeast-2.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -458,10 +458,10 @@ func TestEndpointCase11(t *testing.T) { } } -// For region eu-west-3 with FIPS disabled and DualStack disabled +// For region ca-central-1 with FIPS disabled and DualStack disabled func TestEndpointCase12(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("eu-west-3"), + Region: ptr.String("ca-central-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -474,7 +474,7 @@ func TestEndpointCase12(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.eu-west-3.amazonaws.com") + uri, _ := url.Parse("https://api.tunneling.iot.ca-central-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -495,11 +495,11 @@ func TestEndpointCase12(t *testing.T) { } } -// For region me-south-1 with FIPS disabled and DualStack disabled +// For region ca-central-1 with FIPS enabled and DualStack disabled func TestEndpointCase13(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("me-south-1"), - UseFIPS: ptr.Bool(false), + Region: ptr.String("ca-central-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -511,7 +511,7 @@ func TestEndpointCase13(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.me-south-1.amazonaws.com") + uri, _ := url.Parse("https://api.tunneling.iot-fips.ca-central-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -532,12 +532,12 @@ func TestEndpointCase13(t *testing.T) { } } -// For region sa-east-1 with FIPS disabled and DualStack disabled +// For region ca-central-1 with FIPS disabled and DualStack enabled func TestEndpointCase14(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("sa-east-1"), + Region: ptr.String("ca-central-1"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -548,7 +548,7 @@ func TestEndpointCase14(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.sa-east-1.amazonaws.com") + uri, _ := url.Parse("https://api.iot-tunneling.ca-central-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -569,12 +569,12 @@ func TestEndpointCase14(t *testing.T) { } } -// For region us-east-1 with FIPS disabled and DualStack disabled +// For region ca-central-1 with FIPS enabled and DualStack enabled func TestEndpointCase15(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), + Region: ptr.String("ca-central-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -585,7 +585,7 @@ func TestEndpointCase15(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.us-east-1.amazonaws.com") + uri, _ := url.Parse("https://api.iot-tunneling-fips.ca-central-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -606,11 +606,11 @@ func TestEndpointCase15(t *testing.T) { } } -// For region us-east-1 with FIPS enabled and DualStack disabled +// For region eu-central-1 with FIPS disabled and DualStack disabled func TestEndpointCase16(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(true), + Region: ptr.String("eu-central-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -622,7 +622,7 @@ func TestEndpointCase16(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot-fips.us-east-1.amazonaws.com") + uri, _ := url.Parse("https://api.tunneling.iot.eu-central-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -643,12 +643,12 @@ func TestEndpointCase16(t *testing.T) { } } -// For region us-east-2 with FIPS disabled and DualStack disabled +// For region eu-central-1 with FIPS disabled and DualStack enabled func TestEndpointCase17(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-2"), + Region: ptr.String("eu-central-1"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -659,7 +659,7 @@ func TestEndpointCase17(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.us-east-2.amazonaws.com") + uri, _ := url.Parse("https://api.iot-tunneling.eu-central-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -680,11 +680,11 @@ func TestEndpointCase17(t *testing.T) { } } -// For region us-east-2 with FIPS enabled and DualStack disabled +// For region eu-north-1 with FIPS disabled and DualStack disabled func TestEndpointCase18(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-2"), - UseFIPS: ptr.Bool(true), + Region: ptr.String("eu-north-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -696,7 +696,7 @@ func TestEndpointCase18(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot-fips.us-east-2.amazonaws.com") + uri, _ := url.Parse("https://api.tunneling.iot.eu-north-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -717,12 +717,12 @@ func TestEndpointCase18(t *testing.T) { } } -// For region us-west-1 with FIPS disabled and DualStack disabled +// For region eu-north-1 with FIPS disabled and DualStack enabled func TestEndpointCase19(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-west-1"), + Region: ptr.String("eu-north-1"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -733,7 +733,7 @@ func TestEndpointCase19(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.us-west-1.amazonaws.com") + uri, _ := url.Parse("https://api.iot-tunneling.eu-north-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -754,11 +754,11 @@ func TestEndpointCase19(t *testing.T) { } } -// For region us-west-1 with FIPS enabled and DualStack disabled +// For region eu-west-1 with FIPS disabled and DualStack disabled func TestEndpointCase20(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-west-1"), - UseFIPS: ptr.Bool(true), + Region: ptr.String("eu-west-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -770,7 +770,7 @@ func TestEndpointCase20(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot-fips.us-west-1.amazonaws.com") + uri, _ := url.Parse("https://api.tunneling.iot.eu-west-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -791,12 +791,12 @@ func TestEndpointCase20(t *testing.T) { } } -// For region us-west-2 with FIPS disabled and DualStack disabled +// For region eu-west-1 with FIPS disabled and DualStack enabled func TestEndpointCase21(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-west-2"), + Region: ptr.String("eu-west-1"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -807,7 +807,7 @@ func TestEndpointCase21(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.us-west-2.amazonaws.com") + uri, _ := url.Parse("https://api.iot-tunneling.eu-west-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -828,11 +828,11 @@ func TestEndpointCase21(t *testing.T) { } } -// For region us-west-2 with FIPS enabled and DualStack disabled +// For region eu-west-2 with FIPS disabled and DualStack disabled func TestEndpointCase22(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-west-2"), - UseFIPS: ptr.Bool(true), + Region: ptr.String("eu-west-2"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -844,7 +844,7 @@ func TestEndpointCase22(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot-fips.us-west-2.amazonaws.com") + uri, _ := url.Parse("https://api.tunneling.iot.eu-west-2.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -865,11 +865,11 @@ func TestEndpointCase22(t *testing.T) { } } -// For region us-east-1 with FIPS enabled and DualStack enabled +// For region eu-west-2 with FIPS disabled and DualStack enabled func TestEndpointCase23(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(true), + Region: ptr.String("eu-west-2"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), } @@ -881,7 +881,7 @@ func TestEndpointCase23(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot-fips.us-east-1.api.aws") + uri, _ := url.Parse("https://api.iot-tunneling.eu-west-2.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -902,12 +902,12 @@ func TestEndpointCase23(t *testing.T) { } } -// For region us-east-1 with FIPS disabled and DualStack enabled +// For region eu-west-3 with FIPS disabled and DualStack disabled func TestEndpointCase24(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-east-1"), + Region: ptr.String("eu-west-3"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), + UseDualStack: ptr.Bool(false), } resolver := NewDefaultEndpointResolverV2() @@ -918,7 +918,7 @@ func TestEndpointCase24(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.us-east-1.api.aws") + uri, _ := url.Parse("https://api.tunneling.iot.eu-west-3.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -939,12 +939,12 @@ func TestEndpointCase24(t *testing.T) { } } -// For region cn-north-1 with FIPS disabled and DualStack disabled +// For region eu-west-3 with FIPS disabled and DualStack enabled func TestEndpointCase25(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), + Region: ptr.String("eu-west-3"), UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -955,7 +955,7 @@ func TestEndpointCase25(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.cn-north-1.amazonaws.com.cn") + uri, _ := url.Parse("https://api.iot-tunneling.eu-west-3.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -976,10 +976,10 @@ func TestEndpointCase25(t *testing.T) { } } -// For region cn-northwest-1 with FIPS disabled and DualStack disabled +// For region me-central-1 with FIPS disabled and DualStack disabled func TestEndpointCase26(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("cn-northwest-1"), + Region: ptr.String("me-central-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -992,7 +992,7 @@ func TestEndpointCase26(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.cn-northwest-1.amazonaws.com.cn") + uri, _ := url.Parse("https://api.tunneling.iot.me-central-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -1013,11 +1013,11 @@ func TestEndpointCase26(t *testing.T) { } } -// For region cn-north-1 with FIPS enabled and DualStack enabled +// For region me-central-1 with FIPS disabled and DualStack enabled func TestEndpointCase27(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), - UseFIPS: ptr.Bool(true), + Region: ptr.String("me-central-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), } @@ -1029,7 +1029,7 @@ func TestEndpointCase27(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot-fips.cn-north-1.api.amazonwebservices.com.cn") + uri, _ := url.Parse("https://api.iot-tunneling.me-central-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -1050,11 +1050,11 @@ func TestEndpointCase27(t *testing.T) { } } -// For region cn-north-1 with FIPS enabled and DualStack disabled +// For region me-south-1 with FIPS disabled and DualStack disabled func TestEndpointCase28(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), - UseFIPS: ptr.Bool(true), + Region: ptr.String("me-south-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -1066,7 +1066,7 @@ func TestEndpointCase28(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot-fips.cn-north-1.amazonaws.com.cn") + uri, _ := url.Parse("https://api.tunneling.iot.me-south-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -1087,10 +1087,10 @@ func TestEndpointCase28(t *testing.T) { } } -// For region cn-north-1 with FIPS disabled and DualStack enabled +// For region me-south-1 with FIPS disabled and DualStack enabled func TestEndpointCase29(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), + Region: ptr.String("me-south-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), } @@ -1103,7 +1103,7 @@ func TestEndpointCase29(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.cn-north-1.api.amazonwebservices.com.cn") + uri, _ := url.Parse("https://api.iot-tunneling.me-south-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -1124,10 +1124,10 @@ func TestEndpointCase29(t *testing.T) { } } -// For region us-gov-east-1 with FIPS disabled and DualStack disabled +// For region sa-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase30(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), + Region: ptr.String("sa-east-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -1140,7 +1140,7 @@ func TestEndpointCase30(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.us-gov-east-1.amazonaws.com") + uri, _ := url.Parse("https://api.tunneling.iot.sa-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -1161,12 +1161,12 @@ func TestEndpointCase30(t *testing.T) { } } -// For region us-gov-east-1 with FIPS enabled and DualStack disabled +// For region sa-east-1 with FIPS disabled and DualStack enabled func TestEndpointCase31(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), + Region: ptr.String("sa-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), } resolver := NewDefaultEndpointResolverV2() @@ -1177,7 +1177,7 @@ func TestEndpointCase31(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot-fips.us-gov-east-1.amazonaws.com") + uri, _ := url.Parse("https://api.iot-tunneling.sa-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -1198,10 +1198,10 @@ func TestEndpointCase31(t *testing.T) { } } -// For region us-gov-west-1 with FIPS disabled and DualStack disabled +// For region us-east-1 with FIPS disabled and DualStack disabled func TestEndpointCase32(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-gov-west-1"), + Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -1214,7 +1214,7 @@ func TestEndpointCase32(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.us-gov-west-1.amazonaws.com") + uri, _ := url.Parse("https://api.tunneling.iot.us-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -1235,10 +1235,10 @@ func TestEndpointCase32(t *testing.T) { } } -// For region us-gov-west-1 with FIPS enabled and DualStack disabled +// For region us-east-1 with FIPS enabled and DualStack disabled func TestEndpointCase33(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-gov-west-1"), + Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -1251,7 +1251,7 @@ func TestEndpointCase33(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot-fips.us-gov-west-1.amazonaws.com") + uri, _ := url.Parse("https://api.tunneling.iot-fips.us-east-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -1272,11 +1272,11 @@ func TestEndpointCase33(t *testing.T) { } } -// For region us-gov-east-1 with FIPS enabled and DualStack enabled +// For region us-east-1 with FIPS disabled and DualStack enabled func TestEndpointCase34(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseFIPS: ptr.Bool(true), + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), } @@ -1288,7 +1288,7 @@ func TestEndpointCase34(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot-fips.us-gov-east-1.api.aws") + uri, _ := url.Parse("https://api.iot-tunneling.us-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -1309,11 +1309,11 @@ func TestEndpointCase34(t *testing.T) { } } -// For region us-gov-east-1 with FIPS disabled and DualStack enabled +// For region us-east-1 with FIPS enabled and DualStack enabled func TestEndpointCase35(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseFIPS: ptr.Bool(false), + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(true), } @@ -1325,7 +1325,7 @@ func TestEndpointCase35(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.us-gov-east-1.api.aws") + uri, _ := url.Parse("https://api.iot-tunneling-fips.us-east-1.api.aws") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -1346,31 +1346,11 @@ func TestEndpointCase35(t *testing.T) { } } -// For region us-iso-east-1 with FIPS enabled and DualStack enabled +// For region us-east-2 with FIPS disabled and DualStack disabled func TestEndpointCase36(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-iso-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase37(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseFIPS: ptr.Bool(true), + Region: ptr.String("us-east-2"), + UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), } @@ -1382,7 +1362,7 @@ func TestEndpointCase37(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot-fips.us-iso-east-1.c2s.ic.gov") + uri, _ := url.Parse("https://api.tunneling.iot.us-east-2.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -1403,31 +1383,825 @@ func TestEndpointCase37(t *testing.T) { } } -// For region us-iso-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase38(t *testing.T) { +// For region us-east-2 with FIPS enabled and DualStack disabled +func TestEndpointCase37(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } + Region: ptr.String("us-east-2"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.tunneling.iot-fips.us-east-2.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-2 with FIPS disabled and DualStack enabled +func TestEndpointCase38(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-2"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.iot-tunneling.us-east-2.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-2 with FIPS enabled and DualStack enabled +func TestEndpointCase39(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-2"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.iot-tunneling-fips.us-east-2.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-west-1 with FIPS disabled and DualStack disabled +func TestEndpointCase40(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.tunneling.iot.us-west-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-west-1 with FIPS enabled and DualStack disabled +func TestEndpointCase41(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-west-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.tunneling.iot-fips.us-west-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-west-1 with FIPS disabled and DualStack enabled +func TestEndpointCase42(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.iot-tunneling.us-west-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-west-1 with FIPS enabled and DualStack enabled +func TestEndpointCase43(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-west-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.iot-tunneling-fips.us-west-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-west-2 with FIPS disabled and DualStack disabled +func TestEndpointCase44(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-west-2"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.tunneling.iot.us-west-2.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-west-2 with FIPS enabled and DualStack disabled +func TestEndpointCase45(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-west-2"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.tunneling.iot-fips.us-west-2.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-west-2 with FIPS disabled and DualStack enabled +func TestEndpointCase46(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-west-2"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.iot-tunneling.us-west-2.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-west-2 with FIPS enabled and DualStack enabled +func TestEndpointCase47(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-west-2"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.iot-tunneling-fips.us-west-2.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-north-1 with FIPS disabled and DualStack disabled +func TestEndpointCase48(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.tunneling.iot.cn-north-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-north-1 with FIPS disabled and DualStack enabled +func TestEndpointCase49(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.iot-tunneling.cn-north-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-northwest-1 with FIPS disabled and DualStack disabled +func TestEndpointCase50(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.tunneling.iot.cn-northwest-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-northwest-1 with FIPS disabled and DualStack enabled +func TestEndpointCase51(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.iot-tunneling.cn-northwest-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-north-1 with FIPS enabled and DualStack enabled +func TestEndpointCase52(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.iot-tunneling-fips.cn-north-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-north-1 with FIPS enabled and DualStack disabled +func TestEndpointCase53(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-north-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.tunneling.iot-fips.cn-north-1.amazonaws.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase54(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.tunneling.iot.us-gov-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase55(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.tunneling.iot-fips.us-gov-east-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase56(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.iot-tunneling.us-gov-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase57(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.iot-tunneling-fips.us-gov-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-west-1 with FIPS disabled and DualStack disabled +func TestEndpointCase58(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } resolver := NewDefaultEndpointResolverV2() result, err := resolver.ResolveEndpoint(context.Background(), params) _, _ = result, err - if err == nil { - t.Fatalf("expect error, got none") + if err != nil { + t.Fatalf("expect no error, got %v", err) } - if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) + + uri, _ := url.Parse("https://api.tunneling.iot.us-gov-west-1.amazonaws.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) } } -// For region us-iso-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase39(t *testing.T) { +// For region us-gov-west-1 with FIPS enabled and DualStack disabled +func TestEndpointCase59(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseFIPS: ptr.Bool(false), + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -1439,7 +2213,7 @@ func TestEndpointCase39(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot.us-iso-east-1.c2s.ic.gov") + uri, _ := url.Parse("https://api.tunneling.iot-fips.us-gov-west-1.amazonaws.com") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -1460,10 +2234,47 @@ func TestEndpointCase39(t *testing.T) { } } -// For region us-isob-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase40(t *testing.T) { +// For region us-gov-west-1 with FIPS disabled and DualStack enabled +func TestEndpointCase60(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-isob-east-1"), + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.iot-tunneling.us-gov-west-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-west-1 with FIPS enabled and DualStack enabled +func TestEndpointCase61(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-west-1"), UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(true), } @@ -1472,18 +2283,72 @@ func TestEndpointCase40(t *testing.T) { result, err := resolver.ResolveEndpoint(context.Background(), params) _, _ = result, err - if err == nil { - t.Fatalf("expect error, got none") + if err != nil { + t.Fatalf("expect no error, got %v", err) } - if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) + + uri, _ := url.Parse("https://api.iot-tunneling-fips.us-gov-west-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) } } -// For region us-isob-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase41(t *testing.T) { +// For region us-iso-east-1 with FIPS disabled and DualStack disabled +func TestEndpointCase62(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-isob-east-1"), + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.tunneling.iot.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase63(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(true), UseDualStack: ptr.Bool(false), } @@ -1496,7 +2361,7 @@ func TestEndpointCase41(t *testing.T) { t.Fatalf("expect no error, got %v", err) } - uri, _ := url.Parse("https://api.tunneling.iot-fips.us-isob-east-1.sc2s.sgov.gov") + uri, _ := url.Parse("https://api.tunneling.iot-fips.us-iso-east-1.c2s.ic.gov") expectEndpoint := smithyendpoints.Endpoint{ URI: *uri, @@ -1517,10 +2382,30 @@ func TestEndpointCase41(t *testing.T) { } } -// For region us-isob-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase42(t *testing.T) { +// For region us-iso-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase64(t *testing.T) { var params = EndpointParameters{ - Region: ptr.String("us-isob-east-1"), + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase65(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(true), } @@ -1538,7 +2423,7 @@ func TestEndpointCase42(t *testing.T) { } // For region us-isob-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase43(t *testing.T) { +func TestEndpointCase66(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-isob-east-1"), UseFIPS: ptr.Bool(false), @@ -1574,8 +2459,85 @@ func TestEndpointCase43(t *testing.T) { } } +// For region us-isob-east-1 with FIPS enabled and DualStack disabled +func TestEndpointCase67(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://api.tunneling.iot-fips.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase68(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase69(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + UseDualStack: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + // For custom endpoint with region set and fips disabled and dualstack disabled -func TestEndpointCase44(t *testing.T) { +func TestEndpointCase70(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), @@ -1613,7 +2575,7 @@ func TestEndpointCase44(t *testing.T) { } // For custom endpoint with region not set and fips disabled and dualstack disabled -func TestEndpointCase45(t *testing.T) { +func TestEndpointCase71(t *testing.T) { var params = EndpointParameters{ UseFIPS: ptr.Bool(false), UseDualStack: ptr.Bool(false), @@ -1650,7 +2612,7 @@ func TestEndpointCase45(t *testing.T) { } // For custom endpoint with fips enabled and dualstack disabled -func TestEndpointCase46(t *testing.T) { +func TestEndpointCase72(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(true), @@ -1671,7 +2633,7 @@ func TestEndpointCase46(t *testing.T) { } // For custom endpoint with fips disabled and dualstack enabled -func TestEndpointCase47(t *testing.T) { +func TestEndpointCase73(t *testing.T) { var params = EndpointParameters{ Region: ptr.String("us-east-1"), UseFIPS: ptr.Bool(false), @@ -1692,7 +2654,7 @@ func TestEndpointCase47(t *testing.T) { } // Missing region -func TestEndpointCase48(t *testing.T) { +func TestEndpointCase74(t *testing.T) { var params = EndpointParameters{} resolver := NewDefaultEndpointResolverV2() diff --git a/service/supplychain/api_op_CreateInstance.go b/service/supplychain/api_op_CreateInstance.go index 39dc7358f9e..4c94e850552 100644 --- a/service/supplychain/api_op_CreateInstance.go +++ b/service/supplychain/api_op_CreateInstance.go @@ -58,6 +58,12 @@ type CreateInstanceInput struct { // The Amazon Web Services tags of an instance to be created. Tags map[string]string + // The DNS subdomain of the web app. This would be "example" in the URL + // "example.scn.global.on.aws". You can set this to a custom value, as long as the + // domain isn't already being used by someone else. The name may only include + // alphanumeric characters and hyphens. + WebAppDnsDomain *string + noSmithyDocumentSerde } diff --git a/service/supplychain/api_op_DeleteDataLakeDataset.go b/service/supplychain/api_op_DeleteDataLakeDataset.go index 81ac469c5ce..6042d56fadd 100644 --- a/service/supplychain/api_op_DeleteDataLakeDataset.go +++ b/service/supplychain/api_op_DeleteDataLakeDataset.go @@ -36,21 +36,22 @@ type DeleteDataLakeDatasetInput struct { // This member is required. InstanceId *string - // The name of the dataset. If the namespace is asc, the name must be one of the - // supported [data entities]. + // The name of the dataset. For asc name space, the name must be one of the + // supported data entities under [https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/data-model-asc.html]. // - // [data entities]: https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/data-model-asc.html + // [https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/data-model-asc.html]: https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/data-model-asc.html // // This member is required. Name *string - // The namespace of the dataset. The available values are: + // The name space of the dataset. The available values are: // - // - asc: for [AWS Supply Chain supported datasets]. + // - asc - For information on the Amazon Web Services Supply Chain supported + // datasets see [https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/data-model-asc.html]. // - // - default: for datasets with custom user-defined schemas. + // - default - For datasets with custom user-defined schemas. // - // [AWS Supply Chain supported datasets]: https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/data-model-asc.html + // [https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/data-model-asc.html]: https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/data-model-asc.html // // This member is required. Namespace *string @@ -71,7 +72,7 @@ type DeleteDataLakeDatasetOutput struct { // This member is required. Name *string - // The namespace of deleted dataset. + // The name space of deleted dataset. // // This member is required. Namespace *string diff --git a/service/supplychain/api_op_ListDataLakeDatasets.go b/service/supplychain/api_op_ListDataLakeDatasets.go index 05f8adfe9a5..a6330c3fbb5 100644 --- a/service/supplychain/api_op_ListDataLakeDatasets.go +++ b/service/supplychain/api_op_ListDataLakeDatasets.go @@ -38,13 +38,14 @@ type ListDataLakeDatasetsInput struct { // This member is required. InstanceId *string - // The namespace of the dataset. The available values are: + // The name space of the dataset. The available values are: // - // - asc: for [AWS Supply Chain supported datasets]. + // - asc - For information on the Amazon Web Services Supply Chain supported + // datasets see [https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/data-model-asc.html]. // - // - default: for datasets with custom user-defined schemas. + // - default - For datasets with custom user-defined schemas. // - // [AWS Supply Chain supported datasets]: https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/data-model-asc.html + // [https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/data-model-asc.html]: https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/data-model-asc.html // // This member is required. Namespace *string diff --git a/service/supplychain/serializers.go b/service/supplychain/serializers.go index 765e82ac0ac..b41776120a6 100644 --- a/service/supplychain/serializers.go +++ b/service/supplychain/serializers.go @@ -467,6 +467,11 @@ func awsRestjson1_serializeOpDocumentCreateInstanceInput(v *CreateInstanceInput, } } + if v.WebAppDnsDomain != nil { + ok := object.Key("webAppDnsDomain") + ok.String(*v.WebAppDnsDomain) + } + return nil }