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
s3controlendpoint provider configuration, not thes3endpoint 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/v2/go/aws/s3"
"github.com/pulumi/pulumi/sdk/v2/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);def AccountPublicAccessBlock(resource_name, opts=None, account_id=None, block_public_acls=None, block_public_policy=None, ignore_public_acls=None, restrict_public_buckets=None, __props__=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.
- opts ResourceOptions
- A bag of options that control this 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:
- Account
Id string AWS account ID to configure. Defaults to automatically determined account ID of the this provider AWS provider.
- Block
Public boolAcls 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 totruecauses 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 boolPolicy 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 totruecauses Amazon S3 to: * Reject calls to PUT Bucket policy if the specified bucket policy allows public access.- Ignore
Public boolAcls 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 totruecauses Amazon S3 to: * Ignore all public ACLs on buckets in this account and any objects that they contain.- Restrict
Public boolBuckets 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 totrue: * Only the bucket owner and AWS Services can access buckets with public policies.
- Account
Id string AWS account ID to configure. Defaults to automatically determined account ID of the this provider AWS provider.
- Block
Public boolAcls 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 totruecauses 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 boolPolicy 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 totruecauses Amazon S3 to: * Reject calls to PUT Bucket policy if the specified bucket policy allows public access.- Ignore
Public boolAcls 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 totruecauses Amazon S3 to: * Ignore all public ACLs on buckets in this account and any objects that they contain.- Restrict
Public boolBuckets 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 totrue: * Only the bucket owner and AWS Services can access buckets with public policies.
- account
Id string AWS account ID to configure. Defaults to automatically determined account ID of the this provider AWS provider.
- block
Public booleanAcls 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 totruecauses 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 booleanPolicy 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 totruecauses Amazon S3 to: * Reject calls to PUT Bucket policy if the specified bucket policy allows public access.- ignore
Public booleanAcls 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 totruecauses Amazon S3 to: * Ignore all public ACLs on buckets in this account and any objects that they contain.- restrict
Public booleanBuckets 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 totrue: * 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_ boolacls 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 totruecauses 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_ boolpolicy 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 totruecauses Amazon S3 to: * Reject calls to PUT Bucket policy if the specified bucket policy allows public access.- ignore_
public_ boolacls 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 totruecauses Amazon S3 to: * Ignore all public ACLs on buckets in this account and any objects that they contain.- restrict_
public_ boolbuckets 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 totrue: * 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:
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): AccountPublicAccessBlockstatic get(resource_name, id, opts=None, account_id=None, block_public_acls=None, block_public_policy=None, ignore_public_acls=None, restrict_public_buckets=None, __props__=None);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:
- Account
Id string AWS account ID to configure. Defaults to automatically determined account ID of the this provider AWS provider.
- Block
Public boolAcls 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 totruecauses 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 boolPolicy 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 totruecauses Amazon S3 to: * Reject calls to PUT Bucket policy if the specified bucket policy allows public access.- Ignore
Public boolAcls 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 totruecauses Amazon S3 to: * Ignore all public ACLs on buckets in this account and any objects that they contain.- Restrict
Public boolBuckets 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 totrue: * Only the bucket owner and AWS Services can access buckets with public policies.
- Account
Id string AWS account ID to configure. Defaults to automatically determined account ID of the this provider AWS provider.
- Block
Public boolAcls 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 totruecauses 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 boolPolicy 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 totruecauses Amazon S3 to: * Reject calls to PUT Bucket policy if the specified bucket policy allows public access.- Ignore
Public boolAcls 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 totruecauses Amazon S3 to: * Ignore all public ACLs on buckets in this account and any objects that they contain.- Restrict
Public boolBuckets 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 totrue: * Only the bucket owner and AWS Services can access buckets with public policies.
- account
Id string AWS account ID to configure. Defaults to automatically determined account ID of the this provider AWS provider.
- block
Public booleanAcls 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 totruecauses 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 booleanPolicy 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 totruecauses Amazon S3 to: * Reject calls to PUT Bucket policy if the specified bucket policy allows public access.- ignore
Public booleanAcls 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 totruecauses Amazon S3 to: * Ignore all public ACLs on buckets in this account and any objects that they contain.- restrict
Public booleanBuckets 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 totrue: * 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_ boolacls 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 totruecauses 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_ boolpolicy 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 totruecauses Amazon S3 to: * Reject calls to PUT Bucket policy if the specified bucket policy allows public access.- ignore_
public_ boolacls 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 totruecauses Amazon S3 to: * Ignore all public ACLs on buckets in this account and any objects that they contain.- restrict_
public_ boolbuckets 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 totrue: * Only the bucket owner and AWS Services can access buckets with public policies.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.