libZSservicesZSamazonka-s3ZSamazonka-s3
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.S3.PutObjectRetention

Description

Places an Object Retention configuration on an object. For more information, see Locking Objects. Users or accounts require the s3:PutObjectRetention permission in order to place an Object Retention configuration on objects. Bypassing a Governance Retention configuration requires the s3:BypassGovernanceRetention permission.

This action is not supported by Amazon S3 on Outposts.

Permissions

When the Object Lock retention mode is set to compliance, you need s3:PutObjectRetention and s3:BypassGovernanceRetention permissions. For other requests to PutObjectRetention, only s3:PutObjectRetention permissions are required.

Synopsis

Creating a Request

data PutObjectRetention Source #

See: newPutObjectRetention smart constructor.

Constructors

PutObjectRetention' 

Fields

  • retention :: Maybe ObjectLockRetention

    The container element for the Object Retention configuration.

  • versionId :: Maybe ObjectVersionId

    The version ID for the object that you want to apply this Object Retention configuration to.

  • requestPayer :: Maybe RequestPayer
     
  • contentMD5 :: Maybe Text

    The MD5 hash for the request body.

    For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

  • bypassGovernanceRetention :: Maybe Bool

    Indicates whether this action should bypass Governance-mode restrictions.

  • expectedBucketOwner :: Maybe Text

    The account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.

  • bucket :: BucketName

    The bucket name that contains the object you want to apply this Object Retention configuration to.

    When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.

  • key :: ObjectKey

    The key name for the object that you want to apply this Object Retention configuration to.

Instances

Instances details
Eq PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

Read PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

Show PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

Generic PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

Associated Types

type Rep PutObjectRetention :: Type -> Type #

NFData PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

Methods

rnf :: PutObjectRetention -> () #

Hashable PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

AWSRequest PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

Associated Types

type AWSResponse PutObjectRetention #

ToHeaders PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

ToPath PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

ToQuery PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

ToElement PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

type Rep PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

type AWSResponse PutObjectRetention Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

newPutObjectRetention Source #

Create a value of PutObjectRetention with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:retention:PutObjectRetention', putObjectRetention_retention - The container element for the Object Retention configuration.

$sel:versionId:PutObjectRetention', putObjectRetention_versionId - The version ID for the object that you want to apply this Object Retention configuration to.

$sel:requestPayer:PutObjectRetention', putObjectRetention_requestPayer - Undocumented member.

$sel:contentMD5:PutObjectRetention', putObjectRetention_contentMD5 - The MD5 hash for the request body.

For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

$sel:bypassGovernanceRetention:PutObjectRetention', putObjectRetention_bypassGovernanceRetention - Indicates whether this action should bypass Governance-mode restrictions.

$sel:expectedBucketOwner:PutObjectRetention', putObjectRetention_expectedBucketOwner - The account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.

$sel:bucket:PutObjectRetention', putObjectRetention_bucket - The bucket name that contains the object you want to apply this Object Retention configuration to.

When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.

$sel:key:PutObjectRetention', putObjectRetention_key - The key name for the object that you want to apply this Object Retention configuration to.

Request Lenses

putObjectRetention_retention :: Lens' PutObjectRetention (Maybe ObjectLockRetention) Source #

The container element for the Object Retention configuration.

putObjectRetention_versionId :: Lens' PutObjectRetention (Maybe ObjectVersionId) Source #

The version ID for the object that you want to apply this Object Retention configuration to.

putObjectRetention_contentMD5 :: Lens' PutObjectRetention (Maybe Text) Source #

The MD5 hash for the request body.

For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

putObjectRetention_bypassGovernanceRetention :: Lens' PutObjectRetention (Maybe Bool) Source #

Indicates whether this action should bypass Governance-mode restrictions.

putObjectRetention_expectedBucketOwner :: Lens' PutObjectRetention (Maybe Text) Source #

The account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.

putObjectRetention_bucket :: Lens' PutObjectRetention BucketName Source #

The bucket name that contains the object you want to apply this Object Retention configuration to.

When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.

putObjectRetention_key :: Lens' PutObjectRetention ObjectKey Source #

The key name for the object that you want to apply this Object Retention configuration to.

Destructuring the Response

data PutObjectRetentionResponse Source #

See: newPutObjectRetentionResponse smart constructor.

Constructors

PutObjectRetentionResponse' 

Fields

Instances

Instances details
Eq PutObjectRetentionResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

Read PutObjectRetentionResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

Show PutObjectRetentionResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

Generic PutObjectRetentionResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

Associated Types

type Rep PutObjectRetentionResponse :: Type -> Type #

NFData PutObjectRetentionResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

type Rep PutObjectRetentionResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectRetention

type Rep PutObjectRetentionResponse = D1 ('MetaData "PutObjectRetentionResponse" "Amazonka.S3.PutObjectRetention" "libZSservicesZSamazonka-s3ZSamazonka-s3" 'False) (C1 ('MetaCons "PutObjectRetentionResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "requestCharged") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe RequestCharged)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newPutObjectRetentionResponse Source #

Create a value of PutObjectRetentionResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:requestCharged:PutObjectRetentionResponse', putObjectRetentionResponse_requestCharged - Undocumented member.

$sel:httpStatus:PutObjectRetentionResponse', putObjectRetentionResponse_httpStatus - The response's http status code.

Response Lenses