From f5a618f3f61b992e9e86ce8fe15683be97e21efc Mon Sep 17 00:00:00 2001 From: Jason Del Ponte <961963+jasdel@users.noreply.github.com> Date: Wed, 28 Jul 2021 11:28:58 -0700 Subject: [PATCH] service/s3: Update unit test to clarify implemented behavior Updates Amazon S3 Output ARN unit test to more specifically describe the behavior that is being tested. If the client's resolved endpoint's signing region does not match the Output ARN's region component the client will return the region not match error. If the client's resolved endpoint's signing region does match the Output ARN's region component, but the API client's configured region includes FIPS, the FIPS configured error will be returned. --- service/s3/endpoint_test.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/service/s3/endpoint_test.go b/service/s3/endpoint_test.go index 84152cfc5f..e2fc75d09f 100644 --- a/service/s3/endpoint_test.go +++ b/service/s3/endpoint_test.go @@ -265,14 +265,22 @@ func TestEndpoint(t *testing.T) { expectedSigningName: "s3-outposts", expectedSigningRegion: "us-gov-east-1", }, - "Outpost AccessPoint FIPS client region": { - bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint", + "Outpost AccessPoint FIPS client region, resolved signing region does not match ARN region": { + bucket: "arn:aws-us-gov:s3-outposts:us-gov-unknown-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint", config: &aws.Config{ EndpointResolver: endpoints.AwsUsGovPartition(), - Region: aws.String("fips-us-gov-east-1"), + Region: aws.String("fips-us-gov-unknown-1"), }, expectedErr: "ConfigurationError: client region does not match provided ARN region", }, + "Outpost AccessPoint FIPS client region, resolved signing region does match ARN region": { + bucket: "arn:aws-us-gov:s3-outposts:us-gov-west-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint", + config: &aws.Config{ + EndpointResolver: endpoints.AwsUsGovPartition(), + Region: aws.String("fips-us-gov-west-1"), + }, + expectedErr: "use of ARN is not supported when client or request is configured for FIPS", + }, "Outpost AccessPoint FIPS client region with matching ARN region": { bucket: "arn:aws-us-gov:s3-outposts:us-gov-east-1:123456789012:outpost:op-01234567890123456:accesspoint:myaccesspoint", config: &aws.Config{