chore(aws): upgrade aws dependencies
This commit is contained in:
2
vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/doc.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/doc.go
generated
vendored
@ -20,7 +20,7 @@ false. This flag will be ignored if `UseAccelerate` option is set to true.
|
||||
|
||||
If UseAccelerate is not enabled, and the bucket name is not a valid hostname
|
||||
label, they SDK will fallback to forcing the request to be made as if
|
||||
UsePathStyle was enabled. This behavior is also used if UseDualStack is enabled.
|
||||
UsePathStyle was enabled. This behavior is also used if UseDualStackEndpoint is enabled.
|
||||
|
||||
https://docs.aws.amazon.com/AmazonS3/latest/dev/dual-stack-endpoints.html#dual-stack-endpoints-description
|
||||
|
||||
|
@ -32,9 +32,6 @@ type processARNResource struct {
|
||||
// UseAccelerate indicates if s3 transfer acceleration is enabled
|
||||
UseAccelerate bool
|
||||
|
||||
// UseDualstack instructs if s3 dualstack endpoint config is enabled
|
||||
UseDualstack bool
|
||||
|
||||
// EndpointResolver used to resolve endpoints. This may be a custom endpoint resolver
|
||||
EndpointResolver EndpointResolver
|
||||
|
||||
@ -74,6 +71,7 @@ func (m *processARNResource) HandleSerialize(
|
||||
resourceRequest := s3shared.ResourceRequest{
|
||||
Resource: resource,
|
||||
UseARNRegion: m.UseARNRegion,
|
||||
UseFIPS: m.EndpointResolverOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled,
|
||||
RequestRegion: awsmiddleware.GetRegion(ctx),
|
||||
SigningRegion: awsmiddleware.GetSigningRegion(ctx),
|
||||
PartitionID: awsmiddleware.GetPartitionID(ctx),
|
||||
@ -98,7 +96,7 @@ func (m *processARNResource) HandleSerialize(
|
||||
}
|
||||
|
||||
// Do not allow dual-stack configuration with multi-region arns.
|
||||
if m.UseDualstack {
|
||||
if m.EndpointResolverOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled {
|
||||
return out, metadata, s3shared.NewClientConfiguredForDualStackError(tv,
|
||||
resourceRequest.PartitionID, resourceRequest.RequestRegion, nil)
|
||||
}
|
||||
@ -113,28 +111,10 @@ func (m *processARNResource) HandleSerialize(
|
||||
// fetch arn region to resolve request
|
||||
resolveRegion := tv.Region
|
||||
// check if request region is FIPS
|
||||
if resourceRequest.UseFips() {
|
||||
if resourceRequest.UseFIPS && len(resolveRegion) == 0 {
|
||||
// Do not allow Fips support within multi-region arns.
|
||||
if len(resolveRegion) == 0 {
|
||||
return out, metadata, s3shared.NewClientConfiguredForFIPSError(
|
||||
tv, resourceRequest.PartitionID, resourceRequest.RequestRegion, nil)
|
||||
}
|
||||
|
||||
// if use arn region is enabled and request signing region is not same as arn region
|
||||
if m.UseARNRegion && resourceRequest.IsCrossRegion() {
|
||||
// FIPS with cross region is not supported, the SDK must fail
|
||||
// because there is no well defined method for SDK to construct a
|
||||
// correct FIPS endpoint.
|
||||
return out, metadata,
|
||||
s3shared.NewClientConfiguredForCrossRegionFIPSError(
|
||||
tv,
|
||||
resourceRequest.PartitionID,
|
||||
resourceRequest.RequestRegion,
|
||||
nil,
|
||||
)
|
||||
}
|
||||
// if use arn region is NOT set, we should use the request region
|
||||
resolveRegion = resourceRequest.RequestRegion
|
||||
return out, metadata, s3shared.NewClientConfiguredForFIPSError(
|
||||
tv, resourceRequest.PartitionID, resourceRequest.RequestRegion, nil)
|
||||
}
|
||||
|
||||
var requestBuilder func(context.Context, accesspointOptions) (context.Context, error)
|
||||
@ -170,7 +150,7 @@ func (m *processARNResource) HandleSerialize(
|
||||
}
|
||||
|
||||
// check if dualstack
|
||||
if m.UseDualstack {
|
||||
if m.EndpointResolverOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled {
|
||||
return out, metadata, s3shared.NewClientConfiguredForDualStackError(tv,
|
||||
resourceRequest.PartitionID, resourceRequest.RequestRegion, nil)
|
||||
}
|
||||
@ -178,25 +158,6 @@ func (m *processARNResource) HandleSerialize(
|
||||
// fetch arn region to resolve request
|
||||
resolveRegion := tv.Region
|
||||
|
||||
if resourceRequest.UseFips() {
|
||||
// if use arn region is enabled and request signing region is not same as arn region
|
||||
if m.UseARNRegion && resourceRequest.IsCrossRegion() {
|
||||
// FIPS with cross region is not supported, the SDK must fail
|
||||
// because there is no well defined method for SDK to construct a
|
||||
// correct FIPS endpoint.
|
||||
return out, metadata,
|
||||
s3shared.NewClientConfiguredForCrossRegionFIPSError(
|
||||
tv,
|
||||
resourceRequest.PartitionID,
|
||||
resourceRequest.RequestRegion,
|
||||
nil,
|
||||
)
|
||||
}
|
||||
|
||||
// if use arn region is NOT set, we should use the request region
|
||||
resolveRegion = resourceRequest.RequestRegion
|
||||
}
|
||||
|
||||
// build access point request
|
||||
ctx, err = buildS3ObjectLambdaAccessPointRequest(ctx, accesspointOptions{
|
||||
processARNResource: *m,
|
||||
@ -224,13 +185,13 @@ func (m *processARNResource) HandleSerialize(
|
||||
}
|
||||
|
||||
// check if dual stack
|
||||
if m.UseDualstack {
|
||||
if m.EndpointResolverOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled {
|
||||
return out, metadata, s3shared.NewClientConfiguredForDualStackError(tv,
|
||||
resourceRequest.PartitionID, resourceRequest.RequestRegion, nil)
|
||||
}
|
||||
|
||||
// check if request region is FIPS
|
||||
if resourceRequest.UseFips() {
|
||||
if resourceRequest.UseFIPS {
|
||||
return out, metadata, s3shared.NewFIPSConfigurationError(tv, resourceRequest.PartitionID,
|
||||
resourceRequest.RequestRegion, nil)
|
||||
}
|
||||
@ -295,8 +256,12 @@ func buildAccessPointRequest(ctx context.Context, options accesspointOptions) (c
|
||||
|
||||
resolveService := tv.Service
|
||||
|
||||
ero := options.EndpointResolverOptions
|
||||
ero.Logger = middleware.GetLogger(ctx)
|
||||
ero.ResolvedRegion = "" // clear endpoint option's resolved region so that we resolve using the passed in region
|
||||
|
||||
// resolve endpoint
|
||||
endpoint, err := options.EndpointResolver.ResolveEndpoint(resolveRegion, options.EndpointResolverOptions)
|
||||
endpoint, err := options.EndpointResolver.ResolveEndpoint(resolveRegion, ero)
|
||||
if err != nil {
|
||||
return ctx, s3shared.NewFailedToResolveEndpointError(
|
||||
tv,
|
||||
@ -356,8 +321,12 @@ func buildS3ObjectLambdaAccessPointRequest(ctx context.Context, options accesspo
|
||||
|
||||
resolveService := tv.Service
|
||||
|
||||
ero := options.EndpointResolverOptions
|
||||
ero.Logger = middleware.GetLogger(ctx)
|
||||
ero.ResolvedRegion = "" // clear endpoint options resolved region so we resolve the passed in region
|
||||
|
||||
// resolve endpoint
|
||||
endpoint, err := options.EndpointResolver.ResolveEndpoint(resolveRegion, options.EndpointResolverOptions)
|
||||
endpoint, err := options.EndpointResolver.ResolveEndpoint(resolveRegion, ero)
|
||||
if err != nil {
|
||||
return ctx, s3shared.NewFailedToResolveEndpointError(
|
||||
tv,
|
||||
@ -423,7 +392,10 @@ func buildMultiRegionAccessPointsRequest(ctx context.Context, options accesspoin
|
||||
arnPartition := tv.Partition
|
||||
|
||||
// resolve endpoint
|
||||
endpoint, err := options.EndpointResolver.ResolveEndpoint(resolveRegion, options.EndpointResolverOptions)
|
||||
ero := options.EndpointResolverOptions
|
||||
ero.Logger = middleware.GetLogger(ctx)
|
||||
|
||||
endpoint, err := options.EndpointResolver.ResolveEndpoint(resolveRegion, ero)
|
||||
if err != nil {
|
||||
return ctx, s3shared.NewFailedToResolveEndpointError(
|
||||
tv,
|
||||
@ -451,7 +423,7 @@ func buildMultiRegionAccessPointsRequest(ctx context.Context, options accesspoin
|
||||
|
||||
// modify endpoint host to use s3-global host prefix
|
||||
scheme := strings.SplitN(endpoint.URL, "://", 2)
|
||||
dnsSuffix, err := endpoints.GetDNSSuffix(arnPartition)
|
||||
dnsSuffix, err := endpoints.GetDNSSuffix(arnPartition, ero)
|
||||
if err != nil {
|
||||
return ctx, fmt.Errorf("Error determining dns suffix from arn partition, %w", err)
|
||||
}
|
||||
@ -525,8 +497,12 @@ func buildOutpostAccessPointRequest(ctx context.Context, options outpostAccessPo
|
||||
endpointsID = "s3"
|
||||
}
|
||||
|
||||
ero := options.EndpointResolverOptions
|
||||
ero.Logger = middleware.GetLogger(ctx)
|
||||
ero.ResolvedRegion = ""
|
||||
|
||||
// resolve regional endpoint for resolved region.
|
||||
endpoint, err := options.EndpointResolver.ResolveEndpoint(resolveRegion, options.EndpointResolverOptions)
|
||||
endpoint, err := options.EndpointResolver.ResolveEndpoint(resolveRegion, ero)
|
||||
if err != nil {
|
||||
return ctx, s3shared.NewFailedToResolveEndpointError(
|
||||
tv,
|
||||
|
@ -14,9 +14,6 @@ type s3ObjectLambdaEndpoint struct {
|
||||
// whether the operation should use the s3-object-lambda endpoint
|
||||
UseEndpoint bool
|
||||
|
||||
// use dualstack
|
||||
UseDualstack bool
|
||||
|
||||
// use transfer acceleration
|
||||
UseAccelerate bool
|
||||
|
||||
@ -42,7 +39,7 @@ func (t *s3ObjectLambdaEndpoint) HandleSerialize(
|
||||
return out, metadata, fmt.Errorf("unknown transport type: %T", in.Request)
|
||||
}
|
||||
|
||||
if t.UseDualstack {
|
||||
if t.EndpointResolverOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled {
|
||||
return out, metadata, fmt.Errorf("client configured for dualstack but not supported for operation")
|
||||
}
|
||||
|
||||
@ -52,7 +49,9 @@ func (t *s3ObjectLambdaEndpoint) HandleSerialize(
|
||||
|
||||
region := awsmiddleware.GetRegion(ctx)
|
||||
|
||||
endpoint, err := t.EndpointResolver.ResolveEndpoint(region, t.EndpointResolverOptions)
|
||||
ero := t.EndpointResolverOptions
|
||||
|
||||
endpoint, err := t.EndpointResolver.ResolveEndpoint(region, ero)
|
||||
if err != nil {
|
||||
return out, metadata, err
|
||||
}
|
||||
|
@ -3,19 +3,17 @@ package customizations
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/aws/smithy-go/encoding/httpbinding"
|
||||
"log"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/aws-sdk-go-v2/service/internal/s3shared"
|
||||
|
||||
internalendpoints "github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints"
|
||||
"github.com/aws/smithy-go/encoding/httpbinding"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
|
||||
// EndpointResolver interface for resolving service endpoints.
|
||||
@ -50,9 +48,6 @@ type UpdateEndpointOptions struct {
|
||||
// indicates if an operation supports s3 transfer acceleration.
|
||||
SupportsAccelerate bool
|
||||
|
||||
// use dualstack
|
||||
UseDualstack bool
|
||||
|
||||
// use ARN region
|
||||
UseARNRegion bool
|
||||
|
||||
@ -72,6 +67,8 @@ type UpdateEndpointOptions struct {
|
||||
|
||||
// UpdateEndpoint adds the middleware to the middleware stack based on the UpdateEndpointOptions.
|
||||
func UpdateEndpoint(stack *middleware.Stack, options UpdateEndpointOptions) (err error) {
|
||||
const serializerID = "OperationSerializer"
|
||||
|
||||
// initial arn look up middleware
|
||||
err = stack.Initialize.Add(&s3shared.ARNLookup{
|
||||
GetARNValue: options.Accessor.GetBucketFromInput,
|
||||
@ -84,11 +81,10 @@ func UpdateEndpoint(stack *middleware.Stack, options UpdateEndpointOptions) (err
|
||||
err = stack.Serialize.Insert(&processARNResource{
|
||||
UseARNRegion: options.UseARNRegion,
|
||||
UseAccelerate: options.UseAccelerate,
|
||||
UseDualstack: options.UseDualstack,
|
||||
EndpointResolver: options.EndpointResolver,
|
||||
EndpointResolverOptions: options.EndpointResolverOptions,
|
||||
DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints,
|
||||
}, "OperationSerializer", middleware.Before)
|
||||
}, serializerID, middleware.Before)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -99,25 +95,15 @@ func UpdateEndpoint(stack *middleware.Stack, options UpdateEndpointOptions) (err
|
||||
err = stack.Serialize.Insert(&s3ObjectLambdaEndpoint{
|
||||
UseEndpoint: options.TargetS3ObjectLambda,
|
||||
UseAccelerate: options.UseAccelerate,
|
||||
UseDualstack: options.UseDualstack,
|
||||
EndpointResolver: options.EndpointResolver,
|
||||
EndpointResolverOptions: options.EndpointResolverOptions,
|
||||
}, "OperationSerializer", middleware.Before)
|
||||
}, serializerID, middleware.Before)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// remove bucket arn middleware
|
||||
err = stack.Serialize.Insert(&removeBucketFromPathMiddleware{}, "OperationSerializer", middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// enable dual stack support
|
||||
err = stack.Serialize.Insert(&s3shared.EnableDualstack{
|
||||
UseDualstack: options.UseDualstack,
|
||||
DefaultServiceID: "s3",
|
||||
}, "OperationSerializer", middleware.After)
|
||||
err = stack.Serialize.Insert(&removeBucketFromPathMiddleware{}, serializerID, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -128,7 +114,7 @@ func UpdateEndpoint(stack *middleware.Stack, options UpdateEndpointOptions) (err
|
||||
getBucketFromInput: options.Accessor.GetBucketFromInput,
|
||||
useAccelerate: options.UseAccelerate,
|
||||
supportsAccelerate: options.SupportsAccelerate,
|
||||
}, (*s3shared.EnableDualstack)(nil).ID(), middleware.After)
|
||||
}, serializerID, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
844
vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints/endpoints.go
generated
vendored
844
vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints/endpoints.go
generated
vendored
@ -5,14 +5,63 @@ package endpoints
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/aws-sdk-go-v2/internal/endpoints"
|
||||
endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"
|
||||
"github.com/aws/smithy-go/logging"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Options is the endpoint resolver configuration options
|
||||
type Options struct {
|
||||
// Logger is a logging implementation that log events should be sent to.
|
||||
Logger logging.Logger
|
||||
|
||||
// LogDeprecated indicates that deprecated endpoints should be logged to the
|
||||
// provided logger.
|
||||
LogDeprecated bool
|
||||
|
||||
// ResolvedRegion is used to override the region to be resolved, rather then the
|
||||
// using the value passed to the ResolveEndpoint method. This value is used by the
|
||||
// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative
|
||||
// name. You must not set this value directly in your application.
|
||||
ResolvedRegion string
|
||||
|
||||
// DisableHTTPS informs the resolver to return an endpoint that does not use the
|
||||
// HTTPS scheme.
|
||||
DisableHTTPS bool
|
||||
|
||||
// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.
|
||||
UseDualStackEndpoint aws.DualStackEndpointState
|
||||
|
||||
// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.
|
||||
UseFIPSEndpoint aws.FIPSEndpointState
|
||||
}
|
||||
|
||||
func (o Options) GetResolvedRegion() string {
|
||||
return o.ResolvedRegion
|
||||
}
|
||||
|
||||
func (o Options) GetDisableHTTPS() bool {
|
||||
return o.DisableHTTPS
|
||||
}
|
||||
|
||||
func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {
|
||||
return o.UseDualStackEndpoint
|
||||
}
|
||||
|
||||
func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {
|
||||
return o.UseFIPSEndpoint
|
||||
}
|
||||
|
||||
func transformToSharedOptions(options Options) endpoints.Options {
|
||||
return endpoints.Options{
|
||||
Logger: options.Logger,
|
||||
LogDeprecated: options.LogDeprecated,
|
||||
ResolvedRegion: options.ResolvedRegion,
|
||||
DisableHTTPS: options.DisableHTTPS,
|
||||
UseDualStackEndpoint: options.UseDualStackEndpoint,
|
||||
UseFIPSEndpoint: options.UseFIPSEndpoint,
|
||||
}
|
||||
}
|
||||
|
||||
// Resolver S3 endpoint resolver
|
||||
@ -26,9 +75,7 @@ func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws
|
||||
return endpoint, &aws.MissingRegionError{}
|
||||
}
|
||||
|
||||
opt := endpoints.Options{
|
||||
DisableHTTPS: options.DisableHTTPS,
|
||||
}
|
||||
opt := transformToSharedOptions(options)
|
||||
return r.partitions.ResolveEndpoint(region, opt)
|
||||
}
|
||||
|
||||
@ -57,319 +104,690 @@ var partitionRegexp = struct {
|
||||
var defaultPartitions = endpoints.Partitions{
|
||||
{
|
||||
ID: "aws",
|
||||
Defaults: endpoints.Endpoint{
|
||||
Hostname: "s3.{region}.amazonaws.com",
|
||||
Protocols: []string{"http", "https"},
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
{
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.{region}.amazonaws.com",
|
||||
Protocols: []string{"http", "https"},
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
{
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.{region}.amazonaws.com",
|
||||
Protocols: []string{"http", "https"},
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
{
|
||||
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.dualstack.{region}.amazonaws.com",
|
||||
Protocols: []string{"http", "https"},
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
{
|
||||
Variant: 0,
|
||||
}: {
|
||||
Hostname: "s3.{region}.amazonaws.com",
|
||||
Protocols: []string{"http", "https"},
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
},
|
||||
RegionRegex: partitionRegexp.Aws,
|
||||
IsRegionalized: true,
|
||||
Endpoints: endpoints.Endpoints{
|
||||
"accesspoint-af-south-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.af-south-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
endpoints.EndpointKey{
|
||||
Region: "af-south-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "af-south-1",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.af-south-1.amazonaws.com",
|
||||
},
|
||||
"accesspoint-ap-east-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.ap-east-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-east-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-east-1",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.ap-east-1.amazonaws.com",
|
||||
},
|
||||
"accesspoint-ap-northeast-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.ap-northeast-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-ap-northeast-2": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.ap-northeast-2.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-ap-northeast-3": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.ap-northeast-3.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-ap-south-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.ap-south-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-ap-southeast-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.ap-southeast-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-ap-southeast-2": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.ap-southeast-2.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-ca-central-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.ca-central-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-eu-central-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.eu-central-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-eu-north-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.eu-north-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-eu-south-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.eu-south-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-eu-west-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.eu-west-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-eu-west-2": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.eu-west-2.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-eu-west-3": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.eu-west-3.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-me-south-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.me-south-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-sa-east-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.sa-east-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-us-east-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.us-east-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-us-east-2": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.us-east-2.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-us-west-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.us-west-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-us-west-2": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.us-west-2.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"af-south-1": endpoints.Endpoint{},
|
||||
"ap-east-1": endpoints.Endpoint{},
|
||||
"ap-northeast-1": endpoints.Endpoint{
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-northeast-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3.ap-northeast-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
"ap-northeast-2": endpoints.Endpoint{},
|
||||
"ap-northeast-3": endpoints.Endpoint{},
|
||||
"ap-south-1": endpoints.Endpoint{},
|
||||
"ap-southeast-1": endpoints.Endpoint{
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-northeast-1",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.ap-northeast-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-northeast-2",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-northeast-2",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.ap-northeast-2.amazonaws.com",
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-northeast-3",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-northeast-3",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.ap-northeast-3.amazonaws.com",
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-south-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-south-1",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.ap-south-1.amazonaws.com",
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-southeast-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3.ap-southeast-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
"ap-southeast-2": endpoints.Endpoint{
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-southeast-1",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.ap-southeast-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-southeast-2",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3.ap-southeast-2.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
"aws-global": endpoints.Endpoint{
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-southeast-2",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.ap-southeast-2.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "aws-global",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "us-east-1",
|
||||
},
|
||||
},
|
||||
"ca-central-1": endpoints.Endpoint{},
|
||||
"eu-central-1": endpoints.Endpoint{},
|
||||
"eu-north-1": endpoints.Endpoint{},
|
||||
"eu-south-1": endpoints.Endpoint{},
|
||||
"eu-west-1": endpoints.Endpoint{
|
||||
endpoints.EndpointKey{
|
||||
Region: "ca-central-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ca-central-1",
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.ca-central-1.amazonaws.com",
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ca-central-1",
|
||||
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.dualstack.ca-central-1.amazonaws.com",
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ca-central-1",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.ca-central-1.amazonaws.com",
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-central-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-central-1",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.eu-central-1.amazonaws.com",
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-north-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-north-1",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.eu-north-1.amazonaws.com",
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-south-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-south-1",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.eu-south-1.amazonaws.com",
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-west-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3.eu-west-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
"eu-west-2": endpoints.Endpoint{},
|
||||
"eu-west-3": endpoints.Endpoint{},
|
||||
"fips-accesspoint-ca-central-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint-fips.ca-central-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-west-1",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.eu-west-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
"fips-accesspoint-us-east-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint-fips.us-east-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-west-2",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-west-2",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.eu-west-2.amazonaws.com",
|
||||
},
|
||||
"fips-accesspoint-us-east-2": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint-fips.us-east-2.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-west-3",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-west-3",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.eu-west-3.amazonaws.com",
|
||||
},
|
||||
"fips-accesspoint-us-west-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint-fips.us-west-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
endpoints.EndpointKey{
|
||||
Region: "fips-ca-central-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3-fips.ca-central-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "ca-central-1",
|
||||
},
|
||||
Deprecated: aws.TrueTernary,
|
||||
},
|
||||
"fips-accesspoint-us-west-2": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint-fips.us-west-2.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
endpoints.EndpointKey{
|
||||
Region: "fips-us-east-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3-fips.us-east-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "us-east-1",
|
||||
},
|
||||
Deprecated: aws.TrueTernary,
|
||||
},
|
||||
"me-south-1": endpoints.Endpoint{},
|
||||
"s3-external-1": endpoints.Endpoint{
|
||||
endpoints.EndpointKey{
|
||||
Region: "fips-us-east-2",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3-fips.us-east-2.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "us-east-2",
|
||||
},
|
||||
Deprecated: aws.TrueTernary,
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "fips-us-west-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3-fips.us-west-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "us-west-1",
|
||||
},
|
||||
Deprecated: aws.TrueTernary,
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "fips-us-west-2",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3-fips.us-west-2.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "us-west-2",
|
||||
},
|
||||
Deprecated: aws.TrueTernary,
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "me-south-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "me-south-1",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.me-south-1.amazonaws.com",
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "s3-external-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3-external-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "us-east-1",
|
||||
},
|
||||
},
|
||||
"sa-east-1": endpoints.Endpoint{
|
||||
endpoints.EndpointKey{
|
||||
Region: "sa-east-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3.sa-east-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
"us-east-1": endpoints.Endpoint{
|
||||
endpoints.EndpointKey{
|
||||
Region: "sa-east-1",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.sa-east-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-east-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3.us-east-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
"us-east-2": endpoints.Endpoint{},
|
||||
"us-west-1": endpoints.Endpoint{
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-east-1",
|
||||
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.dualstack.us-east-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-east-1",
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.us-east-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-east-1",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.us-east-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-east-2",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-east-2",
|
||||
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.dualstack.us-east-2.amazonaws.com",
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-east-2",
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.us-east-2.amazonaws.com",
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-east-2",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.us-east-2.amazonaws.com",
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-west-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3.us-west-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
"us-west-2": endpoints.Endpoint{
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-west-1",
|
||||
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.dualstack.us-west-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-west-1",
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.us-west-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-west-1",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.us-west-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-west-2",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3.us-west-2.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-west-2",
|
||||
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.dualstack.us-west-2.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-west-2",
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.us-west-2.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-west-2",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.us-west-2.amazonaws.com",
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "aws-cn",
|
||||
Defaults: endpoints.Endpoint{
|
||||
Hostname: "s3.{region}.amazonaws.com.cn",
|
||||
Protocols: []string{"http", "https"},
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsCn,
|
||||
IsRegionalized: true,
|
||||
Endpoints: endpoints.Endpoints{
|
||||
"accesspoint-cn-north-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.cn-north-1.amazonaws.com.cn",
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
{
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.{region}.amazonaws.com.cn",
|
||||
Protocols: []string{"http", "https"},
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"accesspoint-cn-northwest-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.cn-northwest-1.amazonaws.com.cn",
|
||||
{
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.{region}.amazonaws.com.cn",
|
||||
Protocols: []string{"http", "https"},
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"cn-north-1": endpoints.Endpoint{},
|
||||
"cn-northwest-1": endpoints.Endpoint{},
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "aws-iso",
|
||||
Defaults: endpoints.Endpoint{
|
||||
Hostname: "s3.{region}.c2s.ic.gov",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsIso,
|
||||
IsRegionalized: true,
|
||||
Endpoints: endpoints.Endpoints{
|
||||
"us-iso-east-1": endpoints.Endpoint{
|
||||
{
|
||||
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.{region}.api.amazonwebservices.com.cn",
|
||||
Protocols: []string{"http", "https"},
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
{
|
||||
Variant: 0,
|
||||
}: {
|
||||
Hostname: "s3.{region}.amazonaws.com.cn",
|
||||
Protocols: []string{"http", "https"},
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsCn,
|
||||
IsRegionalized: true,
|
||||
Endpoints: endpoints.Endpoints{
|
||||
endpoints.EndpointKey{
|
||||
Region: "cn-north-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "cn-north-1",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.cn-north-1.amazonaws.com.cn",
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "cn-northwest-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "cn-northwest-1",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.cn-northwest-1.amazonaws.com.cn",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "aws-iso",
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
{
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.{region}.c2s.ic.gov",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
{
|
||||
Variant: 0,
|
||||
}: {
|
||||
Hostname: "s3.{region}.c2s.ic.gov",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsIso,
|
||||
IsRegionalized: true,
|
||||
Endpoints: endpoints.Endpoints{
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-iso-east-1",
|
||||
}: endpoints.Endpoint{
|
||||
Protocols: []string{"http", "https"},
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-iso-west-1",
|
||||
}: endpoints.Endpoint{},
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "aws-iso-b",
|
||||
Defaults: endpoints.Endpoint{
|
||||
Hostname: "s3.{region}.sc2s.sgov.gov",
|
||||
Protocols: []string{"http", "https"},
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
{
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.{region}.sc2s.sgov.gov",
|
||||
Protocols: []string{"http", "https"},
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
{
|
||||
Variant: 0,
|
||||
}: {
|
||||
Hostname: "s3.{region}.sc2s.sgov.gov",
|
||||
Protocols: []string{"http", "https"},
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsIsoB,
|
||||
IsRegionalized: true,
|
||||
Endpoints: endpoints.Endpoints{
|
||||
"us-isob-east-1": endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-isob-east-1",
|
||||
}: endpoints.Endpoint{},
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "aws-us-gov",
|
||||
Defaults: endpoints.Endpoint{
|
||||
Hostname: "s3.{region}.amazonaws.com",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
{
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.{region}.amazonaws.com",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
{
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.{region}.amazonaws.com",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
{
|
||||
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.dualstack.{region}.amazonaws.com",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
{
|
||||
Variant: 0,
|
||||
}: {
|
||||
Hostname: "s3.{region}.amazonaws.com",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"s3", "s3v4"},
|
||||
},
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsUsGov,
|
||||
IsRegionalized: true,
|
||||
Endpoints: endpoints.Endpoints{
|
||||
"accesspoint-us-gov-east-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.us-gov-east-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
endpoints.EndpointKey{
|
||||
Region: "fips-us-gov-east-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3-fips.us-gov-east-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "us-gov-east-1",
|
||||
},
|
||||
Deprecated: aws.TrueTernary,
|
||||
},
|
||||
"accesspoint-us-gov-west-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint.us-gov-west-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"fips-accesspoint-us-gov-east-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint-fips.us-gov-east-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"fips-accesspoint-us-gov-west-1": endpoints.Endpoint{
|
||||
Hostname: "s3-accesspoint-fips.us-gov-west-1.amazonaws.com",
|
||||
SignatureVersions: []string{"s3v4"},
|
||||
},
|
||||
"fips-us-gov-west-1": endpoints.Endpoint{
|
||||
endpoints.EndpointKey{
|
||||
Region: "fips-us-gov-west-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3-fips.us-gov-west-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "us-gov-west-1",
|
||||
},
|
||||
Deprecated: aws.TrueTernary,
|
||||
},
|
||||
"us-gov-east-1": endpoints.Endpoint{
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-gov-east-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3.us-gov-east-1.amazonaws.com",
|
||||
Protocols: []string{"http", "https"},
|
||||
},
|
||||
"us-gov-west-1": endpoints.Endpoint{
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-gov-east-1",
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.us-gov-east-1.amazonaws.com",
|
||||
Protocols: []string{"http", "https"},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-gov-east-1",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.us-gov-east-1.amazonaws.com",
|
||||
Protocols: []string{"http", "https"},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-gov-west-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "s3.us-gov-west-1.amazonaws.com",
|
||||
Protocols: []string{"http", "https"},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-gov-west-1",
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "s3-fips.us-gov-west-1.amazonaws.com",
|
||||
Protocols: []string{"http", "https"},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-gov-west-1",
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "s3.dualstack.us-gov-west-1.amazonaws.com",
|
||||
Protocols: []string{"http", "https"},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
// GetDNSSuffix returns the dnsSuffix URL component for the given partition id
|
||||
func GetDNSSuffix(id string) (string, error) {
|
||||
func GetDNSSuffix(id string, options Options) (string, error) {
|
||||
variant := transformToSharedOptions(options).GetEndpointVariant()
|
||||
switch {
|
||||
case strings.EqualFold(id, "aws"):
|
||||
return "amazonaws.com", nil
|
||||
switch variant {
|
||||
case endpoints.DualStackVariant:
|
||||
return "amazonaws.com", nil
|
||||
|
||||
case endpoints.FIPSVariant:
|
||||
return "amazonaws.com", nil
|
||||
|
||||
case endpoints.FIPSVariant | endpoints.DualStackVariant:
|
||||
return "amazonaws.com", nil
|
||||
|
||||
case 0:
|
||||
return "amazonaws.com", nil
|
||||
|
||||
default:
|
||||
return "", fmt.Errorf("unsupported endpoint variant %v, in partition %s", variant, id)
|
||||
|
||||
}
|
||||
|
||||
case strings.EqualFold(id, "aws-cn"):
|
||||
return "amazonaws.com.cn", nil
|
||||
switch variant {
|
||||
case endpoints.DualStackVariant:
|
||||
return "amazonaws.com.cn", nil
|
||||
|
||||
case endpoints.FIPSVariant:
|
||||
return "amazonaws.com.cn", nil
|
||||
|
||||
case endpoints.FIPSVariant | endpoints.DualStackVariant:
|
||||
return "api.amazonwebservices.com.cn", nil
|
||||
|
||||
case 0:
|
||||
return "amazonaws.com.cn", nil
|
||||
|
||||
default:
|
||||
return "", fmt.Errorf("unsupported endpoint variant %v, in partition %s", variant, id)
|
||||
|
||||
}
|
||||
|
||||
case strings.EqualFold(id, "aws-iso"):
|
||||
return "c2s.ic.gov", nil
|
||||
switch variant {
|
||||
case endpoints.FIPSVariant:
|
||||
return "c2s.ic.gov", nil
|
||||
|
||||
case 0:
|
||||
return "c2s.ic.gov", nil
|
||||
|
||||
default:
|
||||
return "", fmt.Errorf("unsupported endpoint variant %v, in partition %s", variant, id)
|
||||
|
||||
}
|
||||
|
||||
case strings.EqualFold(id, "aws-iso-b"):
|
||||
return "sc2s.sgov.gov", nil
|
||||
switch variant {
|
||||
case endpoints.FIPSVariant:
|
||||
return "sc2s.sgov.gov", nil
|
||||
|
||||
case 0:
|
||||
return "sc2s.sgov.gov", nil
|
||||
|
||||
default:
|
||||
return "", fmt.Errorf("unsupported endpoint variant %v, in partition %s", variant, id)
|
||||
|
||||
}
|
||||
|
||||
case strings.EqualFold(id, "aws-us-gov"):
|
||||
return "amazonaws.com", nil
|
||||
switch variant {
|
||||
case endpoints.DualStackVariant:
|
||||
return "amazonaws.com", nil
|
||||
|
||||
case endpoints.FIPSVariant:
|
||||
return "amazonaws.com", nil
|
||||
|
||||
case endpoints.FIPSVariant | endpoints.DualStackVariant:
|
||||
return "amazonaws.com", nil
|
||||
|
||||
case 0:
|
||||
return "amazonaws.com", nil
|
||||
|
||||
default:
|
||||
return "", fmt.Errorf("unsupported endpoint variant %v, in partition %s", variant, id)
|
||||
|
||||
}
|
||||
|
||||
default:
|
||||
return "", fmt.Errorf("unknown partition")
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// GetDNSSuffixFromRegion returns the dnsSuffix URL component for the given
|
||||
// partition id
|
||||
func GetDNSSuffixFromRegion(region string) (string, error) {
|
||||
switch {
|
||||
case partitionRegexp.Aws.MatchString(region):
|
||||
return "amazonaws.com", nil
|
||||
|
||||
case partitionRegexp.AwsCn.MatchString(region):
|
||||
return "amazonaws.com.cn", nil
|
||||
|
||||
case partitionRegexp.AwsIso.MatchString(region):
|
||||
return "c2s.ic.gov", nil
|
||||
|
||||
case partitionRegexp.AwsIsoB.MatchString(region):
|
||||
return "sc2s.sgov.gov", nil
|
||||
|
||||
case partitionRegexp.AwsUsGov.MatchString(region):
|
||||
return "amazonaws.com", nil
|
||||
|
||||
default:
|
||||
return "", fmt.Errorf("unknown region partition")
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user