github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/directoryservice/radiusSettings.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 directoryservice
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Manages a directory's multi-factor authentication (MFA) using a Remote Authentication Dial In User Service (RADIUS) server.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/directoryservice"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			_, err := directoryservice.NewRadiusSettings(ctx, "example", &directoryservice.RadiusSettingsArgs{
    33  //				DirectoryId:            pulumi.Any(exampleAwsDirectoryServiceDirectory.Id),
    34  //				AuthenticationProtocol: pulumi.String("PAP"),
    35  //				DisplayLabel:           pulumi.String("example"),
    36  //				RadiusPort:             pulumi.Int(1812),
    37  //				RadiusRetries:          pulumi.Int(4),
    38  //				RadiusServers: pulumi.StringArray{
    39  //					pulumi.String("10.0.1.5"),
    40  //				},
    41  //				RadiusTimeout: pulumi.Int(1),
    42  //				SharedSecret:  pulumi.String("12345678"),
    43  //			})
    44  //			if err != nil {
    45  //				return err
    46  //			}
    47  //			return nil
    48  //		})
    49  //	}
    50  //
    51  // ```
    52  // <!--End PulumiCodeChooser -->
    53  //
    54  // ## Import
    55  //
    56  // Using `pulumi import`, import RADIUS settings using the directory ID. For example:
    57  //
    58  // ```sh
    59  // $ pulumi import aws:directoryservice/radiusSettings:RadiusSettings example d-926724cf57
    60  // ```
    61  type RadiusSettings struct {
    62  	pulumi.CustomResourceState
    63  
    64  	// The protocol specified for your RADIUS endpoints. Valid values: `PAP`, `CHAP`, `MS-CHAPv1`, `MS-CHAPv2`.
    65  	AuthenticationProtocol pulumi.StringOutput `pulumi:"authenticationProtocol"`
    66  	// The identifier of the directory for which you want to manager RADIUS settings.
    67  	DirectoryId pulumi.StringOutput `pulumi:"directoryId"`
    68  	// Display label.
    69  	DisplayLabel pulumi.StringOutput `pulumi:"displayLabel"`
    70  	// 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.
    71  	RadiusPort pulumi.IntOutput `pulumi:"radiusPort"`
    72  	// The maximum number of times that communication with the RADIUS server is attempted. Minimum value of `0`. Maximum value of `10`.
    73  	RadiusRetries pulumi.IntOutput `pulumi:"radiusRetries"`
    74  	// 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.
    75  	RadiusServers pulumi.StringArrayOutput `pulumi:"radiusServers"`
    76  	// The amount of time, in seconds, to wait for the RADIUS server to respond. Minimum value of `1`. Maximum value of `50`.
    77  	RadiusTimeout pulumi.IntOutput `pulumi:"radiusTimeout"`
    78  	// Required for enabling RADIUS on the directory.
    79  	SharedSecret pulumi.StringOutput `pulumi:"sharedSecret"`
    80  	// Not currently used.
    81  	UseSameUsername pulumi.BoolPtrOutput `pulumi:"useSameUsername"`
    82  }
    83  
    84  // NewRadiusSettings registers a new resource with the given unique name, arguments, and options.
    85  func NewRadiusSettings(ctx *pulumi.Context,
    86  	name string, args *RadiusSettingsArgs, opts ...pulumi.ResourceOption) (*RadiusSettings, error) {
    87  	if args == nil {
    88  		return nil, errors.New("missing one or more required arguments")
    89  	}
    90  
    91  	if args.AuthenticationProtocol == nil {
    92  		return nil, errors.New("invalid value for required argument 'AuthenticationProtocol'")
    93  	}
    94  	if args.DirectoryId == nil {
    95  		return nil, errors.New("invalid value for required argument 'DirectoryId'")
    96  	}
    97  	if args.DisplayLabel == nil {
    98  		return nil, errors.New("invalid value for required argument 'DisplayLabel'")
    99  	}
   100  	if args.RadiusPort == nil {
   101  		return nil, errors.New("invalid value for required argument 'RadiusPort'")
   102  	}
   103  	if args.RadiusRetries == nil {
   104  		return nil, errors.New("invalid value for required argument 'RadiusRetries'")
   105  	}
   106  	if args.RadiusServers == nil {
   107  		return nil, errors.New("invalid value for required argument 'RadiusServers'")
   108  	}
   109  	if args.RadiusTimeout == nil {
   110  		return nil, errors.New("invalid value for required argument 'RadiusTimeout'")
   111  	}
   112  	if args.SharedSecret == nil {
   113  		return nil, errors.New("invalid value for required argument 'SharedSecret'")
   114  	}
   115  	if args.SharedSecret != nil {
   116  		args.SharedSecret = pulumi.ToSecret(args.SharedSecret).(pulumi.StringInput)
   117  	}
   118  	secrets := pulumi.AdditionalSecretOutputs([]string{
   119  		"sharedSecret",
   120  	})
   121  	opts = append(opts, secrets)
   122  	opts = internal.PkgResourceDefaultOpts(opts)
   123  	var resource RadiusSettings
   124  	err := ctx.RegisterResource("aws:directoryservice/radiusSettings:RadiusSettings", name, args, &resource, opts...)
   125  	if err != nil {
   126  		return nil, err
   127  	}
   128  	return &resource, nil
   129  }
   130  
   131  // GetRadiusSettings gets an existing RadiusSettings resource's state with the given name, ID, and optional
   132  // state properties that are used to uniquely qualify the lookup (nil if not required).
   133  func GetRadiusSettings(ctx *pulumi.Context,
   134  	name string, id pulumi.IDInput, state *RadiusSettingsState, opts ...pulumi.ResourceOption) (*RadiusSettings, error) {
   135  	var resource RadiusSettings
   136  	err := ctx.ReadResource("aws:directoryservice/radiusSettings:RadiusSettings", name, id, state, &resource, opts...)
   137  	if err != nil {
   138  		return nil, err
   139  	}
   140  	return &resource, nil
   141  }
   142  
   143  // Input properties used for looking up and filtering RadiusSettings resources.
   144  type radiusSettingsState struct {
   145  	// The protocol specified for your RADIUS endpoints. Valid values: `PAP`, `CHAP`, `MS-CHAPv1`, `MS-CHAPv2`.
   146  	AuthenticationProtocol *string `pulumi:"authenticationProtocol"`
   147  	// The identifier of the directory for which you want to manager RADIUS settings.
   148  	DirectoryId *string `pulumi:"directoryId"`
   149  	// Display label.
   150  	DisplayLabel *string `pulumi:"displayLabel"`
   151  	// 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.
   152  	RadiusPort *int `pulumi:"radiusPort"`
   153  	// The maximum number of times that communication with the RADIUS server is attempted. Minimum value of `0`. Maximum value of `10`.
   154  	RadiusRetries *int `pulumi:"radiusRetries"`
   155  	// 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.
   156  	RadiusServers []string `pulumi:"radiusServers"`
   157  	// The amount of time, in seconds, to wait for the RADIUS server to respond. Minimum value of `1`. Maximum value of `50`.
   158  	RadiusTimeout *int `pulumi:"radiusTimeout"`
   159  	// Required for enabling RADIUS on the directory.
   160  	SharedSecret *string `pulumi:"sharedSecret"`
   161  	// Not currently used.
   162  	UseSameUsername *bool `pulumi:"useSameUsername"`
   163  }
   164  
   165  type RadiusSettingsState struct {
   166  	// The protocol specified for your RADIUS endpoints. Valid values: `PAP`, `CHAP`, `MS-CHAPv1`, `MS-CHAPv2`.
   167  	AuthenticationProtocol pulumi.StringPtrInput
   168  	// The identifier of the directory for which you want to manager RADIUS settings.
   169  	DirectoryId pulumi.StringPtrInput
   170  	// Display label.
   171  	DisplayLabel pulumi.StringPtrInput
   172  	// 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.
   173  	RadiusPort pulumi.IntPtrInput
   174  	// The maximum number of times that communication with the RADIUS server is attempted. Minimum value of `0`. Maximum value of `10`.
   175  	RadiusRetries pulumi.IntPtrInput
   176  	// 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.
   177  	RadiusServers pulumi.StringArrayInput
   178  	// The amount of time, in seconds, to wait for the RADIUS server to respond. Minimum value of `1`. Maximum value of `50`.
   179  	RadiusTimeout pulumi.IntPtrInput
   180  	// Required for enabling RADIUS on the directory.
   181  	SharedSecret pulumi.StringPtrInput
   182  	// Not currently used.
   183  	UseSameUsername pulumi.BoolPtrInput
   184  }
   185  
   186  func (RadiusSettingsState) ElementType() reflect.Type {
   187  	return reflect.TypeOf((*radiusSettingsState)(nil)).Elem()
   188  }
   189  
   190  type radiusSettingsArgs struct {
   191  	// The protocol specified for your RADIUS endpoints. Valid values: `PAP`, `CHAP`, `MS-CHAPv1`, `MS-CHAPv2`.
   192  	AuthenticationProtocol string `pulumi:"authenticationProtocol"`
   193  	// The identifier of the directory for which you want to manager RADIUS settings.
   194  	DirectoryId string `pulumi:"directoryId"`
   195  	// Display label.
   196  	DisplayLabel string `pulumi:"displayLabel"`
   197  	// 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.
   198  	RadiusPort int `pulumi:"radiusPort"`
   199  	// The maximum number of times that communication with the RADIUS server is attempted. Minimum value of `0`. Maximum value of `10`.
   200  	RadiusRetries int `pulumi:"radiusRetries"`
   201  	// 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.
   202  	RadiusServers []string `pulumi:"radiusServers"`
   203  	// The amount of time, in seconds, to wait for the RADIUS server to respond. Minimum value of `1`. Maximum value of `50`.
   204  	RadiusTimeout int `pulumi:"radiusTimeout"`
   205  	// Required for enabling RADIUS on the directory.
   206  	SharedSecret string `pulumi:"sharedSecret"`
   207  	// Not currently used.
   208  	UseSameUsername *bool `pulumi:"useSameUsername"`
   209  }
   210  
   211  // The set of arguments for constructing a RadiusSettings resource.
   212  type RadiusSettingsArgs struct {
   213  	// The protocol specified for your RADIUS endpoints. Valid values: `PAP`, `CHAP`, `MS-CHAPv1`, `MS-CHAPv2`.
   214  	AuthenticationProtocol pulumi.StringInput
   215  	// The identifier of the directory for which you want to manager RADIUS settings.
   216  	DirectoryId pulumi.StringInput
   217  	// Display label.
   218  	DisplayLabel pulumi.StringInput
   219  	// 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.
   220  	RadiusPort pulumi.IntInput
   221  	// The maximum number of times that communication with the RADIUS server is attempted. Minimum value of `0`. Maximum value of `10`.
   222  	RadiusRetries pulumi.IntInput
   223  	// 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.
   224  	RadiusServers pulumi.StringArrayInput
   225  	// The amount of time, in seconds, to wait for the RADIUS server to respond. Minimum value of `1`. Maximum value of `50`.
   226  	RadiusTimeout pulumi.IntInput
   227  	// Required for enabling RADIUS on the directory.
   228  	SharedSecret pulumi.StringInput
   229  	// Not currently used.
   230  	UseSameUsername pulumi.BoolPtrInput
   231  }
   232  
   233  func (RadiusSettingsArgs) ElementType() reflect.Type {
   234  	return reflect.TypeOf((*radiusSettingsArgs)(nil)).Elem()
   235  }
   236  
   237  type RadiusSettingsInput interface {
   238  	pulumi.Input
   239  
   240  	ToRadiusSettingsOutput() RadiusSettingsOutput
   241  	ToRadiusSettingsOutputWithContext(ctx context.Context) RadiusSettingsOutput
   242  }
   243  
   244  func (*RadiusSettings) ElementType() reflect.Type {
   245  	return reflect.TypeOf((**RadiusSettings)(nil)).Elem()
   246  }
   247  
   248  func (i *RadiusSettings) ToRadiusSettingsOutput() RadiusSettingsOutput {
   249  	return i.ToRadiusSettingsOutputWithContext(context.Background())
   250  }
   251  
   252  func (i *RadiusSettings) ToRadiusSettingsOutputWithContext(ctx context.Context) RadiusSettingsOutput {
   253  	return pulumi.ToOutputWithContext(ctx, i).(RadiusSettingsOutput)
   254  }
   255  
   256  // RadiusSettingsArrayInput is an input type that accepts RadiusSettingsArray and RadiusSettingsArrayOutput values.
   257  // You can construct a concrete instance of `RadiusSettingsArrayInput` via:
   258  //
   259  //	RadiusSettingsArray{ RadiusSettingsArgs{...} }
   260  type RadiusSettingsArrayInput interface {
   261  	pulumi.Input
   262  
   263  	ToRadiusSettingsArrayOutput() RadiusSettingsArrayOutput
   264  	ToRadiusSettingsArrayOutputWithContext(context.Context) RadiusSettingsArrayOutput
   265  }
   266  
   267  type RadiusSettingsArray []RadiusSettingsInput
   268  
   269  func (RadiusSettingsArray) ElementType() reflect.Type {
   270  	return reflect.TypeOf((*[]*RadiusSettings)(nil)).Elem()
   271  }
   272  
   273  func (i RadiusSettingsArray) ToRadiusSettingsArrayOutput() RadiusSettingsArrayOutput {
   274  	return i.ToRadiusSettingsArrayOutputWithContext(context.Background())
   275  }
   276  
   277  func (i RadiusSettingsArray) ToRadiusSettingsArrayOutputWithContext(ctx context.Context) RadiusSettingsArrayOutput {
   278  	return pulumi.ToOutputWithContext(ctx, i).(RadiusSettingsArrayOutput)
   279  }
   280  
   281  // RadiusSettingsMapInput is an input type that accepts RadiusSettingsMap and RadiusSettingsMapOutput values.
   282  // You can construct a concrete instance of `RadiusSettingsMapInput` via:
   283  //
   284  //	RadiusSettingsMap{ "key": RadiusSettingsArgs{...} }
   285  type RadiusSettingsMapInput interface {
   286  	pulumi.Input
   287  
   288  	ToRadiusSettingsMapOutput() RadiusSettingsMapOutput
   289  	ToRadiusSettingsMapOutputWithContext(context.Context) RadiusSettingsMapOutput
   290  }
   291  
   292  type RadiusSettingsMap map[string]RadiusSettingsInput
   293  
   294  func (RadiusSettingsMap) ElementType() reflect.Type {
   295  	return reflect.TypeOf((*map[string]*RadiusSettings)(nil)).Elem()
   296  }
   297  
   298  func (i RadiusSettingsMap) ToRadiusSettingsMapOutput() RadiusSettingsMapOutput {
   299  	return i.ToRadiusSettingsMapOutputWithContext(context.Background())
   300  }
   301  
   302  func (i RadiusSettingsMap) ToRadiusSettingsMapOutputWithContext(ctx context.Context) RadiusSettingsMapOutput {
   303  	return pulumi.ToOutputWithContext(ctx, i).(RadiusSettingsMapOutput)
   304  }
   305  
   306  type RadiusSettingsOutput struct{ *pulumi.OutputState }
   307  
   308  func (RadiusSettingsOutput) ElementType() reflect.Type {
   309  	return reflect.TypeOf((**RadiusSettings)(nil)).Elem()
   310  }
   311  
   312  func (o RadiusSettingsOutput) ToRadiusSettingsOutput() RadiusSettingsOutput {
   313  	return o
   314  }
   315  
   316  func (o RadiusSettingsOutput) ToRadiusSettingsOutputWithContext(ctx context.Context) RadiusSettingsOutput {
   317  	return o
   318  }
   319  
   320  // The protocol specified for your RADIUS endpoints. Valid values: `PAP`, `CHAP`, `MS-CHAPv1`, `MS-CHAPv2`.
   321  func (o RadiusSettingsOutput) AuthenticationProtocol() pulumi.StringOutput {
   322  	return o.ApplyT(func(v *RadiusSettings) pulumi.StringOutput { return v.AuthenticationProtocol }).(pulumi.StringOutput)
   323  }
   324  
   325  // The identifier of the directory for which you want to manager RADIUS settings.
   326  func (o RadiusSettingsOutput) DirectoryId() pulumi.StringOutput {
   327  	return o.ApplyT(func(v *RadiusSettings) pulumi.StringOutput { return v.DirectoryId }).(pulumi.StringOutput)
   328  }
   329  
   330  // Display label.
   331  func (o RadiusSettingsOutput) DisplayLabel() pulumi.StringOutput {
   332  	return o.ApplyT(func(v *RadiusSettings) pulumi.StringOutput { return v.DisplayLabel }).(pulumi.StringOutput)
   333  }
   334  
   335  // 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.
   336  func (o RadiusSettingsOutput) RadiusPort() pulumi.IntOutput {
   337  	return o.ApplyT(func(v *RadiusSettings) pulumi.IntOutput { return v.RadiusPort }).(pulumi.IntOutput)
   338  }
   339  
   340  // The maximum number of times that communication with the RADIUS server is attempted. Minimum value of `0`. Maximum value of `10`.
   341  func (o RadiusSettingsOutput) RadiusRetries() pulumi.IntOutput {
   342  	return o.ApplyT(func(v *RadiusSettings) pulumi.IntOutput { return v.RadiusRetries }).(pulumi.IntOutput)
   343  }
   344  
   345  // 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.
   346  func (o RadiusSettingsOutput) RadiusServers() pulumi.StringArrayOutput {
   347  	return o.ApplyT(func(v *RadiusSettings) pulumi.StringArrayOutput { return v.RadiusServers }).(pulumi.StringArrayOutput)
   348  }
   349  
   350  // The amount of time, in seconds, to wait for the RADIUS server to respond. Minimum value of `1`. Maximum value of `50`.
   351  func (o RadiusSettingsOutput) RadiusTimeout() pulumi.IntOutput {
   352  	return o.ApplyT(func(v *RadiusSettings) pulumi.IntOutput { return v.RadiusTimeout }).(pulumi.IntOutput)
   353  }
   354  
   355  // Required for enabling RADIUS on the directory.
   356  func (o RadiusSettingsOutput) SharedSecret() pulumi.StringOutput {
   357  	return o.ApplyT(func(v *RadiusSettings) pulumi.StringOutput { return v.SharedSecret }).(pulumi.StringOutput)
   358  }
   359  
   360  // Not currently used.
   361  func (o RadiusSettingsOutput) UseSameUsername() pulumi.BoolPtrOutput {
   362  	return o.ApplyT(func(v *RadiusSettings) pulumi.BoolPtrOutput { return v.UseSameUsername }).(pulumi.BoolPtrOutput)
   363  }
   364  
   365  type RadiusSettingsArrayOutput struct{ *pulumi.OutputState }
   366  
   367  func (RadiusSettingsArrayOutput) ElementType() reflect.Type {
   368  	return reflect.TypeOf((*[]*RadiusSettings)(nil)).Elem()
   369  }
   370  
   371  func (o RadiusSettingsArrayOutput) ToRadiusSettingsArrayOutput() RadiusSettingsArrayOutput {
   372  	return o
   373  }
   374  
   375  func (o RadiusSettingsArrayOutput) ToRadiusSettingsArrayOutputWithContext(ctx context.Context) RadiusSettingsArrayOutput {
   376  	return o
   377  }
   378  
   379  func (o RadiusSettingsArrayOutput) Index(i pulumi.IntInput) RadiusSettingsOutput {
   380  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RadiusSettings {
   381  		return vs[0].([]*RadiusSettings)[vs[1].(int)]
   382  	}).(RadiusSettingsOutput)
   383  }
   384  
   385  type RadiusSettingsMapOutput struct{ *pulumi.OutputState }
   386  
   387  func (RadiusSettingsMapOutput) ElementType() reflect.Type {
   388  	return reflect.TypeOf((*map[string]*RadiusSettings)(nil)).Elem()
   389  }
   390  
   391  func (o RadiusSettingsMapOutput) ToRadiusSettingsMapOutput() RadiusSettingsMapOutput {
   392  	return o
   393  }
   394  
   395  func (o RadiusSettingsMapOutput) ToRadiusSettingsMapOutputWithContext(ctx context.Context) RadiusSettingsMapOutput {
   396  	return o
   397  }
   398  
   399  func (o RadiusSettingsMapOutput) MapIndex(k pulumi.StringInput) RadiusSettingsOutput {
   400  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RadiusSettings {
   401  		return vs[0].(map[string]*RadiusSettings)[vs[1].(string)]
   402  	}).(RadiusSettingsOutput)
   403  }
   404  
   405  func init() {
   406  	pulumi.RegisterInputType(reflect.TypeOf((*RadiusSettingsInput)(nil)).Elem(), &RadiusSettings{})
   407  	pulumi.RegisterInputType(reflect.TypeOf((*RadiusSettingsArrayInput)(nil)).Elem(), RadiusSettingsArray{})
   408  	pulumi.RegisterInputType(reflect.TypeOf((*RadiusSettingsMapInput)(nil)).Elem(), RadiusSettingsMap{})
   409  	pulumi.RegisterOutputType(RadiusSettingsOutput{})
   410  	pulumi.RegisterOutputType(RadiusSettingsArrayOutput{})
   411  	pulumi.RegisterOutputType(RadiusSettingsMapOutput{})
   412  }