1. Packages
  2. AWS Classic
  3. API Docs
  4. s3
  5. BucketPublicAccessBlock

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.23.0 published on Thursday, Feb 22, 2024 by Pulumi

aws.s3.BucketPublicAccessBlock

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.23.0 published on Thursday, Feb 22, 2024 by Pulumi

    Manages S3 bucket-level Public Access Block configuration. For more information about these settings, see the AWS S3 Block Public Access documentation.

    This resource cannot be used with S3 directory buckets.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleBucketV2 = new Aws.S3.BucketV2("exampleBucketV2");
    
        var exampleBucketPublicAccessBlock = new Aws.S3.BucketPublicAccessBlock("exampleBucketPublicAccessBlock", new()
        {
            Bucket = exampleBucketV2.Id,
            BlockPublicAcls = true,
            BlockPublicPolicy = true,
            IgnorePublicAcls = true,
            RestrictPublicBuckets = true,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleBucketV2, err := s3.NewBucketV2(ctx, "exampleBucketV2", nil)
    		if err != nil {
    			return err
    		}
    		_, err = s3.NewBucketPublicAccessBlock(ctx, "exampleBucketPublicAccessBlock", &s3.BucketPublicAccessBlockArgs{
    			Bucket:                exampleBucketV2.ID(),
    			BlockPublicAcls:       pulumi.Bool(true),
    			BlockPublicPolicy:     pulumi.Bool(true),
    			IgnorePublicAcls:      pulumi.Bool(true),
    			RestrictPublicBuckets: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.s3.BucketV2;
    import com.pulumi.aws.s3.BucketPublicAccessBlock;
    import com.pulumi.aws.s3.BucketPublicAccessBlockArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var exampleBucketV2 = new BucketV2("exampleBucketV2");
    
            var exampleBucketPublicAccessBlock = new BucketPublicAccessBlock("exampleBucketPublicAccessBlock", BucketPublicAccessBlockArgs.builder()        
                .bucket(exampleBucketV2.id())
                .blockPublicAcls(true)
                .blockPublicPolicy(true)
                .ignorePublicAcls(true)
                .restrictPublicBuckets(true)
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    example_bucket_v2 = aws.s3.BucketV2("exampleBucketV2")
    example_bucket_public_access_block = aws.s3.BucketPublicAccessBlock("exampleBucketPublicAccessBlock",
        bucket=example_bucket_v2.id,
        block_public_acls=True,
        block_public_policy=True,
        ignore_public_acls=True,
        restrict_public_buckets=True)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const exampleBucketV2 = new aws.s3.BucketV2("exampleBucketV2", {});
    const exampleBucketPublicAccessBlock = new aws.s3.BucketPublicAccessBlock("exampleBucketPublicAccessBlock", {
        bucket: exampleBucketV2.id,
        blockPublicAcls: true,
        blockPublicPolicy: true,
        ignorePublicAcls: true,
        restrictPublicBuckets: true,
    });
    
    resources:
      exampleBucketV2:
        type: aws:s3:BucketV2
      exampleBucketPublicAccessBlock:
        type: aws:s3:BucketPublicAccessBlock
        properties:
          bucket: ${exampleBucketV2.id}
          blockPublicAcls: true
          blockPublicPolicy: true
          ignorePublicAcls: true
          restrictPublicBuckets: true
    

    Create BucketPublicAccessBlock Resource

    new BucketPublicAccessBlock(name: string, args: BucketPublicAccessBlockArgs, opts?: CustomResourceOptions);
    @overload
    def BucketPublicAccessBlock(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                block_public_acls: Optional[bool] = None,
                                block_public_policy: Optional[bool] = None,
                                bucket: Optional[str] = None,
                                ignore_public_acls: Optional[bool] = None,
                                restrict_public_buckets: Optional[bool] = None)
    @overload
    def BucketPublicAccessBlock(resource_name: str,
                                args: BucketPublicAccessBlockArgs,
                                opts: Optional[ResourceOptions] = None)
    func NewBucketPublicAccessBlock(ctx *Context, name string, args BucketPublicAccessBlockArgs, opts ...ResourceOption) (*BucketPublicAccessBlock, error)
    public BucketPublicAccessBlock(string name, BucketPublicAccessBlockArgs args, CustomResourceOptions? opts = null)
    public BucketPublicAccessBlock(String name, BucketPublicAccessBlockArgs args)
    public BucketPublicAccessBlock(String name, BucketPublicAccessBlockArgs args, CustomResourceOptions options)
    
    type: aws:s3:BucketPublicAccessBlock
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args BucketPublicAccessBlockArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args BucketPublicAccessBlockArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args BucketPublicAccessBlockArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BucketPublicAccessBlockArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BucketPublicAccessBlockArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    BucketPublicAccessBlock Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The BucketPublicAccessBlock resource accepts the following input properties:

    Bucket string
    S3 Bucket to which this Public Access Block configuration should be applied.
    BlockPublicAcls bool
    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.
    BlockPublicPolicy bool
    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.
    IgnorePublicAcls bool
    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.
    RestrictPublicBuckets bool
    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.
    Bucket string
    S3 Bucket to which this Public Access Block configuration should be applied.
    BlockPublicAcls bool
    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.
    BlockPublicPolicy bool
    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.
    IgnorePublicAcls bool
    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.
    RestrictPublicBuckets bool
    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.
    bucket String
    S3 Bucket to which this Public Access Block configuration should be applied.
    blockPublicAcls Boolean
    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.
    blockPublicPolicy Boolean
    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.
    ignorePublicAcls Boolean
    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.
    restrictPublicBuckets Boolean
    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.
    bucket string
    S3 Bucket to which this Public Access Block configuration should be applied.
    blockPublicAcls boolean
    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.
    blockPublicPolicy boolean
    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.
    ignorePublicAcls boolean
    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.
    restrictPublicBuckets boolean
    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.
    bucket str
    S3 Bucket to which this Public Access Block configuration should be applied.
    block_public_acls bool
    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.
    block_public_policy bool
    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.
    ignore_public_acls bool
    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.
    restrict_public_buckets bool
    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.
    bucket String
    S3 Bucket to which this Public Access Block configuration should be applied.
    blockPublicAcls Boolean
    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.
    blockPublicPolicy Boolean
    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.
    ignorePublicAcls Boolean
    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.
    restrictPublicBuckets Boolean
    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.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the BucketPublicAccessBlock resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing BucketPublicAccessBlock Resource

    Get an existing BucketPublicAccessBlock resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: BucketPublicAccessBlockState, opts?: CustomResourceOptions): BucketPublicAccessBlock
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            block_public_acls: Optional[bool] = None,
            block_public_policy: Optional[bool] = None,
            bucket: Optional[str] = None,
            ignore_public_acls: Optional[bool] = None,
            restrict_public_buckets: Optional[bool] = None) -> BucketPublicAccessBlock
    func GetBucketPublicAccessBlock(ctx *Context, name string, id IDInput, state *BucketPublicAccessBlockState, opts ...ResourceOption) (*BucketPublicAccessBlock, error)
    public static BucketPublicAccessBlock Get(string name, Input<string> id, BucketPublicAccessBlockState? state, CustomResourceOptions? opts = null)
    public static BucketPublicAccessBlock get(String name, Output<String> id, BucketPublicAccessBlockState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    BlockPublicAcls bool
    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.
    BlockPublicPolicy bool
    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.
    Bucket string
    S3 Bucket to which this Public Access Block configuration should be applied.
    IgnorePublicAcls bool
    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.
    RestrictPublicBuckets bool
    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.
    BlockPublicAcls bool
    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.
    BlockPublicPolicy bool
    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.
    Bucket string
    S3 Bucket to which this Public Access Block configuration should be applied.
    IgnorePublicAcls bool
    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.
    RestrictPublicBuckets bool
    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.
    blockPublicAcls Boolean
    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.
    blockPublicPolicy Boolean
    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.
    bucket String
    S3 Bucket to which this Public Access Block configuration should be applied.
    ignorePublicAcls Boolean
    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.
    restrictPublicBuckets Boolean
    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.
    blockPublicAcls boolean
    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.
    blockPublicPolicy boolean
    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.
    bucket string
    S3 Bucket to which this Public Access Block configuration should be applied.
    ignorePublicAcls boolean
    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.
    restrictPublicBuckets boolean
    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.
    block_public_acls bool
    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.
    block_public_policy bool
    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.
    bucket str
    S3 Bucket to which this Public Access Block configuration should be applied.
    ignore_public_acls bool
    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.
    restrict_public_buckets bool
    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.
    blockPublicAcls Boolean
    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.
    blockPublicPolicy Boolean
    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.
    bucket String
    S3 Bucket to which this Public Access Block configuration should be applied.
    ignorePublicAcls Boolean
    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.
    restrictPublicBuckets Boolean
    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.

    Import

    Using pulumi import, import aws_s3_bucket_public_access_block using the bucket name. For example:

     $ pulumi import aws:s3/bucketPublicAccessBlock:BucketPublicAccessBlock example my-bucket
    

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.23.0 published on Thursday, Feb 22, 2024 by Pulumi