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.31.0 published on Monday, Apr 15, 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.31.0 published on Monday, Apr 15, 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

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.s3.BucketV2("example", {bucket: "example"});
    const exampleBucketPublicAccessBlock = new aws.s3.BucketPublicAccessBlock("example", {
        bucket: example.id,
        blockPublicAcls: true,
        blockPublicPolicy: true,
        ignorePublicAcls: true,
        restrictPublicBuckets: true,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.s3.BucketV2("example", bucket="example")
    example_bucket_public_access_block = aws.s3.BucketPublicAccessBlock("example",
        bucket=example.id,
        block_public_acls=True,
        block_public_policy=True,
        ignore_public_acls=True,
        restrict_public_buckets=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 {
    		example, err := s3.NewBucketV2(ctx, "example", &s3.BucketV2Args{
    			Bucket: pulumi.String("example"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = s3.NewBucketPublicAccessBlock(ctx, "example", &s3.BucketPublicAccessBlockArgs{
    			Bucket:                example.ID(),
    			BlockPublicAcls:       pulumi.Bool(true),
    			BlockPublicPolicy:     pulumi.Bool(true),
    			IgnorePublicAcls:      pulumi.Bool(true),
    			RestrictPublicBuckets: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.S3.BucketV2("example", new()
        {
            Bucket = "example",
        });
    
        var exampleBucketPublicAccessBlock = new Aws.S3.BucketPublicAccessBlock("example", new()
        {
            Bucket = example.Id,
            BlockPublicAcls = true,
            BlockPublicPolicy = true,
            IgnorePublicAcls = true,
            RestrictPublicBuckets = true,
        });
    
    });
    
    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.BucketV2Args;
    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 example = new BucketV2("example", BucketV2Args.builder()        
                .bucket("example")
                .build());
    
            var exampleBucketPublicAccessBlock = new BucketPublicAccessBlock("exampleBucketPublicAccessBlock", BucketPublicAccessBlockArgs.builder()        
                .bucket(example.id())
                .blockPublicAcls(true)
                .blockPublicPolicy(true)
                .ignorePublicAcls(true)
                .restrictPublicBuckets(true)
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:s3:BucketV2
        properties:
          bucket: example
      exampleBucketPublicAccessBlock:
        type: aws:s3:BucketPublicAccessBlock
        name: example
        properties:
          bucket: ${example.id}
          blockPublicAcls: true
          blockPublicPolicy: true
          ignorePublicAcls: true
          restrictPublicBuckets: true
    

    Create BucketPublicAccessBlock Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new BucketPublicAccessBlock(name: string, args: BucketPublicAccessBlockArgs, opts?: CustomResourceOptions);
    @overload
    def BucketPublicAccessBlock(resource_name: str,
                                args: BucketPublicAccessBlockArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def BucketPublicAccessBlock(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                bucket: Optional[str] = None,
                                block_public_acls: Optional[bool] = None,
                                block_public_policy: Optional[bool] = None,
                                ignore_public_acls: Optional[bool] = None,
                                restrict_public_buckets: Optional[bool] = 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.
    
    

    Parameters

    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.

    Example

    The following reference example uses placeholder values for all input properties.

    var bucketPublicAccessBlockResource = new Aws.S3.BucketPublicAccessBlock("bucketPublicAccessBlockResource", new()
    {
        Bucket = "string",
        BlockPublicAcls = false,
        BlockPublicPolicy = false,
        IgnorePublicAcls = false,
        RestrictPublicBuckets = false,
    });
    
    example, err := s3.NewBucketPublicAccessBlock(ctx, "bucketPublicAccessBlockResource", &s3.BucketPublicAccessBlockArgs{
    	Bucket:                pulumi.String("string"),
    	BlockPublicAcls:       pulumi.Bool(false),
    	BlockPublicPolicy:     pulumi.Bool(false),
    	IgnorePublicAcls:      pulumi.Bool(false),
    	RestrictPublicBuckets: pulumi.Bool(false),
    })
    
    var bucketPublicAccessBlockResource = new BucketPublicAccessBlock("bucketPublicAccessBlockResource", BucketPublicAccessBlockArgs.builder()        
        .bucket("string")
        .blockPublicAcls(false)
        .blockPublicPolicy(false)
        .ignorePublicAcls(false)
        .restrictPublicBuckets(false)
        .build());
    
    bucket_public_access_block_resource = aws.s3.BucketPublicAccessBlock("bucketPublicAccessBlockResource",
        bucket="string",
        block_public_acls=False,
        block_public_policy=False,
        ignore_public_acls=False,
        restrict_public_buckets=False)
    
    const bucketPublicAccessBlockResource = new aws.s3.BucketPublicAccessBlock("bucketPublicAccessBlockResource", {
        bucket: "string",
        blockPublicAcls: false,
        blockPublicPolicy: false,
        ignorePublicAcls: false,
        restrictPublicBuckets: false,
    });
    
    type: aws:s3:BucketPublicAccessBlock
    properties:
        blockPublicAcls: false
        blockPublicPolicy: false
        bucket: string
        ignorePublicAcls: false
        restrictPublicBuckets: false
    

    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
    

    To learn more about importing existing cloud resources, see Importing resources.

    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.31.0 published on Monday, Apr 15, 2024 by Pulumi