Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[s3] Deprecate AWS_REDUCED_REDUNDANCY, AWS_S3_ENCRYPTION and AWS_PRELOAD_METADATA #829

Merged
merged 1 commit into from
Feb 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/backends/amazon-S3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ To allow ``django-admin.py`` collectstatic to automatically put your static file
``AWS_S3_ENCRYPTION`` (optional; default is ``False``)
Enable server-side file encryption while at rest.

.. deprecated:: 1.9

Support for this top level setting is deprecated. The functionality is still available by setting
ServerSideEncryption=AES256 in AWS_S3_OBJECT_PARAMETERS.

``AWS_S3_FILE_OVERWRITE`` (optional: default is ``True``)
By default files with the same name will overwrite each other. Set this to ``False`` to have extra characters appended.

Expand Down
21 changes: 21 additions & 0 deletions storages/backends/s3boto3.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,27 @@ def __init__(self, acl=None, bucket=None, **settings):
"Unset AWS_AUTO_CREATE_BUCKET (it defaults to False) to silence this warning.",
DeprecationWarning,
)
if self.reduced_redundancy:
warnings.warn(
"Support for AWS_REDUCED_REDUNDANCY will be removed in version 2.0. "
"Update now by adding StorageClass=REDUCED_REDUNDANCY to "
"AWS_S3_OBJECT_PARAMETERS. There are also several other possible values "
"for StorageClass available. Check the AWS & boto3 docs for more info.",
DeprecationWarning,
)
if self.encryption:
warnings.warn(
"Support for AWS_S3_ENCRYPTION will be removed in version 2.0. "
"Update now by adding ServerSideEncryption=AES256 to "
"AWS_S3_OBJECT_PARAMETERS. Doing so also easily allows using 'aws:kms' "
"for encryption. Check the AWS & boto3 docs for more info.",
DeprecationWarning,
)
if self.preload_metadata:
warnings.warn(
"Support for AWS_PRELOAD_METADATA will be removed in version 2.0. ",
DeprecationWarning,
)

check_location(self)

Expand Down