

# Making requests to S3 on Outposts over IPv6
<a name="S3OutpostsIPv6-access"></a>

Amazon S3 on Outposts and S3 on Outposts dual-stack endpoints support requests to S3 on Outposts buckets using either the IPv6 or IPv4 protocol. With IPv6 support for S3 on Outposts, you can access and operate your buckets and control plane resources through S3 on Outposts APIs over IPv6 networks.

**Note**  
[S3 on Outposts object actions](https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsAPI.html) (such as `PutObject` or `GetObject`) aren’t supported over IPv6 networks.

There are no additional charges for accessing S3 on Outposts over IPv6 networks. For more information about S3 on Outposts, see [S3 on Outposts pricing](https://aws.amazon.com/outposts/rack/pricing/).

**Topics**
+ [

## Getting started with IPv6
](#S3Outposts-ipv6-access-getting-started)
+ [

## Using dual-stack endpoints to make requests over an IPv6 network
](#S3Outposts-ipv6-access-api)
+ [

## Using IPv6 addresses in IAM policies
](#S3Outposts-ipv6-access-iam)
+ [

## Testing IP address compatibility
](#S3Outposts-ipv6-access-test-compatabilty)
+ [

## Using IPv6 with AWS PrivateLink
](#S3Outposts-ipv6-privatelink)
+ [

# Using S3 on Outposts dual-stack endpoints
](s3-outposts-dual-stack-endpoints.md)

## Getting started with IPv6
<a name="S3Outposts-ipv6-access-getting-started"></a>

To make a request to an S3 on Outposts bucket over IPv6, you must use a dual-stack endpoint. The next section describes how to make requests over IPv6 by using dual-stack endpoints. 

The following are important considerations before trying to access an S3 on Outposts bucket over IPv6:
+ The client and the network accessing the bucket must be enabled to use IPv6. 
+ Both virtual hosted-style and path style requests are supported for IPv6 access. For more information, see [Using S3 on Outposts dual-stack endpoints](s3-outposts-dual-stack-endpoints.md).
+ If you use source IP address filtering in your AWS Identity and Access Management (IAM) user or S3 on Outposts bucket policies, you must update the policies to include IPv6 address ranges.
**Note**  
This requirement only applies to S3 on Outposts bucket operations and control plane resources across IPv6 networks. [Amazon S3 on Outposts object actions](https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsAPI.html) aren’t supported across IPv6 networks.
+ When using IPv6, server access log files output IP addresses in an IPv6 format. You must update existing tools, scripts, and software that you use to parse S3 on Outposts log files, so that they can parse the IPv6 formatted remote IP addresses. The updated tools, scripts, and software will then correctly parse the IPv6 formatted remote IP addresses.

## Using dual-stack endpoints to make requests over an IPv6 network
<a name="S3Outposts-ipv6-access-api"></a>

To make requests with S3 on Outposts API calls over IPv6, you can use dual-stack endpoints via AWS CLI or AWS SDK. The [Amazon S3 control API operations ](https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsAPI.html#S3OutpostsAPIsBucket) and [S3 on Outposts API operations](https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsAPI.html#S3OutpostsAPIs) work the same way whether you’re accessing S3 on Outposts over an IPv6 protocol or IPv4 protocol. However, be aware that [S3 on Outposts object actions](https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsAPI.html) (such as `PutObject` or `GetObject`) aren’t supported over IPv6 networks.

When using the AWS Command Line Interface (AWS CLI) and AWS SDKs, you can use a parameter or flag to change to a dual-stack endpoint. You can also specify the dual-stack endpoint directly as an override of the S3 on Outposts endpoint in the configuration file.

You can use a dual-stack endpoint to access an S3 on Outposts bucket over IPv6 from any of the following:
+ The AWS CLI, see [Using dual-stack endpoints from the AWS CLI](s3-outposts-dual-stack-endpoints.md#s3-outposts-dual-stack-endpoints-cli).
+ The AWS SDKs, see [Using S3 on Outposts dual-stack endpoints from the AWS SDKs](s3-outposts-dual-stack-endpoints.md#s3-outposts-dual-stack-endpoints-sdks).

## Using IPv6 addresses in IAM policies
<a name="S3Outposts-ipv6-access-iam"></a>

Before trying to access an S3 on Outposts bucket using an IPv6 protocol, make sure that IAM users or S3 on Outposts bucket policies used for IP address filtering are updated to include IPv6 address ranges. If IP address filtering policies aren’t updated to handle IPv6 addresses, you can lose access to an S3 on Outposts bucket while trying to use the IPv6 protocol.

IAM policies that filter IP addresses use [IP address condition operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html#Conditions_IPAddress). The following S3 on Outposts bucket policy identifies the 54.240.143.\$1 IP range of allowed IPv4 addresses by using IP address condition operators. Any IP addresses outside of this range will be denied access to the S3 on Outposts bucket (`DOC-EXAMPLE-BUCKET`). Since all IPv6 addresses are outside of the allowed range, this policy prevents IPv6 addresses from being able to access `DOC-EXAMPLE-BUCKET`. 

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "IPAllow",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3-outposts:*",
            "Resource": "arn:aws:s3-outposts:us-east-1:111122223333:outpost/OUTPOSTS-ID/bucket/DOC-EXAMPLE-BUCKET/*",
            "Condition": {
                "IpAddress": {
                    "aws:SourceIp": "54.240.143.0/24"
                }
            }
        }
    ]
}
```

------

You can modify the S3 on Outposts bucket policy's `Condition` element to allow both IPv4 (`54.240.143.0/24`) and IPv6 (`2001:DB8:1234:5678::/64`) address ranges as shown in the following example. You can use the same type of `Condition` block shown in the example to update both your IAM user and bucket policies.

```
1.        "Condition": {
2.          "IpAddress": {
3.             "aws:SourceIp": [
4.               "54.240.143.0/24",
5.                "2001:DB8:1234:5678::/64"
6.              ]
7.           }
8.         }
```

Before using IPv6 you must update all relevant IAM user and bucket policies that use IP address filtering to allow IPv6 address ranges. We recommend that you update your IAM policies with your organization's IPv6 address ranges in addition to your existing IPv4 address ranges. For an example of a bucket policy that allows access over both IPv6 and IPv4, see [Restrict access to specific IP addresses](S3Outposts-example-bucket-policies.md#S3Outposts-example-bucket-policies-IP-1).

You can review your IAM user policies using the IAM console at [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/). For more information about IAM, see the [IAM User Guide](https://docs.aws.amazon.com/IAM/latest/UserGuide/). For information about editing S3 on Outposts bucket policies, see [Adding or editing a bucket policy for an Amazon S3 on Outposts bucket](S3OutpostsBucketPolicyEdit.md). 

## Testing IP address compatibility
<a name="S3Outposts-ipv6-access-test-compatabilty"></a>

If you're using a Linux or Unix instance, or macOS X platform, you can test your access to a dual-stack endpoint over IPv6. For example, to test the connection to Amazon S3 on Outposts endpoints over IPv6, use the `dig` command:

```
dig s3-outposts.us-west-2.api.aws AAAA +short
```

If your dual-stack endpoint over an IPv6 network is properly set up, the `dig` command returns the connected IPv6 addresses. For example:

```
dig s3-outposts.us-west-2.api.aws AAAA +short

2600:1f14:2588:4800:b3a9:1460:159f:ebce

2600:1f14:2588:4802:6df6:c1fd:ef8a:fc76

2600:1f14:2588:4801:d802:8ccf:4e04:817
```

## Using IPv6 with AWS PrivateLink
<a name="S3Outposts-ipv6-privatelink"></a>

S3 on Outposts supports the IPv6 protocol for AWS PrivateLink services and endpoints. With AWS PrivateLink support for the IPv6 protocol, you can connect to service endpoints within your VPC over IPv6 networks, from either on-premises or other private connections. The IPv6 support for [AWS PrivateLink for S3 on Outposts](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-outposts-privatelink-interface-endpoints.html) also allows you to integrate AWS PrivateLink with dual-stack endpoints. For steps on how to enable IPv6 for AWS PrivateLink, see [Expedite your IPv6 adoption with AWS PrivateLink services and endpoints](https://aws.amazon.com/blogs/networking-and-content-delivery/expedite-your-ipv6-adoption-with-privatelink-services-and-endpoints/).

**Note**  
To update the supported IP address type from IPv4 to IPv6, see [Modify the supported IP address type](https://docs.aws.amazon.com/vpc/latest/privatelink/configure-endpoint-service.html#supported-ip-address-types) in the *AWS PrivateLink User Guide*.

### Using IPv6 with AWS PrivateLink
<a name="3Outposts-ipv6-privatelink-dualstack-vpc"></a>

If you’re using AWS PrivateLink with IPv6, you must create an IPv6 or dual-stack VPC interface endpoint. For general steps on how to create a VPC endpoint using the AWS Management Console, see [Access an AWS service using an interface VPC endpoint](https://docs.aws.amazon.com/vpc/latest/privatelink/create-interface-endpoint.html#create-interface-endpoint) in the *AWS PrivateLink User Guide*.

------
#### [ AWS Management Console ]

Use the following procedure to create an interface VPC endpoint that connects to S3 on Outposts.

1. Sign in to the AWS Management Console and open the VPC console at [https://console.aws.amazon.com/vpc/](https://console.aws.amazon.com/vpc/).

1. In the navigation pane, choose **Endpoints**.

1. Choose **Create endpoint**.

1. For **Service category**, choose **AWS services**.

1. For **Service name**, choose the S3 on Outposts service (**com.amazonaws.us-east-1.s3-outposts**). 

1. For VPC, choose the VPC from which you'll access S3 on Outposts.

1. For **Subnets**, choose one subnet per Availability Zone from which you'll access S3 on Outposts. You can't select multiple subnets from the same Availability Zone. For each subnet that you select, a new endpoint network interface is created. By default, IP addresses from the subnet IP address ranges are assigned to the endpoint network interfaces. To designate an IP address for an endpoint network interface, choose **Designate IP addresses** and enter an IPv6 address from the subnet address range. 

1. For **IP address type**, choose **Dualstack**. Assign both IPv4 and IPv6 addresses to your endpoint network interfaces. This option is supported only if all selected subnets have both IPv4 and IPv6 address ranges.

1. For **Security groups**, choose the security groups to associate with the endpoint network interfaces for the VPC endpoint. By default, the default security group is associated with the VPC.

1. For **Policy**, choose **Full access** to allow all operations by all principals on all resources over the VPC endpoint. Otherwise, choose **Custom** to attach a VPC endpoint policy that controls the permissions that principals have toperform actions on resources over the VPC endpoint. This option is available only if the service supports VPC endpoint policies. For more information, see [ Endpoint policies](https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints-access.html).

1. (Optional) To add a tag, choose **Add new tag** and enter the tag key and the tag value.

1. Choose **Create endpoint**.

**Example – S3 on Outposts bucket policy**  
To allow S3 on Outposts to interact with your VPC endpoints, you can then update your S3 on Outposts policy like this:  

```
{
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "s3-outposts:*",
            "Resource": "*",
            "Principal": "*"
        }
    ]
}
```

------
#### [ AWS CLI ]

**Note**  
To enable the IPv6 network on your VPC endpoint, you must have `IPv6` set for the `SupportedIpAddressType` filter for S3 on Outposts.

The following example uses the `create-vpc-endpoint` command to create a new dual-stack interface endpoint.

```
aws ec2 create-vpc-endpoint \
--vpc-id vpc-12345678 \
--vpc-endpoint-type Interface \
--service-name com.amazonaws.us-east-1.s3-outposts \
--subnet-id subnet-12345678 \
--security-group-id sg-12345678 \
--ip-address-type dualstack \
--dns-options "DnsRecordIpType=dualstack"
```

Depending on the AWS PrivateLink service configuration, newly created endpoint connections might need to be accepted by the VPC endpoint service provider before they can be used. For more information, see [Accept and reject endpoint connection requests](https://docs.aws.amazon.com/vpc/latest/privatelink/configure-endpoint-service.html#accept-reject-connection-requests) in the *AWS PrivateLink User Guide*.

The following example uses the `modify-vpc-endpoint` command to update the IPv-only VPC endpoint to a dual-stack endpoint. The dual-stack endpoint allows access to both the IPv4 and IPv6 networks.

```
aws ec2 modify-vpc-endpoint \
--vpc-endpoint-id vpce-12345678 \
--add-subnet-ids subnet-12345678 \
--remove-subnet-ids subnet-12345678 \
--ip-address-type dualstack \
--dns-options "DnsRecordIpType=dualstack"
```

For more information about how to enable the IPv6 network for AWS PrivateLink, see [Expedite your IPv6 adoption with AWS PrivateLink services and endpoints](https://aws.amazon.com/blogs/networking-and-content-delivery/expedite-your-ipv6-adoption-with-privatelink-services-and-endpoints/).

------

# Using S3 on Outposts dual-stack endpoints
<a name="s3-outposts-dual-stack-endpoints"></a>

S3 on Outposts dual-stack endpoints support requests to S3 on Outposts buckets over IPv6 and IPv4. This section describes how to use S3 on Outposts dual-stack endpoints.

**Topics**
+ [

## S3 on Outposts dual-stack endpoints
](#s3-outposts-dual-stack-endpoints-description)
+ [

## Using dual-stack endpoints from the AWS CLI
](#s3-outposts-dual-stack-endpoints-cli)
+ [

## Using S3 on Outposts dual-stack endpoints from the AWS SDKs
](#s3-outposts-dual-stack-endpoints-sdks)

## S3 on Outposts dual-stack endpoints
<a name="s3-outposts-dual-stack-endpoints-description"></a>

When you make a request to a dual-stack endpoint, the S3 on Outposts bucket URL resolves to an IPv6 or an IPv4 address. For more information about accessing an S3 on Outposts bucket over IPv6, see [Making requests to S3 on Outposts over IPv6](S3OutpostsIPv6-access.md).

To access an S3 on Outposts bucket through a dual-stack endpoint, use a path-style endpoint name. S3 on Outposts supports only Regional dual-stack endpoint names, which means that you must specify the Region as part of the name.

For a dual-stack path-style FIPs endpoint, use the following naming convention:

```
s3-outposts-fips.region.api.aws
```

For dual-stack non-FIPS endpoint, use the following naming convention:

```
s3-outposts.region.api.aws
```

**Note**  
Virtual hosted-style endpoint names aren't supported in S3 on Outposts.

## Using dual-stack endpoints from the AWS CLI
<a name="s3-outposts-dual-stack-endpoints-cli"></a>

This section provides examples of AWS CLI commands used to make requests to a dual-stack endpoint. For instructions on setting up the AWS CLI, see [Getting started by using the AWS CLI and SDK for Java](S3OutpostsGSCLIJava.md).

You set the configuration value `use_dualstack_endpoint` to `true` in a profile in your AWS Config file to direct all Amazon S3 requests made by the `s3` and `s3api` AWS CLI commands to the dual-stack endpoint for the specified Region. You specify the Region in the configuration file or in a command using the `--region` option. 

When using dual-stack endpoints with the AWS CLI, only `path` addressing style is supported. The addressing style, set in the configuration file, determines whether the bucket name is in the hostname or in the URL. For more information, see [https://docs.aws.amazon.com/cli/latest/reference/s3outposts/](https://docs.aws.amazon.com/cli/latest/reference/s3outposts/) in the *AWS CLI User Guide*.

To use a dual-stack endpoint via the AWS CLI, use the `--endpoint-url` parameter with the `http://s3.dualstack.region.amazonaws.com` or `https://s3-outposts-fips.region.api.aws` endpoint for any `s3control` or `s3outposts` commands.

For example:

```
$  aws s3control list-regional-buckets --endpoint-url https://s3-outposts.region.api.aws
```

## Using S3 on Outposts dual-stack endpoints from the AWS SDKs
<a name="s3-outposts-dual-stack-endpoints-sdks"></a>

This section provides examples of how to access a dual-stack endpoint by using the AWS SDKs. 

### AWS SDK for Java 2.x dual-stack endpoint example
<a name="s3-outposts-dual-stack-endpoints-examples-javav2"></a>

The following examples show how to use the `S3ControlClient` and `S3OutpostsClient` classes to enable dual-stack endpoints when creating an S3 on Outposts client using the AWS SDK for Java 2.x. For instructions on creating and testing a working Java example for Amazon S3 on Outposts, see [Getting started by using the AWS CLI and SDK for Java](S3OutpostsGSCLIJava.md).

**Example – Create an `S3ControlClient` class with dual-stack endpoints enabled**  

```
import com.amazonaws.AmazonServiceException;
import com.amazonaws.SdkClientException;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3control.S3ControlClient;
import software.amazon.awssdk.services.s3control.model.ListRegionalBucketsRequest;
import software.amazon.awssdk.services.s3control.model.ListRegionalBucketsResponse;
import software.amazon.awssdk.services.s3control.model.S3ControlException;


public class DualStackEndpointsExample1 {

    public static void main(String[] args) {
        Region clientRegion = Region.of("us-east-1");
        String accountId = "111122223333";
        String navyId = "9876543210";

        try {
            // Create an S3ControlClient with dual-stack endpoints enabled.
            S3ControlClient s3ControlClient = S3ControlClient.builder()
                                                             .region(clientRegion)
                                                             .dualstackEnabled(true)
                                                             .build();
            ListRegionalBucketsRequest listRegionalBucketsRequest = ListRegionalBucketsRequest.builder()
                                                                                              .accountId(accountId)
                                                                                              .outpostId(navyId)
                                                                                              .build();

            ListRegionalBucketsResponse listBuckets = s3ControlClient.listRegionalBuckets(listRegionalBucketsRequest);
            System.out.printf("ListRegionalBuckets Response: %s%n", listBuckets.toString());
        } catch (AmazonServiceException e) {
            // The call was transmitted successfully, but Amazon S3 on Outposts couldn't process
            // it, so it returned an error response.
            e.printStackTrace();
        }
        catch (S3ControlException e) {
            // Unknown exceptions will be thrown as an instance of this type.
            e.printStackTrace();
        } catch (SdkClientException e) {
            // Amazon S3 on Outposts couldn't be contacted for a response, or the client
            // couldn't parse the response from Amazon S3 on Outposts.
            e.printStackTrace();
        }
    }
}
```

**Example – Create an `S3OutpostsClient` with dual-stack endpoints enabled**  

```
import com.amazonaws.AmazonServiceException;
import com.amazonaws.SdkClientException;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3outposts.S3OutpostsClient;
import software.amazon.awssdk.services.s3outposts.model.ListEndpointsRequest;
import software.amazon.awssdk.services.s3outposts.model.ListEndpointsResponse;
import software.amazon.awssdk.services.s3outposts.model.S3OutpostsException;


public class DualStackEndpointsExample2 {

    public static void main(String[] args) {
        Region clientRegion = Region.of("us-east-1");

        try {
            // Create an S3OutpostsClient with dual-stack endpoints enabled.
            S3OutpostsClient s3OutpostsClient = S3OutpostsClient.builder()
                                                              .region(clientRegion)
                                                              .dualstackEnabled(true)
                                                              .build();
            ListEndpointsRequest listEndpointsRequest = ListEndpointsRequest.builder().build();

            ListEndpointsResponse listEndpoints = s3OutpostsClient.listEndpoints(listEndpointsRequest);
            System.out.printf("ListEndpoints Response: %s%n", listEndpoints.toString());
        } catch (AmazonServiceException e) {
            // The call was transmitted successfully, but Amazon S3 on Outposts couldn't process
            // it, so it returned an error response.
            e.printStackTrace();
        }
        catch (S3OutpostsException e) {
            // Unknown exceptions will be thrown as an instance of this type.
            e.printStackTrace();
        } catch (SdkClientException e) {
            // Amazon S3 on Outposts couldn't be contacted for a response, or the client
            // couldn't parse the response from Amazon S3 on Outposts.
            e.printStackTrace();
        }
    }
}
```

If you're using the AWS SDK for Java 2.x on Windows, you might have to set the following Java virtual machine (JVM) property: 

```
java.net.preferIPv6Addresses=true
```