gems/aws-partitions/lib/aws-partitions/endpoint_provider.rb
def endpoint_for(region, service, sts_regional_endpoints)
        partition = get_partition(region)
        service_cfg = partition.fetch('services', {}).fetch(service, {})

        # Find the default endpoint
        endpoint = service_cfg
                   .fetch('defaults', {})
                   .fetch('hostname', partition['defaults']['hostname'])

        # Check for sts legacy behavior
        sts_legacy = service == 'sts' &&
                     sts_regional_endpoints == 'legacy' &&
                     STS_LEGACY_REGIONS.include?(region)

        # Check for global endpoint.
        if sts_legacy || service_cfg['isRegionalized'] == false
          region = service_cfg.fetch('partitionEndpoint', region)
        end

        # Can be removed once S3 endpoint is updated
        if (service == 's3') && (region == 'us-east-1')
          service_cfg['endpoints'][region] = S3_IAD_REGIONAL
        end

        # Check for service/region level endpoint.
        endpoint = service_cfg
                   .fetch('endpoints', {})
                   .fetch(region, {}).fetch('hostname', endpoint)

        # Replace placeholders from the endpoints
        endpoint.sub('{region}', region)
                .sub('{service}', service)
                .sub('{dnsSuffix}', partition['dnsSuffix'])
      end
# When sts_regional_endpoint is set to `legacy`, the endpoint
# pattern stays global for the following regions:
When sts_regional_endpoint is set to `legacy`, the endpoint
pattern stays global for the following regions.
When sts_regional_endpoint is set to ` legacy ` the endpoint pattern stays global for the following regions .
def endpoint_for(region, service, sts_regional_endpoints)
        partition = get_partition(region)
        service_cfg = partition.fetch('services', {}).fetch(service, {})
        endpoint = service_cfg
                   .fetch('defaults', {})
                   .fetch('hostname', partition['defaults']['hostname'])
        sts_legacy = service == 'sts' &&
                     sts_regional_endpoints == 'legacy' &&
                     STS_LEGACY_REGIONS.include?(region)
        if sts_legacy || service_cfg['isRegionalized'] == false
          region = service_cfg.fetch('partitionEndpoint', region)
        end
        if (service == 's3') && (region == 'us-east-1')
          service_cfg['endpoints'][region] = S3_IAD_REGIONAL
        end
        endpoint = service_cfg
                   .fetch('endpoints', {})
                   .fetch(region, {}).fetch('hostname', endpoint)
        endpoint.sub('{region}', region)
                .sub('{service}', service)
                .sub('{dnsSuffix}', partition['dnsSuffix'])
      end
def endpoint_for ( region , service , sts_regional_endpoints ) partition = get_partition ( region ) service_cfg = partition . fetch ( 'services' , { } ) . fetch ( service , { } ) endpoint = service_cfg . fetch ( 'defaults' , { } ) . fetch ( 'hostname' , partition [ 'defaults' ] [ 'hostname' ] ) sts_legacy = service == 'sts' && sts_regional_endpoints == 'legacy' && STS_LEGACY_REGIONS . include? ( region ) if sts_legacy || service_cfg [ 'isRegionalized' ] == false region = service_cfg . fetch ( 'partitionEndpoint' , region ) end if ( service == 's3' ) && ( region == 'us-east-1' ) service_cfg [ 'endpoints' ] [ region ] = S3_IAD_REGIONAL end endpoint = service_cfg . fetch ( 'endpoints' , { } ) . fetch ( region , { } ) . fetch ( 'hostname' , endpoint ) endpoint . sub ( '{region}' , region ) . sub ( '{service}' , service ) . sub ( '{dnsSuffix}' , partition [ 'dnsSuffix' ] ) end
When sts_regional_endpoint is set to `legacy`, the endpoint
pattern stays global for the following regions:
When sts_regional_endpoint is set to ` legacy ` the endpoint pattern stays global for the following regions :
# Find the default endpoint # Check for sts legacy behavior # Check for global endpoint. # Can be removed once S3 endpoint is updated # Check for service/region level endpoint. # Replace placeholders from the endpoints
region
service
sts_regional_endpoints