account-public-access submodule manages the AWS account-level S3 Public Access Block configuration. These settings apply to all S3 buckets in the account and override individual bucket-level settings, providing a centralized way to enforce public access restrictions.
Module Reference
Input Variables
Whether to create this resource or not. Set to
false to conditionally skip the public access block configuration.AWS account ID. If not specified, the current account ID will be used automatically.
Whether Amazon S3 should block public ACLs for buckets in this account. When set to
true:PUT Bucket aclandPUT Object aclcalls fail if the specified ACL is public.PUT Objectcalls fail if the request includes a public ACL.- Existing public ACLs in the bucket are ignored.
Whether Amazon S3 should block public bucket policies for buckets in this account. When set to
true:PUT Bucket policycalls fail if the specified bucket policy allows public access.
Whether Amazon S3 should ignore public ACLs for buckets in this account. When set to
true:- S3 ignores all public ACLs on buckets and objects in this account.
Whether Amazon S3 should restrict public bucket policies for buckets in this account. When set to
true:- Only AWS service principals and authorized users within the account can access the bucket if it has a public policy.
- Cross-account access is denied for buckets with public policies.
Outputs
The AWS account ID for which the public access block configuration was applied.
Complete Example
This example fully blocks all public access at the account level, which is the recommended security posture for most AWS environments.Conditional Management
You can conditionally manage the account-level public access block using thecreate variable:

