Skip to content

Commit a4ba22d

Browse files
Update R2 docs to support recent S3 SDK changes (#19266)
* Update R2 docs to support recent S3 SDK changes * Fix extra space * Fix ruby versions
1 parent f73ce92 commit a4ba22d

File tree

8 files changed

+91
-0
lines changed

8 files changed

+91
-0
lines changed

src/content/docs/r2/examples/aws/aws-cli.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ import { Render } from "~/components";
1010

1111
With the [`aws`](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) CLI installed, you may run [`aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html#cli-configure-quickstart-config) to configure a new profile. You will be prompted with a series of questions for the new profile's details.
1212

13+
:::note[Compatibility]
14+
Client versions `2.23.0` and `1.37.0` introduced a modification to the default checksum behavior from the client that is currently incompatible with R2 APIs.
15+
16+
To mitigate, users can use `2.22.35` or `1.36.40` as the documented overrides do not work consistently for all subcommands.
17+
18+
:::
19+
1320
```shell
1421
aws configure
1522
```

src/content/docs/r2/examples/aws/aws-sdk-go.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ import { Render } from "~/components"
1010

1111
This example uses version 2 of the [aws-sdk-go](https://github.com/aws/aws-sdk-go-v2) package. You must pass in the R2 configuration credentials when instantiating your `S3` service client:
1212

13+
:::note[Compatibility]
14+
Client version `1.73.0` introduced a modification to the default checksum behavior from the client that is currently incompatible with R2 APIs.
15+
16+
To mitigate, users can use `1.72.3` or add the following to their config:
17+
18+
```go
19+
config.WithRequestChecksumCalculation(0)
20+
config.WithResponseChecksumValidation(0)
21+
```
22+
23+
:::
24+
1325
```go
1426
package main
1527

src/content/docs/r2/examples/aws/aws-sdk-java.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ import { Render } from "~/components";
1010

1111
This example uses version 2 of the [aws-sdk-java](https://github.com/aws/aws-sdk-java-v2/#using-the-sdk) package. You must pass in the R2 configuration credentials when instantiating your `S3` service client:
1212

13+
:::note[Compatibility]
14+
Client version `2.30.0` introduced a modification to the default checksum behavior from the client that is currently incompatible with R2 APIs.
15+
16+
To mitigate, users can use `2.29.52` or add the following to their S3Config:
17+
18+
```java
19+
this.requestChecksumCalculation = "when_required",
20+
this.esponseChecksumValidation = "when_required"
21+
```
22+
23+
:::
24+
1325
```java
1426
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
1527
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;

src/content/docs/r2/examples/aws/aws-sdk-js-v3.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ import { Render } from "~/components";
1010

1111
JavaScript or TypeScript users may continue to use the [`@aws-sdk/client-s3`](https://www.npmjs.com/package/@aws-sdk/client-s3) npm package as per normal. You must pass in the R2 configuration credentials when instantiating your `S3` service client:
1212

13+
:::note[Compatibility]
14+
Client version `3.729.0` introduced a modification to the default checksum behavior from the client that is currently incompatible with R2 APIs.
15+
16+
To mitigate, users can use `3.726.1` or add the following to their S3Client config:
17+
18+
```ts
19+
requestChecksumCalculation: "WHEN_REQUIRED",
20+
responseChecksumValidation: "WHEN_REQUIRED",
21+
```
22+
23+
:::
24+
1325
```ts
1426
import {
1527
S3Client,

src/content/docs/r2/examples/aws/aws-sdk-net.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ This example uses version 3 of the [aws-sdk-net](https://www.nuget.org/packages/
1414

1515
In this example, you will pass credentials explicitly to the `IAmazonS3` initialization. If you wish, use a shared AWS credentials file or the SDK store in-line with other AWS SDKs. Refer to [Configure AWS credentials](https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-creds.html) for more details.
1616

17+
:::note[Compatibility]
18+
Client version `3.7.963.0` introduced a modification to the default checksum behavior from the client that is currently incompatible with R2 APIs.
19+
20+
To mitigate, users can use `3.7.962.0` or add the following to their AmazonS3Config:
21+
22+
```csharp
23+
RequestChecksumCalculation = "WHEN_REQUIRED",
24+
ResponseChecksumValidation = "WHEN_REQUIRED"
25+
```
26+
27+
:::
28+
1729
```csharp
1830
private static IAmazonS3 s3Client;
1931

src/content/docs/r2/examples/aws/aws-sdk-php.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ import { Render } from "~/components";
1212

1313
This example uses version 3 of the [aws-sdk-php](https://packagist.org/packages/aws/aws-sdk-php) package. You must pass in the R2 configuration credentials when instantiating your `S3` service client:
1414

15+
:::note[Compatibility]
16+
Client version `3.337.0` introduced a modification to the default checksum behavior from the client that is currently incompatible with R2 APIs.
17+
18+
To mitigate, users can use `3.336.15` or add the following to their $options:
19+
20+
```php
21+
'request_checksum_calculation' => 'when_required',
22+
'response_checksum_validation' => 'when_required'
23+
```
24+
25+
:::
26+
1527
```php
1628
<?php
1729
require 'vendor/aws/aws-autoloader.php';

src/content/docs/r2/examples/aws/aws-sdk-ruby.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ import { Render } from "~/components"
1010

1111
Many Ruby projects also store these credentials in environment variables instead.
1212

13+
:::note[Compatibility]
14+
Client version `1.178.0` introduced a modification to the default checksum behavior from the client that is currently incompatible with R2 APIs.
15+
16+
To mitigate, users can use `1.177.0` or add the following to their s3 client instantiation:
17+
18+
```ruby
19+
request_checksum_calculation: "when_required",
20+
response_checksum_validation: "when_required"
21+
```
22+
23+
:::
24+
1325
Add the following dependency to your `Gemfile`:
1426

1527
```ruby

src/content/docs/r2/examples/aws/boto3.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ import { Render } from "~/components";
1010

1111
You must configure [`boto3`](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html) to use a preconstructed `endpoint_url` value. This can be done through any `boto3` usage that accepts connection arguments; for example:
1212

13+
:::note[Compatibility]
14+
Client version `1.36.0` introduced a modification to the default checksum behavior from the client that is currently incompatible with R2 APIs.
15+
16+
To mitigate, users can use `1.35.99` or add the following to their s3 resource config:
17+
18+
```python
19+
request_checksum_calculation = 'WHEN_REQUIRED',
20+
response_checksum_validation = 'WHEN_REQUIRED'
21+
```
22+
23+
:::
24+
1325
```python
1426
import boto3
1527

0 commit comments

Comments
 (0)