AccountPublicAccessBlock

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

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.S3.AccountPublicAccessBlock("example", new Aws.S3.AccountPublicAccessBlockArgs
        {
            BlockPublicAcls = true,
            BlockPublicPolicy = true,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/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
	})
}
import pulumi
import pulumi_aws as aws

example = aws.s3.AccountPublicAccessBlock("example",
    block_public_acls=True,
    block_public_policy=True)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.s3.AccountPublicAccessBlock("example", {
    blockPublicAcls: true,
    blockPublicPolicy: true,
});

Create a AccountPublicAccessBlock Resource

new AccountPublicAccessBlock(name: string, args?: AccountPublicAccessBlockArgs, opts?: CustomResourceOptions);
@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)
@overload
def AccountPublicAccessBlock(resource_name: str,
                             args: Optional[AccountPublicAccessBlockArgs] = None,
                             opts: Optional[ResourceOptions] = None)
func NewAccountPublicAccessBlock(ctx *Context, name string, args *AccountPublicAccessBlockArgs, opts ...ResourceOption) (*AccountPublicAccessBlock, error)
public AccountPublicAccessBlock(string name, AccountPublicAccessBlockArgs? args = null, CustomResourceOptions? opts = null)
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.

AccountPublicAccessBlock Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model 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 will fail if the request includes an object 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 will fail if the request includes an object 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 will fail if the request includes an object 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 will fail if the request includes an object 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.

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 str
The provider-assigned unique ID for this managed resource.

Look up an 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)
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.

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 will fail if the request includes an object 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 will fail if the request includes an object 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 will fail if the request includes an object 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 will fail if the request includes an object 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.

Import

aws_s3_account_public_access_block can be imported by using the AWS account ID, e.g.

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

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.