Table of Contents

Class PutBucketPolicyRequest

Namespace
Amazon.S3.Model
Assembly
AWSSDK.S3.dll

Container for the parameters to the PutBucketPolicy operation. Applies an Amazon S3 bucket policy to an Amazon S3 bucket. If you are using an identity other than the root user of the Amazon Web Services account that owns the bucket, the calling identity must have the

PutBucketPolicy
permissions on the specified bucket and belong to the bucket owner's account in order to use this operation.

If you don't have

PutBucketPolicy
permissions, Amazon S3 returns a
403
                                                                                            Access Denied
error. If you have the correct permissions, but you're not using an identity that belongs to the bucket owner's account, Amazon S3 returns a
405
                                                                                        Method Not Allowed
error.

As a security precaution, the root user of the Amazon Web Services account that owns a bucket can always use this operation, even if the policy explicitly denies the root user the ability to perform this action.

For more information, see Bucket policy examples.

The following operations are related to

PutBucketPolicy
:
public class PutBucketPolicyRequest : AmazonWebServiceRequest
Inheritance
PutBucketPolicyRequest

Constructors

PutBucketPolicyRequest()

public PutBucketPolicyRequest()

Properties

BucketName

The name of the bucket.

public string BucketName { get; set; }

Property Value

string

ChecksumAlgorithm

Gets and sets the property ChecksumAlgorithm.

Indicates the algorithm used to create the checksum for the object. Amazon S3 will fail the request with a 400 error if there is no checksum associated with the object. For more information, see Checking object integrity in the Amazon S3 User Guide.

public ChecksumAlgorithm ChecksumAlgorithm { get; set; }

Property Value

ChecksumAlgorithm

ConfirmRemoveSelfBucketAccess

Set this parameter to true to confirm that you want to remove your permissions to change this bucket policy in the future.

public bool ConfirmRemoveSelfBucketAccess { get; set; }

Property Value

bool

ContentMD5

Gets and sets the property ContentMD5.

The MD5 hash of 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.

public string ContentMD5 { get; set; }

Property Value

string

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.

public string ExpectedBucketOwner { get; set; }

Property Value

string

IncludeSHA256Header

Overriden to turn off sending SHA256 header.

protected override bool IncludeSHA256Header { get; }

Property Value

bool

Policy

The bucket policy as a JSON document.

public string Policy { get; set; }

Property Value

string