1. Packages
  2. AWS
  3. API Docs
  4. s3
  5. getAccountPublicAccessBlock
AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

aws.s3.getAccountPublicAccessBlock

Explore with Pulumi AI

The S3 account public access block data source returns account-level public access block configuration.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = aws.s3.getAccountPublicAccessBlock({});
Copy
import pulumi
import pulumi_aws as aws

example = aws.s3.get_account_public_access_block()
Copy
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.LookupAccountPublicAccessBlock(ctx, &s3.LookupAccountPublicAccessBlockArgs{}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = Aws.S3.GetAccountPublicAccessBlock.Invoke();

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.S3Functions;
import com.pulumi.aws.s3.inputs.GetAccountPublicAccessBlockArgs;
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) {
        final var example = S3Functions.getAccountPublicAccessBlock();

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: aws:s3:getAccountPublicAccessBlock
      arguments: {}
Copy

Using getAccountPublicAccessBlock

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getAccountPublicAccessBlock(args: GetAccountPublicAccessBlockArgs, opts?: InvokeOptions): Promise<GetAccountPublicAccessBlockResult>
function getAccountPublicAccessBlockOutput(args: GetAccountPublicAccessBlockOutputArgs, opts?: InvokeOptions): Output<GetAccountPublicAccessBlockResult>
Copy
def get_account_public_access_block(account_id: Optional[str] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetAccountPublicAccessBlockResult
def get_account_public_access_block_output(account_id: Optional[pulumi.Input[str]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetAccountPublicAccessBlockResult]
Copy
func LookupAccountPublicAccessBlock(ctx *Context, args *LookupAccountPublicAccessBlockArgs, opts ...InvokeOption) (*LookupAccountPublicAccessBlockResult, error)
func LookupAccountPublicAccessBlockOutput(ctx *Context, args *LookupAccountPublicAccessBlockOutputArgs, opts ...InvokeOption) LookupAccountPublicAccessBlockResultOutput
Copy

> Note: This function is named LookupAccountPublicAccessBlock in the Go SDK.

public static class GetAccountPublicAccessBlock 
{
    public static Task<GetAccountPublicAccessBlockResult> InvokeAsync(GetAccountPublicAccessBlockArgs args, InvokeOptions? opts = null)
    public static Output<GetAccountPublicAccessBlockResult> Invoke(GetAccountPublicAccessBlockInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetAccountPublicAccessBlockResult> getAccountPublicAccessBlock(GetAccountPublicAccessBlockArgs args, InvokeOptions options)
public static Output<GetAccountPublicAccessBlockResult> getAccountPublicAccessBlock(GetAccountPublicAccessBlockArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws:s3/getAccountPublicAccessBlock:getAccountPublicAccessBlock
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

AccountId string
AWS account ID to configure. Defaults to automatically determined account ID of the AWS provider.
AccountId string
AWS account ID to configure. Defaults to automatically determined account ID of the AWS provider.
accountId String
AWS account ID to configure. Defaults to automatically determined account ID of the AWS provider.
accountId string
AWS account ID to configure. Defaults to automatically determined account ID of the AWS provider.
account_id str
AWS account ID to configure. Defaults to automatically determined account ID of the AWS provider.
accountId String
AWS account ID to configure. Defaults to automatically determined account ID of the AWS provider.

getAccountPublicAccessBlock Result

The following output properties are available:

BlockPublicAcls bool
Whether or not Amazon S3 should block public ACLs for buckets in this account is enabled. Returns as true or false.
BlockPublicPolicy bool
Whether or not Amazon S3 should block public bucket policies for buckets in this account is enabled. Returns as true or false.
Id string
The provider-assigned unique ID for this managed resource.
IgnorePublicAcls bool
Whether or not Amazon S3 should ignore public ACLs for buckets in this account is enabled. Returns as true or false.
RestrictPublicBuckets bool
Whether or not Amazon S3 should restrict public bucket policies for buckets in this account is enabled. Returns as true or false.
AccountId string
BlockPublicAcls bool
Whether or not Amazon S3 should block public ACLs for buckets in this account is enabled. Returns as true or false.
BlockPublicPolicy bool
Whether or not Amazon S3 should block public bucket policies for buckets in this account is enabled. Returns as true or false.
Id string
The provider-assigned unique ID for this managed resource.
IgnorePublicAcls bool
Whether or not Amazon S3 should ignore public ACLs for buckets in this account is enabled. Returns as true or false.
RestrictPublicBuckets bool
Whether or not Amazon S3 should restrict public bucket policies for buckets in this account is enabled. Returns as true or false.
AccountId string
blockPublicAcls Boolean
Whether or not Amazon S3 should block public ACLs for buckets in this account is enabled. Returns as true or false.
blockPublicPolicy Boolean
Whether or not Amazon S3 should block public bucket policies for buckets in this account is enabled. Returns as true or false.
id String
The provider-assigned unique ID for this managed resource.
ignorePublicAcls Boolean
Whether or not Amazon S3 should ignore public ACLs for buckets in this account is enabled. Returns as true or false.
restrictPublicBuckets Boolean
Whether or not Amazon S3 should restrict public bucket policies for buckets in this account is enabled. Returns as true or false.
accountId String
blockPublicAcls boolean
Whether or not Amazon S3 should block public ACLs for buckets in this account is enabled. Returns as true or false.
blockPublicPolicy boolean
Whether or not Amazon S3 should block public bucket policies for buckets in this account is enabled. Returns as true or false.
id string
The provider-assigned unique ID for this managed resource.
ignorePublicAcls boolean
Whether or not Amazon S3 should ignore public ACLs for buckets in this account is enabled. Returns as true or false.
restrictPublicBuckets boolean
Whether or not Amazon S3 should restrict public bucket policies for buckets in this account is enabled. Returns as true or false.
accountId string
block_public_acls bool
Whether or not Amazon S3 should block public ACLs for buckets in this account is enabled. Returns as true or false.
block_public_policy bool
Whether or not Amazon S3 should block public bucket policies for buckets in this account is enabled. Returns as true or false.
id str
The provider-assigned unique ID for this managed resource.
ignore_public_acls bool
Whether or not Amazon S3 should ignore public ACLs for buckets in this account is enabled. Returns as true or false.
restrict_public_buckets bool
Whether or not Amazon S3 should restrict public bucket policies for buckets in this account is enabled. Returns as true or false.
account_id str
blockPublicAcls Boolean
Whether or not Amazon S3 should block public ACLs for buckets in this account is enabled. Returns as true or false.
blockPublicPolicy Boolean
Whether or not Amazon S3 should block public bucket policies for buckets in this account is enabled. Returns as true or false.
id String
The provider-assigned unique ID for this managed resource.
ignorePublicAcls Boolean
Whether or not Amazon S3 should ignore public ACLs for buckets in this account is enabled. Returns as true or false.
restrictPublicBuckets Boolean
Whether or not Amazon S3 should restrict public bucket policies for buckets in this account is enabled. Returns as true or false.
accountId String

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.