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