/
teamsLocation.go
363 lines (308 loc) · 12.7 KB
/
teamsLocation.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
// 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 cloudflare
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Cloudflare Teams Location resource. Teams Locations are
// referenced when creating secure web gateway policies.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := cloudflare.NewTeamsLocation(ctx, "example", &cloudflare.TeamsLocationArgs{
// AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
// ClientDefault: pulumi.Bool(true),
// Name: pulumi.String("office"),
// Networks: cloudflare.TeamsLocationNetworkArray{
// &cloudflare.TeamsLocationNetworkArgs{
// Network: pulumi.String("203.0.113.1/32"),
// },
// &cloudflare.TeamsLocationNetworkArgs{
// Network: pulumi.String("203.0.113.2/32"),
// },
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// ```sh
// $ pulumi import cloudflare:index/teamsLocation:TeamsLocation example <account_id>/<teams_location_id>
// ```
type TeamsLocation struct {
pulumi.CustomResourceState
// The account identifier to target for the resource.
AccountId pulumi.StringOutput `pulumi:"accountId"`
// Indicator that anonymized logs are enabled.
AnonymizedLogsEnabled pulumi.BoolOutput `pulumi:"anonymizedLogsEnabled"`
// Indicator that this is the default location.
ClientDefault pulumi.BoolPtrOutput `pulumi:"clientDefault"`
// The FQDN that DoH clients should be pointed at.
DohSubdomain pulumi.StringOutput `pulumi:"dohSubdomain"`
// Client IP address.
Ip pulumi.StringOutput `pulumi:"ip"`
// IP to direct all IPv4 DNS queries to.
Ipv4Destination pulumi.StringOutput `pulumi:"ipv4Destination"`
// Name of the teams location.
Name pulumi.StringOutput `pulumi:"name"`
// The networks CIDRs that comprise the location.
Networks TeamsLocationNetworkArrayOutput `pulumi:"networks"`
PolicyIds pulumi.StringArrayOutput `pulumi:"policyIds"`
}
// NewTeamsLocation registers a new resource with the given unique name, arguments, and options.
func NewTeamsLocation(ctx *pulumi.Context,
name string, args *TeamsLocationArgs, opts ...pulumi.ResourceOption) (*TeamsLocation, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AccountId == nil {
return nil, errors.New("invalid value for required argument 'AccountId'")
}
if args.Name == nil {
return nil, errors.New("invalid value for required argument 'Name'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource TeamsLocation
err := ctx.RegisterResource("cloudflare:index/teamsLocation:TeamsLocation", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetTeamsLocation gets an existing TeamsLocation resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetTeamsLocation(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *TeamsLocationState, opts ...pulumi.ResourceOption) (*TeamsLocation, error) {
var resource TeamsLocation
err := ctx.ReadResource("cloudflare:index/teamsLocation:TeamsLocation", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering TeamsLocation resources.
type teamsLocationState struct {
// The account identifier to target for the resource.
AccountId *string `pulumi:"accountId"`
// Indicator that anonymized logs are enabled.
AnonymizedLogsEnabled *bool `pulumi:"anonymizedLogsEnabled"`
// Indicator that this is the default location.
ClientDefault *bool `pulumi:"clientDefault"`
// The FQDN that DoH clients should be pointed at.
DohSubdomain *string `pulumi:"dohSubdomain"`
// Client IP address.
Ip *string `pulumi:"ip"`
// IP to direct all IPv4 DNS queries to.
Ipv4Destination *string `pulumi:"ipv4Destination"`
// Name of the teams location.
Name *string `pulumi:"name"`
// The networks CIDRs that comprise the location.
Networks []TeamsLocationNetwork `pulumi:"networks"`
PolicyIds []string `pulumi:"policyIds"`
}
type TeamsLocationState struct {
// The account identifier to target for the resource.
AccountId pulumi.StringPtrInput
// Indicator that anonymized logs are enabled.
AnonymizedLogsEnabled pulumi.BoolPtrInput
// Indicator that this is the default location.
ClientDefault pulumi.BoolPtrInput
// The FQDN that DoH clients should be pointed at.
DohSubdomain pulumi.StringPtrInput
// Client IP address.
Ip pulumi.StringPtrInput
// IP to direct all IPv4 DNS queries to.
Ipv4Destination pulumi.StringPtrInput
// Name of the teams location.
Name pulumi.StringPtrInput
// The networks CIDRs that comprise the location.
Networks TeamsLocationNetworkArrayInput
PolicyIds pulumi.StringArrayInput
}
func (TeamsLocationState) ElementType() reflect.Type {
return reflect.TypeOf((*teamsLocationState)(nil)).Elem()
}
type teamsLocationArgs struct {
// The account identifier to target for the resource.
AccountId string `pulumi:"accountId"`
// Indicator that this is the default location.
ClientDefault *bool `pulumi:"clientDefault"`
// Name of the teams location.
Name string `pulumi:"name"`
// The networks CIDRs that comprise the location.
Networks []TeamsLocationNetwork `pulumi:"networks"`
}
// The set of arguments for constructing a TeamsLocation resource.
type TeamsLocationArgs struct {
// The account identifier to target for the resource.
AccountId pulumi.StringInput
// Indicator that this is the default location.
ClientDefault pulumi.BoolPtrInput
// Name of the teams location.
Name pulumi.StringInput
// The networks CIDRs that comprise the location.
Networks TeamsLocationNetworkArrayInput
}
func (TeamsLocationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*teamsLocationArgs)(nil)).Elem()
}
type TeamsLocationInput interface {
pulumi.Input
ToTeamsLocationOutput() TeamsLocationOutput
ToTeamsLocationOutputWithContext(ctx context.Context) TeamsLocationOutput
}
func (*TeamsLocation) ElementType() reflect.Type {
return reflect.TypeOf((**TeamsLocation)(nil)).Elem()
}
func (i *TeamsLocation) ToTeamsLocationOutput() TeamsLocationOutput {
return i.ToTeamsLocationOutputWithContext(context.Background())
}
func (i *TeamsLocation) ToTeamsLocationOutputWithContext(ctx context.Context) TeamsLocationOutput {
return pulumi.ToOutputWithContext(ctx, i).(TeamsLocationOutput)
}
// TeamsLocationArrayInput is an input type that accepts TeamsLocationArray and TeamsLocationArrayOutput values.
// You can construct a concrete instance of `TeamsLocationArrayInput` via:
//
// TeamsLocationArray{ TeamsLocationArgs{...} }
type TeamsLocationArrayInput interface {
pulumi.Input
ToTeamsLocationArrayOutput() TeamsLocationArrayOutput
ToTeamsLocationArrayOutputWithContext(context.Context) TeamsLocationArrayOutput
}
type TeamsLocationArray []TeamsLocationInput
func (TeamsLocationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*TeamsLocation)(nil)).Elem()
}
func (i TeamsLocationArray) ToTeamsLocationArrayOutput() TeamsLocationArrayOutput {
return i.ToTeamsLocationArrayOutputWithContext(context.Background())
}
func (i TeamsLocationArray) ToTeamsLocationArrayOutputWithContext(ctx context.Context) TeamsLocationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(TeamsLocationArrayOutput)
}
// TeamsLocationMapInput is an input type that accepts TeamsLocationMap and TeamsLocationMapOutput values.
// You can construct a concrete instance of `TeamsLocationMapInput` via:
//
// TeamsLocationMap{ "key": TeamsLocationArgs{...} }
type TeamsLocationMapInput interface {
pulumi.Input
ToTeamsLocationMapOutput() TeamsLocationMapOutput
ToTeamsLocationMapOutputWithContext(context.Context) TeamsLocationMapOutput
}
type TeamsLocationMap map[string]TeamsLocationInput
func (TeamsLocationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*TeamsLocation)(nil)).Elem()
}
func (i TeamsLocationMap) ToTeamsLocationMapOutput() TeamsLocationMapOutput {
return i.ToTeamsLocationMapOutputWithContext(context.Background())
}
func (i TeamsLocationMap) ToTeamsLocationMapOutputWithContext(ctx context.Context) TeamsLocationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(TeamsLocationMapOutput)
}
type TeamsLocationOutput struct{ *pulumi.OutputState }
func (TeamsLocationOutput) ElementType() reflect.Type {
return reflect.TypeOf((**TeamsLocation)(nil)).Elem()
}
func (o TeamsLocationOutput) ToTeamsLocationOutput() TeamsLocationOutput {
return o
}
func (o TeamsLocationOutput) ToTeamsLocationOutputWithContext(ctx context.Context) TeamsLocationOutput {
return o
}
// The account identifier to target for the resource.
func (o TeamsLocationOutput) AccountId() pulumi.StringOutput {
return o.ApplyT(func(v *TeamsLocation) pulumi.StringOutput { return v.AccountId }).(pulumi.StringOutput)
}
// Indicator that anonymized logs are enabled.
func (o TeamsLocationOutput) AnonymizedLogsEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v *TeamsLocation) pulumi.BoolOutput { return v.AnonymizedLogsEnabled }).(pulumi.BoolOutput)
}
// Indicator that this is the default location.
func (o TeamsLocationOutput) ClientDefault() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *TeamsLocation) pulumi.BoolPtrOutput { return v.ClientDefault }).(pulumi.BoolPtrOutput)
}
// The FQDN that DoH clients should be pointed at.
func (o TeamsLocationOutput) DohSubdomain() pulumi.StringOutput {
return o.ApplyT(func(v *TeamsLocation) pulumi.StringOutput { return v.DohSubdomain }).(pulumi.StringOutput)
}
// Client IP address.
func (o TeamsLocationOutput) Ip() pulumi.StringOutput {
return o.ApplyT(func(v *TeamsLocation) pulumi.StringOutput { return v.Ip }).(pulumi.StringOutput)
}
// IP to direct all IPv4 DNS queries to.
func (o TeamsLocationOutput) Ipv4Destination() pulumi.StringOutput {
return o.ApplyT(func(v *TeamsLocation) pulumi.StringOutput { return v.Ipv4Destination }).(pulumi.StringOutput)
}
// Name of the teams location.
func (o TeamsLocationOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *TeamsLocation) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The networks CIDRs that comprise the location.
func (o TeamsLocationOutput) Networks() TeamsLocationNetworkArrayOutput {
return o.ApplyT(func(v *TeamsLocation) TeamsLocationNetworkArrayOutput { return v.Networks }).(TeamsLocationNetworkArrayOutput)
}
func (o TeamsLocationOutput) PolicyIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v *TeamsLocation) pulumi.StringArrayOutput { return v.PolicyIds }).(pulumi.StringArrayOutput)
}
type TeamsLocationArrayOutput struct{ *pulumi.OutputState }
func (TeamsLocationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*TeamsLocation)(nil)).Elem()
}
func (o TeamsLocationArrayOutput) ToTeamsLocationArrayOutput() TeamsLocationArrayOutput {
return o
}
func (o TeamsLocationArrayOutput) ToTeamsLocationArrayOutputWithContext(ctx context.Context) TeamsLocationArrayOutput {
return o
}
func (o TeamsLocationArrayOutput) Index(i pulumi.IntInput) TeamsLocationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *TeamsLocation {
return vs[0].([]*TeamsLocation)[vs[1].(int)]
}).(TeamsLocationOutput)
}
type TeamsLocationMapOutput struct{ *pulumi.OutputState }
func (TeamsLocationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*TeamsLocation)(nil)).Elem()
}
func (o TeamsLocationMapOutput) ToTeamsLocationMapOutput() TeamsLocationMapOutput {
return o
}
func (o TeamsLocationMapOutput) ToTeamsLocationMapOutputWithContext(ctx context.Context) TeamsLocationMapOutput {
return o
}
func (o TeamsLocationMapOutput) MapIndex(k pulumi.StringInput) TeamsLocationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *TeamsLocation {
return vs[0].(map[string]*TeamsLocation)[vs[1].(string)]
}).(TeamsLocationOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*TeamsLocationInput)(nil)).Elem(), &TeamsLocation{})
pulumi.RegisterInputType(reflect.TypeOf((*TeamsLocationArrayInput)(nil)).Elem(), TeamsLocationArray{})
pulumi.RegisterInputType(reflect.TypeOf((*TeamsLocationMapInput)(nil)).Elem(), TeamsLocationMap{})
pulumi.RegisterOutputType(TeamsLocationOutput{})
pulumi.RegisterOutputType(TeamsLocationArrayOutput{})
pulumi.RegisterOutputType(TeamsLocationMapOutput{})
}