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

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

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.s3.AccountPublicAccessBlock

Explore with Pulumi AI

aws logo

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

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

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

    NOTE: Each AWS account may only have one S3 Public Access Block configuration. Multiple configurations of the resource against the same AWS account will cause a perpetual difference.

    Advanced usage: To use a custom API endpoint for this resource, use the s3control endpoint provider configuration, not the s3 endpoint provider configuration.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.s3.AccountPublicAccessBlock("example", {
        blockPublicAcls: true,
        blockPublicPolicy: true,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.s3.AccountPublicAccessBlock("example",
        block_public_acls=True,
        block_public_policy=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 {
    		_, err := s3.NewAccountPublicAccessBlock(ctx, "example", &s3.AccountPublicAccessBlockArgs{
    			BlockPublicAcls:   pulumi.Bool(true),
    			BlockPublicPolicy: 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.AccountPublicAccessBlock("example", new()
        {
            BlockPublicAcls = true,
            BlockPublicPolicy = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.s3.AccountPublicAccessBlock;
    import com.pulumi.aws.s3.AccountPublicAccessBlockArgs;
    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 AccountPublicAccessBlock("example", AccountPublicAccessBlockArgs.builder()
                .blockPublicAcls(true)
                .blockPublicPolicy(true)
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:s3:AccountPublicAccessBlock
        properties:
          blockPublicAcls: true
          blockPublicPolicy: true
    

    Create AccountPublicAccessBlock Resource

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

    Constructor syntax

    new AccountPublicAccessBlock(name: string, args?: AccountPublicAccessBlockArgs, opts?: CustomResourceOptions);
    @overload
    def AccountPublicAccessBlock(resource_name: str,
                                 args: Optional[AccountPublicAccessBlockArgs] = None,
                                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def AccountPublicAccessBlock(resource_name: str,
                                 opts: Optional[ResourceOptions] = None,
                                 account_id: 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 NewAccountPublicAccessBlock(ctx *Context, name string, args *AccountPublicAccessBlockArgs, opts ...ResourceOption) (*AccountPublicAccessBlock, error)
    public AccountPublicAccessBlock(string name, AccountPublicAccessBlockArgs? args = null, CustomResourceOptions? opts = null)
    public AccountPublicAccessBlock(String name, AccountPublicAccessBlockArgs args)
    public AccountPublicAccessBlock(String name, AccountPublicAccessBlockArgs args, CustomResourceOptions options)
    
    type: aws:s3:AccountPublicAccessBlock
    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 AccountPublicAccessBlockArgs
    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 AccountPublicAccessBlockArgs
    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 AccountPublicAccessBlockArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AccountPublicAccessBlockArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AccountPublicAccessBlockArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

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

    var accountPublicAccessBlockResource = new Aws.S3.AccountPublicAccessBlock("accountPublicAccessBlockResource", new()
    {
        AccountId = "string",
        BlockPublicAcls = false,
        BlockPublicPolicy = false,
        IgnorePublicAcls = false,
        RestrictPublicBuckets = false,
    });
    
    example, err := s3.NewAccountPublicAccessBlock(ctx, "accountPublicAccessBlockResource", &s3.AccountPublicAccessBlockArgs{
    	AccountId:             pulumi.String("string"),
    	BlockPublicAcls:       pulumi.Bool(false),
    	BlockPublicPolicy:     pulumi.Bool(false),
    	IgnorePublicAcls:      pulumi.Bool(false),
    	RestrictPublicBuckets: pulumi.Bool(false),
    })
    
    var accountPublicAccessBlockResource = new AccountPublicAccessBlock("accountPublicAccessBlockResource", AccountPublicAccessBlockArgs.builder()
        .accountId("string")
        .blockPublicAcls(false)
        .blockPublicPolicy(false)
        .ignorePublicAcls(false)
        .restrictPublicBuckets(false)
        .build());
    
    account_public_access_block_resource = aws.s3.AccountPublicAccessBlock("accountPublicAccessBlockResource",
        account_id="string",
        block_public_acls=False,
        block_public_policy=False,
        ignore_public_acls=False,
        restrict_public_buckets=False)
    
    const accountPublicAccessBlockResource = new aws.s3.AccountPublicAccessBlock("accountPublicAccessBlockResource", {
        accountId: "string",
        blockPublicAcls: false,
        blockPublicPolicy: false,
        ignorePublicAcls: false,
        restrictPublicBuckets: false,
    });
    
    type: aws:s3:AccountPublicAccessBlock
    properties:
        accountId: string
        blockPublicAcls: false
        blockPublicPolicy: false
        ignorePublicAcls: false
        restrictPublicBuckets: false
    

    AccountPublicAccessBlock 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 AccountPublicAccessBlock resource accepts the following input properties:

    AccountId string
    AWS account ID to configure. Defaults to automatically determined account ID of the this provider AWS provider.
    BlockPublicAcls bool
    Whether Amazon S3 should block public ACLs for buckets in this account. 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 fail if the request includes a public ACL.
    BlockPublicPolicy bool
    Whether Amazon S3 should block public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect existing bucket policies. 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 buckets in this account. 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 all public ACLs on buckets in this account and any objects that they contain.
    RestrictPublicBuckets bool
    Whether Amazon S3 should restrict public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect previously stored bucket policies, except that public and cross-account access within any 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 buckets with public policies.
    AccountId string
    AWS account ID to configure. Defaults to automatically determined account ID of the this provider AWS provider.
    BlockPublicAcls bool
    Whether Amazon S3 should block public ACLs for buckets in this account. 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 fail if the request includes a public ACL.
    BlockPublicPolicy bool
    Whether Amazon S3 should block public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect existing bucket policies. 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 buckets in this account. 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 all public ACLs on buckets in this account and any objects that they contain.
    RestrictPublicBuckets bool
    Whether Amazon S3 should restrict public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect previously stored bucket policies, except that public and cross-account access within any 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 buckets with public policies.
    accountId String
    AWS account ID to configure. Defaults to automatically determined account ID of the this provider AWS provider.
    blockPublicAcls Boolean
    Whether Amazon S3 should block public ACLs for buckets in this account. 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 fail if the request includes a public ACL.
    blockPublicPolicy Boolean
    Whether Amazon S3 should block public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect existing bucket policies. 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 buckets in this account. 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 all public ACLs on buckets in this account and any objects that they contain.
    restrictPublicBuckets Boolean
    Whether Amazon S3 should restrict public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect previously stored bucket policies, except that public and cross-account access within any 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 buckets with public policies.
    accountId string
    AWS account ID to configure. Defaults to automatically determined account ID of the this provider AWS provider.
    blockPublicAcls boolean
    Whether Amazon S3 should block public ACLs for buckets in this account. 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 fail if the request includes a public ACL.
    blockPublicPolicy boolean
    Whether Amazon S3 should block public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect existing bucket policies. 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 buckets in this account. 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 all public ACLs on buckets in this account and any objects that they contain.
    restrictPublicBuckets boolean
    Whether Amazon S3 should restrict public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect previously stored bucket policies, except that public and cross-account access within any 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 buckets with public policies.
    account_id str
    AWS account ID to configure. Defaults to automatically determined account ID of the this provider AWS provider.
    block_public_acls bool
    Whether Amazon S3 should block public ACLs for buckets in this account. 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 fail if the request includes a public ACL.
    block_public_policy bool
    Whether Amazon S3 should block public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect existing bucket policies. 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 buckets in this account. 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 all public ACLs on buckets in this account and any objects that they contain.
    restrict_public_buckets bool
    Whether Amazon S3 should restrict public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect previously stored bucket policies, except that public and cross-account access within any 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 buckets with public policies.
    accountId String
    AWS account ID to configure. Defaults to automatically determined account ID of the this provider AWS provider.
    blockPublicAcls Boolean
    Whether Amazon S3 should block public ACLs for buckets in this account. 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 fail if the request includes a public ACL.
    blockPublicPolicy Boolean
    Whether Amazon S3 should block public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect existing bucket policies. 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 buckets in this account. 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 all public ACLs on buckets in this account and any objects that they contain.
    restrictPublicBuckets Boolean
    Whether Amazon S3 should restrict public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect previously stored bucket policies, except that public and cross-account access within any 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 buckets with public policies.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AccountPublicAccessBlock 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 AccountPublicAccessBlock Resource

    Get an existing AccountPublicAccessBlock 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?: AccountPublicAccessBlockState, opts?: CustomResourceOptions): AccountPublicAccessBlock
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: 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) -> AccountPublicAccessBlock
    func GetAccountPublicAccessBlock(ctx *Context, name string, id IDInput, state *AccountPublicAccessBlockState, opts ...ResourceOption) (*AccountPublicAccessBlock, error)
    public static AccountPublicAccessBlock Get(string name, Input<string> id, AccountPublicAccessBlockState? state, CustomResourceOptions? opts = null)
    public static AccountPublicAccessBlock get(String name, Output<String> id, AccountPublicAccessBlockState 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:
    AccountId string
    AWS account ID to configure. Defaults to automatically determined account ID of the this provider AWS provider.
    BlockPublicAcls bool
    Whether Amazon S3 should block public ACLs for buckets in this account. 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 fail if the request includes a public ACL.
    BlockPublicPolicy bool
    Whether Amazon S3 should block public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect existing bucket policies. 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 buckets in this account. 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 all public ACLs on buckets in this account and any objects that they contain.
    RestrictPublicBuckets bool
    Whether Amazon S3 should restrict public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect previously stored bucket policies, except that public and cross-account access within any 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 buckets with public policies.
    AccountId string
    AWS account ID to configure. Defaults to automatically determined account ID of the this provider AWS provider.
    BlockPublicAcls bool
    Whether Amazon S3 should block public ACLs for buckets in this account. 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 fail if the request includes a public ACL.
    BlockPublicPolicy bool
    Whether Amazon S3 should block public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect existing bucket policies. 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 buckets in this account. 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 all public ACLs on buckets in this account and any objects that they contain.
    RestrictPublicBuckets bool
    Whether Amazon S3 should restrict public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect previously stored bucket policies, except that public and cross-account access within any 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 buckets with public policies.
    accountId String
    AWS account ID to configure. Defaults to automatically determined account ID of the this provider AWS provider.
    blockPublicAcls Boolean
    Whether Amazon S3 should block public ACLs for buckets in this account. 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 fail if the request includes a public ACL.
    blockPublicPolicy Boolean
    Whether Amazon S3 should block public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect existing bucket policies. 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 buckets in this account. 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 all public ACLs on buckets in this account and any objects that they contain.
    restrictPublicBuckets Boolean
    Whether Amazon S3 should restrict public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect previously stored bucket policies, except that public and cross-account access within any 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 buckets with public policies.
    accountId string
    AWS account ID to configure. Defaults to automatically determined account ID of the this provider AWS provider.
    blockPublicAcls boolean
    Whether Amazon S3 should block public ACLs for buckets in this account. 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 fail if the request includes a public ACL.
    blockPublicPolicy boolean
    Whether Amazon S3 should block public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect existing bucket policies. 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 buckets in this account. 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 all public ACLs on buckets in this account and any objects that they contain.
    restrictPublicBuckets boolean
    Whether Amazon S3 should restrict public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect previously stored bucket policies, except that public and cross-account access within any 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 buckets with public policies.
    account_id str
    AWS account ID to configure. Defaults to automatically determined account ID of the this provider AWS provider.
    block_public_acls bool
    Whether Amazon S3 should block public ACLs for buckets in this account. 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 fail if the request includes a public ACL.
    block_public_policy bool
    Whether Amazon S3 should block public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect existing bucket policies. 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 buckets in this account. 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 all public ACLs on buckets in this account and any objects that they contain.
    restrict_public_buckets bool
    Whether Amazon S3 should restrict public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect previously stored bucket policies, except that public and cross-account access within any 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 buckets with public policies.
    accountId String
    AWS account ID to configure. Defaults to automatically determined account ID of the this provider AWS provider.
    blockPublicAcls Boolean
    Whether Amazon S3 should block public ACLs for buckets in this account. 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 fail if the request includes a public ACL.
    blockPublicPolicy Boolean
    Whether Amazon S3 should block public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect existing bucket policies. 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 buckets in this account. 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 all public ACLs on buckets in this account and any objects that they contain.
    restrictPublicBuckets Boolean
    Whether Amazon S3 should restrict public bucket policies for buckets in this account. Defaults to false. Enabling this setting does not affect previously stored bucket policies, except that public and cross-account access within any 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 buckets with public policies.

    Import

    Using pulumi import, import aws_s3_account_public_access_block using the AWS account ID. For example:

    $ pulumi import aws:s3/accountPublicAccessBlock:AccountPublicAccessBlock example 123456789012
    

    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.42.0 published on Wednesday, Jun 26, 2024 by Pulumi