/
mfaPolicyRule.go
396 lines (338 loc) · 16 KB
/
mfaPolicyRule.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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
// 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 deprecated
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Deprecated: Deprecated. Use policy.RuleMfa instead. This resource will be removed in version 4.0 of this provider.
type MfaPolicyRule struct {
pulumi.CustomResourceState
// Applications to exclude
AppExcludes MfaPolicyRuleAppExcludeArrayOutput `pulumi:"appExcludes"`
// Applications to include
AppIncludes MfaPolicyRuleAppIncludeArrayOutput `pulumi:"appIncludes"`
// Should the user be enrolled the first time they LOGIN, the next time they are CHALLENGED, or NEVER?
Enroll pulumi.StringPtrOutput `pulumi:"enroll"`
// Policy Rule Name
Name pulumi.StringOutput `pulumi:"name"`
// Network selection mode: ANYWHERE, ZONE, ON_NETWORK, or OFF_NETWORK.
NetworkConnection pulumi.StringPtrOutput `pulumi:"networkConnection"`
// The zones to exclude
NetworkExcludes pulumi.StringArrayOutput `pulumi:"networkExcludes"`
// The zones to include
NetworkIncludes pulumi.StringArrayOutput `pulumi:"networkIncludes"`
// Policy ID of the Rule
PolicyId pulumi.StringPtrOutput `pulumi:"policyId"`
// Policy ID of the Rule
//
// Deprecated: Because of incorrect naming, 'policyid' field will be deprecated and then removed in the next versions of the provider. Please use 'policy_id' instead
Policyid pulumi.StringPtrOutput `pulumi:"policyid"`
// Policy Rule Priority, this attribute can be set to a valid priority. To avoid endless diff situation we error if an
// invalid priority is provided. API defaults it to the last (lowest) if not there.
Priority pulumi.IntPtrOutput `pulumi:"priority"`
// Policy Rule Status: ACTIVE or INACTIVE.
Status pulumi.StringPtrOutput `pulumi:"status"`
// Set of User IDs to Exclude
UsersExcludeds pulumi.StringArrayOutput `pulumi:"usersExcludeds"`
}
// NewMfaPolicyRule registers a new resource with the given unique name, arguments, and options.
func NewMfaPolicyRule(ctx *pulumi.Context,
name string, args *MfaPolicyRuleArgs, opts ...pulumi.ResourceOption) (*MfaPolicyRule, error) {
if args == nil {
args = &MfaPolicyRuleArgs{}
}
var resource MfaPolicyRule
err := ctx.RegisterResource("okta:deprecated/mfaPolicyRule:MfaPolicyRule", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetMfaPolicyRule gets an existing MfaPolicyRule 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 GetMfaPolicyRule(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *MfaPolicyRuleState, opts ...pulumi.ResourceOption) (*MfaPolicyRule, error) {
var resource MfaPolicyRule
err := ctx.ReadResource("okta:deprecated/mfaPolicyRule:MfaPolicyRule", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering MfaPolicyRule resources.
type mfaPolicyRuleState struct {
// Applications to exclude
AppExcludes []MfaPolicyRuleAppExclude `pulumi:"appExcludes"`
// Applications to include
AppIncludes []MfaPolicyRuleAppInclude `pulumi:"appIncludes"`
// Should the user be enrolled the first time they LOGIN, the next time they are CHALLENGED, or NEVER?
Enroll *string `pulumi:"enroll"`
// Policy Rule Name
Name *string `pulumi:"name"`
// Network selection mode: ANYWHERE, ZONE, ON_NETWORK, or OFF_NETWORK.
NetworkConnection *string `pulumi:"networkConnection"`
// The zones to exclude
NetworkExcludes []string `pulumi:"networkExcludes"`
// The zones to include
NetworkIncludes []string `pulumi:"networkIncludes"`
// Policy ID of the Rule
PolicyId *string `pulumi:"policyId"`
// Policy ID of the Rule
//
// Deprecated: Because of incorrect naming, 'policyid' field will be deprecated and then removed in the next versions of the provider. Please use 'policy_id' instead
Policyid *string `pulumi:"policyid"`
// Policy Rule Priority, this attribute can be set to a valid priority. To avoid endless diff situation we error if an
// invalid priority is provided. API defaults it to the last (lowest) if not there.
Priority *int `pulumi:"priority"`
// Policy Rule Status: ACTIVE or INACTIVE.
Status *string `pulumi:"status"`
// Set of User IDs to Exclude
UsersExcludeds []string `pulumi:"usersExcludeds"`
}
type MfaPolicyRuleState struct {
// Applications to exclude
AppExcludes MfaPolicyRuleAppExcludeArrayInput
// Applications to include
AppIncludes MfaPolicyRuleAppIncludeArrayInput
// Should the user be enrolled the first time they LOGIN, the next time they are CHALLENGED, or NEVER?
Enroll pulumi.StringPtrInput
// Policy Rule Name
Name pulumi.StringPtrInput
// Network selection mode: ANYWHERE, ZONE, ON_NETWORK, or OFF_NETWORK.
NetworkConnection pulumi.StringPtrInput
// The zones to exclude
NetworkExcludes pulumi.StringArrayInput
// The zones to include
NetworkIncludes pulumi.StringArrayInput
// Policy ID of the Rule
PolicyId pulumi.StringPtrInput
// Policy ID of the Rule
//
// Deprecated: Because of incorrect naming, 'policyid' field will be deprecated and then removed in the next versions of the provider. Please use 'policy_id' instead
Policyid pulumi.StringPtrInput
// Policy Rule Priority, this attribute can be set to a valid priority. To avoid endless diff situation we error if an
// invalid priority is provided. API defaults it to the last (lowest) if not there.
Priority pulumi.IntPtrInput
// Policy Rule Status: ACTIVE or INACTIVE.
Status pulumi.StringPtrInput
// Set of User IDs to Exclude
UsersExcludeds pulumi.StringArrayInput
}
func (MfaPolicyRuleState) ElementType() reflect.Type {
return reflect.TypeOf((*mfaPolicyRuleState)(nil)).Elem()
}
type mfaPolicyRuleArgs struct {
// Applications to exclude
AppExcludes []MfaPolicyRuleAppExclude `pulumi:"appExcludes"`
// Applications to include
AppIncludes []MfaPolicyRuleAppInclude `pulumi:"appIncludes"`
// Should the user be enrolled the first time they LOGIN, the next time they are CHALLENGED, or NEVER?
Enroll *string `pulumi:"enroll"`
// Policy Rule Name
Name *string `pulumi:"name"`
// Network selection mode: ANYWHERE, ZONE, ON_NETWORK, or OFF_NETWORK.
NetworkConnection *string `pulumi:"networkConnection"`
// The zones to exclude
NetworkExcludes []string `pulumi:"networkExcludes"`
// The zones to include
NetworkIncludes []string `pulumi:"networkIncludes"`
// Policy ID of the Rule
PolicyId *string `pulumi:"policyId"`
// Policy ID of the Rule
//
// Deprecated: Because of incorrect naming, 'policyid' field will be deprecated and then removed in the next versions of the provider. Please use 'policy_id' instead
Policyid *string `pulumi:"policyid"`
// Policy Rule Priority, this attribute can be set to a valid priority. To avoid endless diff situation we error if an
// invalid priority is provided. API defaults it to the last (lowest) if not there.
Priority *int `pulumi:"priority"`
// Policy Rule Status: ACTIVE or INACTIVE.
Status *string `pulumi:"status"`
// Set of User IDs to Exclude
UsersExcludeds []string `pulumi:"usersExcludeds"`
}
// The set of arguments for constructing a MfaPolicyRule resource.
type MfaPolicyRuleArgs struct {
// Applications to exclude
AppExcludes MfaPolicyRuleAppExcludeArrayInput
// Applications to include
AppIncludes MfaPolicyRuleAppIncludeArrayInput
// Should the user be enrolled the first time they LOGIN, the next time they are CHALLENGED, or NEVER?
Enroll pulumi.StringPtrInput
// Policy Rule Name
Name pulumi.StringPtrInput
// Network selection mode: ANYWHERE, ZONE, ON_NETWORK, or OFF_NETWORK.
NetworkConnection pulumi.StringPtrInput
// The zones to exclude
NetworkExcludes pulumi.StringArrayInput
// The zones to include
NetworkIncludes pulumi.StringArrayInput
// Policy ID of the Rule
PolicyId pulumi.StringPtrInput
// Policy ID of the Rule
//
// Deprecated: Because of incorrect naming, 'policyid' field will be deprecated and then removed in the next versions of the provider. Please use 'policy_id' instead
Policyid pulumi.StringPtrInput
// Policy Rule Priority, this attribute can be set to a valid priority. To avoid endless diff situation we error if an
// invalid priority is provided. API defaults it to the last (lowest) if not there.
Priority pulumi.IntPtrInput
// Policy Rule Status: ACTIVE or INACTIVE.
Status pulumi.StringPtrInput
// Set of User IDs to Exclude
UsersExcludeds pulumi.StringArrayInput
}
func (MfaPolicyRuleArgs) ElementType() reflect.Type {
return reflect.TypeOf((*mfaPolicyRuleArgs)(nil)).Elem()
}
type MfaPolicyRuleInput interface {
pulumi.Input
ToMfaPolicyRuleOutput() MfaPolicyRuleOutput
ToMfaPolicyRuleOutputWithContext(ctx context.Context) MfaPolicyRuleOutput
}
func (*MfaPolicyRule) ElementType() reflect.Type {
return reflect.TypeOf((**MfaPolicyRule)(nil)).Elem()
}
func (i *MfaPolicyRule) ToMfaPolicyRuleOutput() MfaPolicyRuleOutput {
return i.ToMfaPolicyRuleOutputWithContext(context.Background())
}
func (i *MfaPolicyRule) ToMfaPolicyRuleOutputWithContext(ctx context.Context) MfaPolicyRuleOutput {
return pulumi.ToOutputWithContext(ctx, i).(MfaPolicyRuleOutput)
}
// MfaPolicyRuleArrayInput is an input type that accepts MfaPolicyRuleArray and MfaPolicyRuleArrayOutput values.
// You can construct a concrete instance of `MfaPolicyRuleArrayInput` via:
//
// MfaPolicyRuleArray{ MfaPolicyRuleArgs{...} }
type MfaPolicyRuleArrayInput interface {
pulumi.Input
ToMfaPolicyRuleArrayOutput() MfaPolicyRuleArrayOutput
ToMfaPolicyRuleArrayOutputWithContext(context.Context) MfaPolicyRuleArrayOutput
}
type MfaPolicyRuleArray []MfaPolicyRuleInput
func (MfaPolicyRuleArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*MfaPolicyRule)(nil)).Elem()
}
func (i MfaPolicyRuleArray) ToMfaPolicyRuleArrayOutput() MfaPolicyRuleArrayOutput {
return i.ToMfaPolicyRuleArrayOutputWithContext(context.Background())
}
func (i MfaPolicyRuleArray) ToMfaPolicyRuleArrayOutputWithContext(ctx context.Context) MfaPolicyRuleArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(MfaPolicyRuleArrayOutput)
}
// MfaPolicyRuleMapInput is an input type that accepts MfaPolicyRuleMap and MfaPolicyRuleMapOutput values.
// You can construct a concrete instance of `MfaPolicyRuleMapInput` via:
//
// MfaPolicyRuleMap{ "key": MfaPolicyRuleArgs{...} }
type MfaPolicyRuleMapInput interface {
pulumi.Input
ToMfaPolicyRuleMapOutput() MfaPolicyRuleMapOutput
ToMfaPolicyRuleMapOutputWithContext(context.Context) MfaPolicyRuleMapOutput
}
type MfaPolicyRuleMap map[string]MfaPolicyRuleInput
func (MfaPolicyRuleMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*MfaPolicyRule)(nil)).Elem()
}
func (i MfaPolicyRuleMap) ToMfaPolicyRuleMapOutput() MfaPolicyRuleMapOutput {
return i.ToMfaPolicyRuleMapOutputWithContext(context.Background())
}
func (i MfaPolicyRuleMap) ToMfaPolicyRuleMapOutputWithContext(ctx context.Context) MfaPolicyRuleMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(MfaPolicyRuleMapOutput)
}
type MfaPolicyRuleOutput struct{ *pulumi.OutputState }
func (MfaPolicyRuleOutput) ElementType() reflect.Type {
return reflect.TypeOf((**MfaPolicyRule)(nil)).Elem()
}
func (o MfaPolicyRuleOutput) ToMfaPolicyRuleOutput() MfaPolicyRuleOutput {
return o
}
func (o MfaPolicyRuleOutput) ToMfaPolicyRuleOutputWithContext(ctx context.Context) MfaPolicyRuleOutput {
return o
}
// Applications to exclude
func (o MfaPolicyRuleOutput) AppExcludes() MfaPolicyRuleAppExcludeArrayOutput {
return o.ApplyT(func(v *MfaPolicyRule) MfaPolicyRuleAppExcludeArrayOutput { return v.AppExcludes }).(MfaPolicyRuleAppExcludeArrayOutput)
}
// Applications to include
func (o MfaPolicyRuleOutput) AppIncludes() MfaPolicyRuleAppIncludeArrayOutput {
return o.ApplyT(func(v *MfaPolicyRule) MfaPolicyRuleAppIncludeArrayOutput { return v.AppIncludes }).(MfaPolicyRuleAppIncludeArrayOutput)
}
// Should the user be enrolled the first time they LOGIN, the next time they are CHALLENGED, or NEVER?
func (o MfaPolicyRuleOutput) Enroll() pulumi.StringPtrOutput {
return o.ApplyT(func(v *MfaPolicyRule) pulumi.StringPtrOutput { return v.Enroll }).(pulumi.StringPtrOutput)
}
// Policy Rule Name
func (o MfaPolicyRuleOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *MfaPolicyRule) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Network selection mode: ANYWHERE, ZONE, ON_NETWORK, or OFF_NETWORK.
func (o MfaPolicyRuleOutput) NetworkConnection() pulumi.StringPtrOutput {
return o.ApplyT(func(v *MfaPolicyRule) pulumi.StringPtrOutput { return v.NetworkConnection }).(pulumi.StringPtrOutput)
}
// The zones to exclude
func (o MfaPolicyRuleOutput) NetworkExcludes() pulumi.StringArrayOutput {
return o.ApplyT(func(v *MfaPolicyRule) pulumi.StringArrayOutput { return v.NetworkExcludes }).(pulumi.StringArrayOutput)
}
// The zones to include
func (o MfaPolicyRuleOutput) NetworkIncludes() pulumi.StringArrayOutput {
return o.ApplyT(func(v *MfaPolicyRule) pulumi.StringArrayOutput { return v.NetworkIncludes }).(pulumi.StringArrayOutput)
}
// Policy ID of the Rule
func (o MfaPolicyRuleOutput) PolicyId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *MfaPolicyRule) pulumi.StringPtrOutput { return v.PolicyId }).(pulumi.StringPtrOutput)
}
// Policy ID of the Rule
//
// Deprecated: Because of incorrect naming, 'policyid' field will be deprecated and then removed in the next versions of the provider. Please use 'policy_id' instead
func (o MfaPolicyRuleOutput) Policyid() pulumi.StringPtrOutput {
return o.ApplyT(func(v *MfaPolicyRule) pulumi.StringPtrOutput { return v.Policyid }).(pulumi.StringPtrOutput)
}
// Policy Rule Priority, this attribute can be set to a valid priority. To avoid endless diff situation we error if an
// invalid priority is provided. API defaults it to the last (lowest) if not there.
func (o MfaPolicyRuleOutput) Priority() pulumi.IntPtrOutput {
return o.ApplyT(func(v *MfaPolicyRule) pulumi.IntPtrOutput { return v.Priority }).(pulumi.IntPtrOutput)
}
// Policy Rule Status: ACTIVE or INACTIVE.
func (o MfaPolicyRuleOutput) Status() pulumi.StringPtrOutput {
return o.ApplyT(func(v *MfaPolicyRule) pulumi.StringPtrOutput { return v.Status }).(pulumi.StringPtrOutput)
}
// Set of User IDs to Exclude
func (o MfaPolicyRuleOutput) UsersExcludeds() pulumi.StringArrayOutput {
return o.ApplyT(func(v *MfaPolicyRule) pulumi.StringArrayOutput { return v.UsersExcludeds }).(pulumi.StringArrayOutput)
}
type MfaPolicyRuleArrayOutput struct{ *pulumi.OutputState }
func (MfaPolicyRuleArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*MfaPolicyRule)(nil)).Elem()
}
func (o MfaPolicyRuleArrayOutput) ToMfaPolicyRuleArrayOutput() MfaPolicyRuleArrayOutput {
return o
}
func (o MfaPolicyRuleArrayOutput) ToMfaPolicyRuleArrayOutputWithContext(ctx context.Context) MfaPolicyRuleArrayOutput {
return o
}
func (o MfaPolicyRuleArrayOutput) Index(i pulumi.IntInput) MfaPolicyRuleOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *MfaPolicyRule {
return vs[0].([]*MfaPolicyRule)[vs[1].(int)]
}).(MfaPolicyRuleOutput)
}
type MfaPolicyRuleMapOutput struct{ *pulumi.OutputState }
func (MfaPolicyRuleMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*MfaPolicyRule)(nil)).Elem()
}
func (o MfaPolicyRuleMapOutput) ToMfaPolicyRuleMapOutput() MfaPolicyRuleMapOutput {
return o
}
func (o MfaPolicyRuleMapOutput) ToMfaPolicyRuleMapOutputWithContext(ctx context.Context) MfaPolicyRuleMapOutput {
return o
}
func (o MfaPolicyRuleMapOutput) MapIndex(k pulumi.StringInput) MfaPolicyRuleOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *MfaPolicyRule {
return vs[0].(map[string]*MfaPolicyRule)[vs[1].(string)]
}).(MfaPolicyRuleOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*MfaPolicyRuleInput)(nil)).Elem(), &MfaPolicyRule{})
pulumi.RegisterInputType(reflect.TypeOf((*MfaPolicyRuleArrayInput)(nil)).Elem(), MfaPolicyRuleArray{})
pulumi.RegisterInputType(reflect.TypeOf((*MfaPolicyRuleMapInput)(nil)).Elem(), MfaPolicyRuleMap{})
pulumi.RegisterOutputType(MfaPolicyRuleOutput{})
pulumi.RegisterOutputType(MfaPolicyRuleArrayOutput{})
pulumi.RegisterOutputType(MfaPolicyRuleMapOutput{})
}