github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/s3/getAccountPublicAccessBlock.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package s3 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // The S3 account public access block data source returns account-level public access block configuration. 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // _, err := s3.LookupAccountPublicAccessBlock(ctx, nil, nil) 32 // if err != nil { 33 // return err 34 // } 35 // return nil 36 // }) 37 // } 38 // 39 // ``` 40 // <!--End PulumiCodeChooser --> 41 func LookupAccountPublicAccessBlock(ctx *pulumi.Context, args *LookupAccountPublicAccessBlockArgs, opts ...pulumi.InvokeOption) (*LookupAccountPublicAccessBlockResult, error) { 42 opts = internal.PkgInvokeDefaultOpts(opts) 43 var rv LookupAccountPublicAccessBlockResult 44 err := ctx.Invoke("aws:s3/getAccountPublicAccessBlock:getAccountPublicAccessBlock", args, &rv, opts...) 45 if err != nil { 46 return nil, err 47 } 48 return &rv, nil 49 } 50 51 // A collection of arguments for invoking getAccountPublicAccessBlock. 52 type LookupAccountPublicAccessBlockArgs struct { 53 // AWS account ID to configure. Defaults to automatically determined account ID of the AWS provider. 54 AccountId *string `pulumi:"accountId"` 55 } 56 57 // A collection of values returned by getAccountPublicAccessBlock. 58 type LookupAccountPublicAccessBlockResult struct { 59 AccountId *string `pulumi:"accountId"` 60 // Whether or not Amazon S3 should block public ACLs for buckets in this account is enabled. Returns as `true` or `false`. 61 BlockPublicAcls bool `pulumi:"blockPublicAcls"` 62 // Whether or not Amazon S3 should block public bucket policies for buckets in this account is enabled. Returns as `true` or `false`. 63 BlockPublicPolicy bool `pulumi:"blockPublicPolicy"` 64 // The provider-assigned unique ID for this managed resource. 65 Id string `pulumi:"id"` 66 // Whether or not Amazon S3 should ignore public ACLs for buckets in this account is enabled. Returns as `true` or `false`. 67 IgnorePublicAcls bool `pulumi:"ignorePublicAcls"` 68 // Whether or not Amazon S3 should restrict public bucket policies for buckets in this account is enabled. Returns as `true` or `false`. 69 RestrictPublicBuckets bool `pulumi:"restrictPublicBuckets"` 70 } 71 72 func LookupAccountPublicAccessBlockOutput(ctx *pulumi.Context, args LookupAccountPublicAccessBlockOutputArgs, opts ...pulumi.InvokeOption) LookupAccountPublicAccessBlockResultOutput { 73 return pulumi.ToOutputWithContext(context.Background(), args). 74 ApplyT(func(v interface{}) (LookupAccountPublicAccessBlockResult, error) { 75 args := v.(LookupAccountPublicAccessBlockArgs) 76 r, err := LookupAccountPublicAccessBlock(ctx, &args, opts...) 77 var s LookupAccountPublicAccessBlockResult 78 if r != nil { 79 s = *r 80 } 81 return s, err 82 }).(LookupAccountPublicAccessBlockResultOutput) 83 } 84 85 // A collection of arguments for invoking getAccountPublicAccessBlock. 86 type LookupAccountPublicAccessBlockOutputArgs struct { 87 // AWS account ID to configure. Defaults to automatically determined account ID of the AWS provider. 88 AccountId pulumi.StringPtrInput `pulumi:"accountId"` 89 } 90 91 func (LookupAccountPublicAccessBlockOutputArgs) ElementType() reflect.Type { 92 return reflect.TypeOf((*LookupAccountPublicAccessBlockArgs)(nil)).Elem() 93 } 94 95 // A collection of values returned by getAccountPublicAccessBlock. 96 type LookupAccountPublicAccessBlockResultOutput struct{ *pulumi.OutputState } 97 98 func (LookupAccountPublicAccessBlockResultOutput) ElementType() reflect.Type { 99 return reflect.TypeOf((*LookupAccountPublicAccessBlockResult)(nil)).Elem() 100 } 101 102 func (o LookupAccountPublicAccessBlockResultOutput) ToLookupAccountPublicAccessBlockResultOutput() LookupAccountPublicAccessBlockResultOutput { 103 return o 104 } 105 106 func (o LookupAccountPublicAccessBlockResultOutput) ToLookupAccountPublicAccessBlockResultOutputWithContext(ctx context.Context) LookupAccountPublicAccessBlockResultOutput { 107 return o 108 } 109 110 func (o LookupAccountPublicAccessBlockResultOutput) AccountId() pulumi.StringPtrOutput { 111 return o.ApplyT(func(v LookupAccountPublicAccessBlockResult) *string { return v.AccountId }).(pulumi.StringPtrOutput) 112 } 113 114 // Whether or not Amazon S3 should block public ACLs for buckets in this account is enabled. Returns as `true` or `false`. 115 func (o LookupAccountPublicAccessBlockResultOutput) BlockPublicAcls() pulumi.BoolOutput { 116 return o.ApplyT(func(v LookupAccountPublicAccessBlockResult) bool { return v.BlockPublicAcls }).(pulumi.BoolOutput) 117 } 118 119 // Whether or not Amazon S3 should block public bucket policies for buckets in this account is enabled. Returns as `true` or `false`. 120 func (o LookupAccountPublicAccessBlockResultOutput) BlockPublicPolicy() pulumi.BoolOutput { 121 return o.ApplyT(func(v LookupAccountPublicAccessBlockResult) bool { return v.BlockPublicPolicy }).(pulumi.BoolOutput) 122 } 123 124 // The provider-assigned unique ID for this managed resource. 125 func (o LookupAccountPublicAccessBlockResultOutput) Id() pulumi.StringOutput { 126 return o.ApplyT(func(v LookupAccountPublicAccessBlockResult) string { return v.Id }).(pulumi.StringOutput) 127 } 128 129 // Whether or not Amazon S3 should ignore public ACLs for buckets in this account is enabled. Returns as `true` or `false`. 130 func (o LookupAccountPublicAccessBlockResultOutput) IgnorePublicAcls() pulumi.BoolOutput { 131 return o.ApplyT(func(v LookupAccountPublicAccessBlockResult) bool { return v.IgnorePublicAcls }).(pulumi.BoolOutput) 132 } 133 134 // Whether or not Amazon S3 should restrict public bucket policies for buckets in this account is enabled. Returns as `true` or `false`. 135 func (o LookupAccountPublicAccessBlockResultOutput) RestrictPublicBuckets() pulumi.BoolOutput { 136 return o.ApplyT(func(v LookupAccountPublicAccessBlockResult) bool { return v.RestrictPublicBuckets }).(pulumi.BoolOutput) 137 } 138 139 func init() { 140 pulumi.RegisterOutputType(LookupAccountPublicAccessBlockResultOutput{}) 141 }