FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Move checksum docs to an S3 FAQ guide · gitqueue/aws-cli@b5c6deb · GitHub

forked from aws/aws-cli

Commit b5c6deb

Browse files
committed
Move checksum docs to an S3 FAQ guide
1 parent 016b13d commit b5c6deb

3 files changed

Lines changed: 80 additions & 47 deletions

File tree

‎awscli/examples/s3/_concepts.rst‎

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -161,50 +161,3 @@ can run::
161161

162162
aws s3 cp /tmp/foo/ s3://bucket/ --recursive \
163163
--exclude "*" --include "*.jpg" --include "*.txt"
164-
165-
166-
Checksum Validation
167-
+++++++++++++++++++
168-
169-
The AWS CLI will perform checksum validation for uploading and downloading
170-
files in specific scenarios.
171-
172-
Upload
173-
~~~~~~
174-
175-
The AWS CLI will calculate and auto-populate the ``Content-MD5`` header for
176-
both standard and multipart uploads. If the checksum that S3 calculates does
177-
not match the ``Content-MD5`` provided, S3 will not store the object and
178-
instead will return an error message back the AWS CLI. The AWS CLI will retry
179-
this error up to 5 times before giving up. On the case that any files fail to
180-
transfer successfully to S3, the AWS CLI will exit with a non zero RC.
181-
See ``aws help returncodes`` for more information.
182-
183-
If the upload request is signed with Signature Version 4, then a
184-
``Content-MD5`` is not calculated. Instead, the AWS CLI uses the
185-
``x-amz-content-sha256`` header as a checksum instead of ``Content-MD5``.
186-
The AWS CLI will use Signature Version 4 for S3 in several cases:
187-
188-
* You're using an AWS region that only supports Signature Version 4. This
189-
includes ``eu-central-1`` and ``ap-northeast-2``.
190-
* You explicitly opt in and set ``signature_version = s3v4`` in your
191-
``~/.aws/config`` file.
192-
193-
Download
194-
~~~~~~~~
195-
196-
The AWS CLI will attempt to verify the checksum of downloads when possible,
197-
based on the ``ETag`` header returned from a ``GetObject`` request that's
198-
performed whenever the AWS CLI downloads objects from S3. If the calculated
199-
MD5 checksum does not match the expected checksum, the file is deleted
200-
and the download is retried. This process is retried up to 3 times.
201-
If a downloads fails, the AWS CLI will exit with a non zero RC.
202-
See ``aws help returncodes`` for more information.
203-
204-
There are several conditions where the CLI is *not* able to verify
205-
checksums on downloads:
206-
207-
* If the object was uploaded via multipart uploads
208-
* If the object was uploaded using server side encryption with KMS
209-
* If the object was uploaded using a customer provided encryption key
210-
* If the object is downloaded using range ``GetObject`` requests

‎awscli/topics/s3-faq.rst‎

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
:title: AWS CLI S3 FAQ
2+
:description: Frequented Asked Questions for Amazon S3 in the AWS CLI
3+
:category: S3
4+
:related command: s3 cp, s3 sync, s3 mv, s3 rm
5+
6+
7+
S3 FAQ
8+
======
9+
10+
Below are common questions regarding the use of Amazon S3 in the AWS CLI.
11+
12+
13+
Q: Does the AWS CLI validate checksums?
14+
---------------------------------------
15+
16+
The AWS CLI will perform checksum validation for uploading and downloading
17+
files in specific scenarios.
18+
19+
Upload
20+
~~~~~~
21+
22+
The AWS CLI will calculate and auto-populate the ``Content-MD5`` header for
23+
both standard and multipart uploads. If the checksum that S3 calculates does
24+
not match the ``Content-MD5`` provided, S3 will not store the object and
25+
instead will return an error message back the AWS CLI. The AWS CLI will retry
26+
this error up to 5 times before giving up. On the case that any files fail to
27+
transfer successfully to S3, the AWS CLI will exit with a non zero RC.
28+
See ``aws help returncodes`` for more information.
29+
30+
If the upload request is signed with Signature Version 4, then a
31+
``Content-MD5`` is not calculated. Instead, the AWS CLI uses the
32+
``x-amz-content-sha256`` header as a checksum instead of ``Content-MD5``.
33+
The AWS CLI will use Signature Version 4 for S3 in several cases:
34+
35+
* You're using an AWS region that only supports Signature Version 4. This
36+
includes ``eu-central-1`` and ``ap-northeast-2``.
37+
* You explicitly opt in and set ``signature_version = s3v4`` in your
38+
``~/.aws/config`` file.
39+
40+
Note that the AWS CLI will add a ``Content-MD5`` header for both
41+
the high level ``aws s3`` commands that perform uploads
42+
(``aws s3 cp``, ``aws s3 sync``) as well as the low level ``s3api``
43+
commands including ``aws s3api put-object`` and ``aws s3api upload-part``.
44+
45+
46+
Download
47+
~~~~~~~~
48+
49+
The AWS CLI will attempt to verify the checksum of downloads when possible,
50+
based on the ``ETag`` header returned from a ``GetObject`` request that's
51+
performed whenever the AWS CLI downloads objects from S3. If the calculated
52+
MD5 checksum does not match the expected checksum, the file is deleted
53+
and the download is retried. This process is retried up to 3 times.
54+
If a downloads fails, the AWS CLI will exit with a non zero RC.
55+
See ``aws help returncodes`` for more information.
56+
57+
There are several conditions where the CLI is *not* able to verify
58+
checksums on downloads:
59+
60+
* If the object was uploaded via multipart uploads
61+
* If the object was uploaded using server side encryption with KMS
62+
* If the object was uploaded using a customer provided encryption key
63+
* If the object is downloaded using range ``GetObject`` requests

‎awscli/topics/topic-tags.json‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,22 @@
5252
"title": [
5353
"AWS CLI S3 Configuration"
5454
]
55+
},
56+
"s3-faq": {
57+
"category": [
58+
"S3"
59+
],
60+
"description": [
61+
"Frequented Asked Questions for Amazon S3 in the AWS CLI"
62+
],
63+
"related command": [
64+
"s3 cp",
65+
"s3 sync",
66+
"s3 mv",
67+
"s3 rm"
68+
],
69+
"title": [
70+
"AWS CLI S3 FAQ"
71+
]
5572
}
5673
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL