Class BucketPublicAccessBlock
Manages S3 bucket-level Public Access Block configuration. For more information about these settings, see the AWS S3 Block Public Access documentation.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var exampleBucket = new Aws.S3.Bucket("exampleBucket", new Aws.S3.BucketArgs
{
});
var exampleBucketPublicAccessBlock = new Aws.S3.BucketPublicAccessBlock("exampleBucketPublicAccessBlock", new Aws.S3.BucketPublicAccessBlockArgs
{
BlockPublicAcls = true,
BlockPublicPolicy = true,
Bucket = exampleBucket.Id,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.S3
Assembly: Pulumi.Aws.dll
Syntax
public class BucketPublicAccessBlock : CustomResource
Constructors
View SourceBucketPublicAccessBlock(String, BucketPublicAccessBlockArgs, CustomResourceOptions)
Create a BucketPublicAccessBlock resource with the given unique name, arguments, and options.
Declaration
public BucketPublicAccessBlock(string name, BucketPublicAccessBlockArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| BucketPublicAccessBlockArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceBlockPublicAcls
Whether Amazon S3 should block public ACLs for this bucket. Defaults to false. Enabling this setting does not affect existing policies or ACLs. When set to true causes the following behavior:
- PUT Bucket acl and PUT Object acl calls will fail if the specified ACL allows public access.
- PUT Object calls will fail if the request includes an object ACL.
Declaration
public Output<bool?> BlockPublicAcls { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
BlockPublicPolicy
Whether Amazon S3 should block public bucket policies for this bucket. Defaults to false. Enabling this setting does not affect the existing bucket policy. When set to true causes Amazon S3 to:
- Reject calls to PUT Bucket policy if the specified bucket policy allows public access.
Declaration
public Output<bool?> BlockPublicPolicy { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Bucket
S3 Bucket to which this Public Access Block configuration should be applied.
Declaration
public Output<string> Bucket { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
IgnorePublicAcls
Whether Amazon S3 should ignore public ACLs for this bucket. Defaults to false. Enabling this setting does not affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set. When set to true causes Amazon S3 to:
- Ignore public ACLs on this bucket and any objects that it contains.
Declaration
public Output<bool?> IgnorePublicAcls { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
RestrictPublicBuckets
Whether Amazon S3 should restrict public bucket policies for this bucket. Defaults to false. Enabling this setting does not affect the previously stored bucket policy, except that public and cross-account access within the public bucket policy, including non-public delegation to specific accounts, is blocked. When set to true:
- Only the bucket owner and AWS Services can access this buckets if it has a public policy.
Declaration
public Output<bool?> RestrictPublicBuckets { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Methods
View SourceGet(String, Input<String>, BucketPublicAccessBlockState, CustomResourceOptions)
Get an existing BucketPublicAccessBlock resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static BucketPublicAccessBlock Get(string name, Input<string> id, BucketPublicAccessBlockState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| BucketPublicAccessBlockState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| BucketPublicAccessBlock |