You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::S3::BucketPolicy
- Inherits:
-
Resources::Resource
- Object
- Resources::Resource
- Aws::S3::BucketPolicy
- Defined in:
- (unknown)
Instance Attribute Summary collapse
-
#bucket_name ⇒ String
readonly
-
#policy ⇒ String
readonly
The bucket policy as a JSON document.
Attributes inherited from Resources::Resource
Instance Method Summary collapse
-
#bucket ⇒ Bucket
-
#delete(options = {}) ⇒ Struct
This implementation of the DELETE operation uses the policy subresource to delete the policy of a specified bucket.
-
#initialize ⇒ Object
constructor
-
#put(options = {}) ⇒ Struct
Applies an Amazon S3 bucket policy to an Amazon S3 bucket.
Methods inherited from Resources::Resource
add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until
Methods included from Resources::OperationMethods
#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations
Constructor Details
Instance Attribute Details
#bucket_name ⇒ String (readonly)
#policy ⇒ String (readonly)
The bucket policy as a JSON document.
Instance Method Details
#bucket ⇒ Bucket
#delete(options = {}) ⇒ Struct
This implementation of the DELETE operation uses the policy subresource to delete the policy of a specified bucket. If you are using an identity other than the root user of the AWS account that owns the bucket, the calling identity must have the DeleteBucketPolicy
permissions on the specified bucket and belong to the bucket owner's account to use this operation.
If you don't have DeleteBucketPolicy
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 AWS 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 about bucket policies, see Using Bucket Policies and UserPolicies.
The following operations are related to DeleteBucketPolicy
#put(options = {}) ⇒ Struct
Applies an Amazon S3 bucket policy to an Amazon S3 bucket. If you are using an identity other than the root user of the AWS 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 AWS 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 about bucket policies, see Using Bucket Policies and User Policies.
The following operations are related to PutBucketPolicy
: