/
radiusSettings.go
412 lines (357 loc) · 17.9 KB
/
radiusSettings.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
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
// 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 directoryservice
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a directory's multi-factor authentication (MFA) using a Remote Authentication Dial In User Service (RADIUS) server.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/directoryservice"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := directoryservice.NewRadiusSettings(ctx, "example", &directoryservice.RadiusSettingsArgs{
// DirectoryId: pulumi.Any(exampleAwsDirectoryServiceDirectory.Id),
// AuthenticationProtocol: pulumi.String("PAP"),
// DisplayLabel: pulumi.String("example"),
// RadiusPort: pulumi.Int(1812),
// RadiusRetries: pulumi.Int(4),
// RadiusServers: pulumi.StringArray{
// pulumi.String("10.0.1.5"),
// },
// RadiusTimeout: pulumi.Int(1),
// SharedSecret: pulumi.String("12345678"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// Using `pulumi import`, import RADIUS settings using the directory ID. For example:
//
// ```sh
// $ pulumi import aws:directoryservice/radiusSettings:RadiusSettings example d-926724cf57
// ```
type RadiusSettings struct {
pulumi.CustomResourceState
// The protocol specified for your RADIUS endpoints. Valid values: `PAP`, `CHAP`, `MS-CHAPv1`, `MS-CHAPv2`.
AuthenticationProtocol pulumi.StringOutput `pulumi:"authenticationProtocol"`
// The identifier of the directory for which you want to manager RADIUS settings.
DirectoryId pulumi.StringOutput `pulumi:"directoryId"`
// Display label.
DisplayLabel pulumi.StringOutput `pulumi:"displayLabel"`
// The port that your RADIUS server is using for communications. Your self-managed network must allow inbound traffic over this port from the AWS Directory Service servers.
RadiusPort pulumi.IntOutput `pulumi:"radiusPort"`
// The maximum number of times that communication with the RADIUS server is attempted. Minimum value of `0`. Maximum value of `10`.
RadiusRetries pulumi.IntOutput `pulumi:"radiusRetries"`
// An array of strings that contains the fully qualified domain name (FQDN) or IP addresses of the RADIUS server endpoints, or the FQDN or IP addresses of your RADIUS server load balancer.
RadiusServers pulumi.StringArrayOutput `pulumi:"radiusServers"`
// The amount of time, in seconds, to wait for the RADIUS server to respond. Minimum value of `1`. Maximum value of `50`.
RadiusTimeout pulumi.IntOutput `pulumi:"radiusTimeout"`
// Required for enabling RADIUS on the directory.
SharedSecret pulumi.StringOutput `pulumi:"sharedSecret"`
// Not currently used.
UseSameUsername pulumi.BoolPtrOutput `pulumi:"useSameUsername"`
}
// NewRadiusSettings registers a new resource with the given unique name, arguments, and options.
func NewRadiusSettings(ctx *pulumi.Context,
name string, args *RadiusSettingsArgs, opts ...pulumi.ResourceOption) (*RadiusSettings, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AuthenticationProtocol == nil {
return nil, errors.New("invalid value for required argument 'AuthenticationProtocol'")
}
if args.DirectoryId == nil {
return nil, errors.New("invalid value for required argument 'DirectoryId'")
}
if args.DisplayLabel == nil {
return nil, errors.New("invalid value for required argument 'DisplayLabel'")
}
if args.RadiusPort == nil {
return nil, errors.New("invalid value for required argument 'RadiusPort'")
}
if args.RadiusRetries == nil {
return nil, errors.New("invalid value for required argument 'RadiusRetries'")
}
if args.RadiusServers == nil {
return nil, errors.New("invalid value for required argument 'RadiusServers'")
}
if args.RadiusTimeout == nil {
return nil, errors.New("invalid value for required argument 'RadiusTimeout'")
}
if args.SharedSecret == nil {
return nil, errors.New("invalid value for required argument 'SharedSecret'")
}
if args.SharedSecret != nil {
args.SharedSecret = pulumi.ToSecret(args.SharedSecret).(pulumi.StringInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"sharedSecret",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource RadiusSettings
err := ctx.RegisterResource("aws:directoryservice/radiusSettings:RadiusSettings", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRadiusSettings gets an existing RadiusSettings 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 GetRadiusSettings(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RadiusSettingsState, opts ...pulumi.ResourceOption) (*RadiusSettings, error) {
var resource RadiusSettings
err := ctx.ReadResource("aws:directoryservice/radiusSettings:RadiusSettings", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering RadiusSettings resources.
type radiusSettingsState struct {
// The protocol specified for your RADIUS endpoints. Valid values: `PAP`, `CHAP`, `MS-CHAPv1`, `MS-CHAPv2`.
AuthenticationProtocol *string `pulumi:"authenticationProtocol"`
// The identifier of the directory for which you want to manager RADIUS settings.
DirectoryId *string `pulumi:"directoryId"`
// Display label.
DisplayLabel *string `pulumi:"displayLabel"`
// The port that your RADIUS server is using for communications. Your self-managed network must allow inbound traffic over this port from the AWS Directory Service servers.
RadiusPort *int `pulumi:"radiusPort"`
// The maximum number of times that communication with the RADIUS server is attempted. Minimum value of `0`. Maximum value of `10`.
RadiusRetries *int `pulumi:"radiusRetries"`
// An array of strings that contains the fully qualified domain name (FQDN) or IP addresses of the RADIUS server endpoints, or the FQDN or IP addresses of your RADIUS server load balancer.
RadiusServers []string `pulumi:"radiusServers"`
// The amount of time, in seconds, to wait for the RADIUS server to respond. Minimum value of `1`. Maximum value of `50`.
RadiusTimeout *int `pulumi:"radiusTimeout"`
// Required for enabling RADIUS on the directory.
SharedSecret *string `pulumi:"sharedSecret"`
// Not currently used.
UseSameUsername *bool `pulumi:"useSameUsername"`
}
type RadiusSettingsState struct {
// The protocol specified for your RADIUS endpoints. Valid values: `PAP`, `CHAP`, `MS-CHAPv1`, `MS-CHAPv2`.
AuthenticationProtocol pulumi.StringPtrInput
// The identifier of the directory for which you want to manager RADIUS settings.
DirectoryId pulumi.StringPtrInput
// Display label.
DisplayLabel pulumi.StringPtrInput
// The port that your RADIUS server is using for communications. Your self-managed network must allow inbound traffic over this port from the AWS Directory Service servers.
RadiusPort pulumi.IntPtrInput
// The maximum number of times that communication with the RADIUS server is attempted. Minimum value of `0`. Maximum value of `10`.
RadiusRetries pulumi.IntPtrInput
// An array of strings that contains the fully qualified domain name (FQDN) or IP addresses of the RADIUS server endpoints, or the FQDN or IP addresses of your RADIUS server load balancer.
RadiusServers pulumi.StringArrayInput
// The amount of time, in seconds, to wait for the RADIUS server to respond. Minimum value of `1`. Maximum value of `50`.
RadiusTimeout pulumi.IntPtrInput
// Required for enabling RADIUS on the directory.
SharedSecret pulumi.StringPtrInput
// Not currently used.
UseSameUsername pulumi.BoolPtrInput
}
func (RadiusSettingsState) ElementType() reflect.Type {
return reflect.TypeOf((*radiusSettingsState)(nil)).Elem()
}
type radiusSettingsArgs struct {
// The protocol specified for your RADIUS endpoints. Valid values: `PAP`, `CHAP`, `MS-CHAPv1`, `MS-CHAPv2`.
AuthenticationProtocol string `pulumi:"authenticationProtocol"`
// The identifier of the directory for which you want to manager RADIUS settings.
DirectoryId string `pulumi:"directoryId"`
// Display label.
DisplayLabel string `pulumi:"displayLabel"`
// The port that your RADIUS server is using for communications. Your self-managed network must allow inbound traffic over this port from the AWS Directory Service servers.
RadiusPort int `pulumi:"radiusPort"`
// The maximum number of times that communication with the RADIUS server is attempted. Minimum value of `0`. Maximum value of `10`.
RadiusRetries int `pulumi:"radiusRetries"`
// An array of strings that contains the fully qualified domain name (FQDN) or IP addresses of the RADIUS server endpoints, or the FQDN or IP addresses of your RADIUS server load balancer.
RadiusServers []string `pulumi:"radiusServers"`
// The amount of time, in seconds, to wait for the RADIUS server to respond. Minimum value of `1`. Maximum value of `50`.
RadiusTimeout int `pulumi:"radiusTimeout"`
// Required for enabling RADIUS on the directory.
SharedSecret string `pulumi:"sharedSecret"`
// Not currently used.
UseSameUsername *bool `pulumi:"useSameUsername"`
}
// The set of arguments for constructing a RadiusSettings resource.
type RadiusSettingsArgs struct {
// The protocol specified for your RADIUS endpoints. Valid values: `PAP`, `CHAP`, `MS-CHAPv1`, `MS-CHAPv2`.
AuthenticationProtocol pulumi.StringInput
// The identifier of the directory for which you want to manager RADIUS settings.
DirectoryId pulumi.StringInput
// Display label.
DisplayLabel pulumi.StringInput
// The port that your RADIUS server is using for communications. Your self-managed network must allow inbound traffic over this port from the AWS Directory Service servers.
RadiusPort pulumi.IntInput
// The maximum number of times that communication with the RADIUS server is attempted. Minimum value of `0`. Maximum value of `10`.
RadiusRetries pulumi.IntInput
// An array of strings that contains the fully qualified domain name (FQDN) or IP addresses of the RADIUS server endpoints, or the FQDN or IP addresses of your RADIUS server load balancer.
RadiusServers pulumi.StringArrayInput
// The amount of time, in seconds, to wait for the RADIUS server to respond. Minimum value of `1`. Maximum value of `50`.
RadiusTimeout pulumi.IntInput
// Required for enabling RADIUS on the directory.
SharedSecret pulumi.StringInput
// Not currently used.
UseSameUsername pulumi.BoolPtrInput
}
func (RadiusSettingsArgs) ElementType() reflect.Type {
return reflect.TypeOf((*radiusSettingsArgs)(nil)).Elem()
}
type RadiusSettingsInput interface {
pulumi.Input
ToRadiusSettingsOutput() RadiusSettingsOutput
ToRadiusSettingsOutputWithContext(ctx context.Context) RadiusSettingsOutput
}
func (*RadiusSettings) ElementType() reflect.Type {
return reflect.TypeOf((**RadiusSettings)(nil)).Elem()
}
func (i *RadiusSettings) ToRadiusSettingsOutput() RadiusSettingsOutput {
return i.ToRadiusSettingsOutputWithContext(context.Background())
}
func (i *RadiusSettings) ToRadiusSettingsOutputWithContext(ctx context.Context) RadiusSettingsOutput {
return pulumi.ToOutputWithContext(ctx, i).(RadiusSettingsOutput)
}
// RadiusSettingsArrayInput is an input type that accepts RadiusSettingsArray and RadiusSettingsArrayOutput values.
// You can construct a concrete instance of `RadiusSettingsArrayInput` via:
//
// RadiusSettingsArray{ RadiusSettingsArgs{...} }
type RadiusSettingsArrayInput interface {
pulumi.Input
ToRadiusSettingsArrayOutput() RadiusSettingsArrayOutput
ToRadiusSettingsArrayOutputWithContext(context.Context) RadiusSettingsArrayOutput
}
type RadiusSettingsArray []RadiusSettingsInput
func (RadiusSettingsArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RadiusSettings)(nil)).Elem()
}
func (i RadiusSettingsArray) ToRadiusSettingsArrayOutput() RadiusSettingsArrayOutput {
return i.ToRadiusSettingsArrayOutputWithContext(context.Background())
}
func (i RadiusSettingsArray) ToRadiusSettingsArrayOutputWithContext(ctx context.Context) RadiusSettingsArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(RadiusSettingsArrayOutput)
}
// RadiusSettingsMapInput is an input type that accepts RadiusSettingsMap and RadiusSettingsMapOutput values.
// You can construct a concrete instance of `RadiusSettingsMapInput` via:
//
// RadiusSettingsMap{ "key": RadiusSettingsArgs{...} }
type RadiusSettingsMapInput interface {
pulumi.Input
ToRadiusSettingsMapOutput() RadiusSettingsMapOutput
ToRadiusSettingsMapOutputWithContext(context.Context) RadiusSettingsMapOutput
}
type RadiusSettingsMap map[string]RadiusSettingsInput
func (RadiusSettingsMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RadiusSettings)(nil)).Elem()
}
func (i RadiusSettingsMap) ToRadiusSettingsMapOutput() RadiusSettingsMapOutput {
return i.ToRadiusSettingsMapOutputWithContext(context.Background())
}
func (i RadiusSettingsMap) ToRadiusSettingsMapOutputWithContext(ctx context.Context) RadiusSettingsMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(RadiusSettingsMapOutput)
}
type RadiusSettingsOutput struct{ *pulumi.OutputState }
func (RadiusSettingsOutput) ElementType() reflect.Type {
return reflect.TypeOf((**RadiusSettings)(nil)).Elem()
}
func (o RadiusSettingsOutput) ToRadiusSettingsOutput() RadiusSettingsOutput {
return o
}
func (o RadiusSettingsOutput) ToRadiusSettingsOutputWithContext(ctx context.Context) RadiusSettingsOutput {
return o
}
// The protocol specified for your RADIUS endpoints. Valid values: `PAP`, `CHAP`, `MS-CHAPv1`, `MS-CHAPv2`.
func (o RadiusSettingsOutput) AuthenticationProtocol() pulumi.StringOutput {
return o.ApplyT(func(v *RadiusSettings) pulumi.StringOutput { return v.AuthenticationProtocol }).(pulumi.StringOutput)
}
// The identifier of the directory for which you want to manager RADIUS settings.
func (o RadiusSettingsOutput) DirectoryId() pulumi.StringOutput {
return o.ApplyT(func(v *RadiusSettings) pulumi.StringOutput { return v.DirectoryId }).(pulumi.StringOutput)
}
// Display label.
func (o RadiusSettingsOutput) DisplayLabel() pulumi.StringOutput {
return o.ApplyT(func(v *RadiusSettings) pulumi.StringOutput { return v.DisplayLabel }).(pulumi.StringOutput)
}
// The port that your RADIUS server is using for communications. Your self-managed network must allow inbound traffic over this port from the AWS Directory Service servers.
func (o RadiusSettingsOutput) RadiusPort() pulumi.IntOutput {
return o.ApplyT(func(v *RadiusSettings) pulumi.IntOutput { return v.RadiusPort }).(pulumi.IntOutput)
}
// The maximum number of times that communication with the RADIUS server is attempted. Minimum value of `0`. Maximum value of `10`.
func (o RadiusSettingsOutput) RadiusRetries() pulumi.IntOutput {
return o.ApplyT(func(v *RadiusSettings) pulumi.IntOutput { return v.RadiusRetries }).(pulumi.IntOutput)
}
// An array of strings that contains the fully qualified domain name (FQDN) or IP addresses of the RADIUS server endpoints, or the FQDN or IP addresses of your RADIUS server load balancer.
func (o RadiusSettingsOutput) RadiusServers() pulumi.StringArrayOutput {
return o.ApplyT(func(v *RadiusSettings) pulumi.StringArrayOutput { return v.RadiusServers }).(pulumi.StringArrayOutput)
}
// The amount of time, in seconds, to wait for the RADIUS server to respond. Minimum value of `1`. Maximum value of `50`.
func (o RadiusSettingsOutput) RadiusTimeout() pulumi.IntOutput {
return o.ApplyT(func(v *RadiusSettings) pulumi.IntOutput { return v.RadiusTimeout }).(pulumi.IntOutput)
}
// Required for enabling RADIUS on the directory.
func (o RadiusSettingsOutput) SharedSecret() pulumi.StringOutput {
return o.ApplyT(func(v *RadiusSettings) pulumi.StringOutput { return v.SharedSecret }).(pulumi.StringOutput)
}
// Not currently used.
func (o RadiusSettingsOutput) UseSameUsername() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *RadiusSettings) pulumi.BoolPtrOutput { return v.UseSameUsername }).(pulumi.BoolPtrOutput)
}
type RadiusSettingsArrayOutput struct{ *pulumi.OutputState }
func (RadiusSettingsArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RadiusSettings)(nil)).Elem()
}
func (o RadiusSettingsArrayOutput) ToRadiusSettingsArrayOutput() RadiusSettingsArrayOutput {
return o
}
func (o RadiusSettingsArrayOutput) ToRadiusSettingsArrayOutputWithContext(ctx context.Context) RadiusSettingsArrayOutput {
return o
}
func (o RadiusSettingsArrayOutput) Index(i pulumi.IntInput) RadiusSettingsOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RadiusSettings {
return vs[0].([]*RadiusSettings)[vs[1].(int)]
}).(RadiusSettingsOutput)
}
type RadiusSettingsMapOutput struct{ *pulumi.OutputState }
func (RadiusSettingsMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RadiusSettings)(nil)).Elem()
}
func (o RadiusSettingsMapOutput) ToRadiusSettingsMapOutput() RadiusSettingsMapOutput {
return o
}
func (o RadiusSettingsMapOutput) ToRadiusSettingsMapOutputWithContext(ctx context.Context) RadiusSettingsMapOutput {
return o
}
func (o RadiusSettingsMapOutput) MapIndex(k pulumi.StringInput) RadiusSettingsOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RadiusSettings {
return vs[0].(map[string]*RadiusSettings)[vs[1].(string)]
}).(RadiusSettingsOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*RadiusSettingsInput)(nil)).Elem(), &RadiusSettings{})
pulumi.RegisterInputType(reflect.TypeOf((*RadiusSettingsArrayInput)(nil)).Elem(), RadiusSettingsArray{})
pulumi.RegisterInputType(reflect.TypeOf((*RadiusSettingsMapInput)(nil)).Elem(), RadiusSettingsMap{})
pulumi.RegisterOutputType(RadiusSettingsOutput{})
pulumi.RegisterOutputType(RadiusSettingsArrayOutput{})
pulumi.RegisterOutputType(RadiusSettingsMapOutput{})
}