github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/lex/v2modelsBot.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 lex
     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  // Resource for managing an AWS Lex V2 Models Bot.
    16  //
    17  // ## Example Usage
    18  //
    19  // ### Basic Usage
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lex"
    28  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    29  //
    30  // )
    31  //
    32  //	func main() {
    33  //		pulumi.Run(func(ctx *pulumi.Context) error {
    34  //			_, err := lex.NewV2modelsBot(ctx, "example", &lex.V2modelsBotArgs{
    35  //				Name: pulumi.String("example"),
    36  //				DataPrivacies: lex.V2modelsBotDataPrivacyArray{
    37  //					&lex.V2modelsBotDataPrivacyArgs{
    38  //						ChildDirected: pulumi.Bool("boolean"),
    39  //					},
    40  //				},
    41  //				IdleSessionTtlInSeconds: pulumi.Int(10),
    42  //				RoleArn:                 pulumi.String("bot_example_arn"),
    43  //				Tags: pulumi.StringMap{
    44  //					"foo": pulumi.String("bar"),
    45  //				},
    46  //			})
    47  //			if err != nil {
    48  //				return err
    49  //			}
    50  //			return nil
    51  //		})
    52  //	}
    53  //
    54  // ```
    55  // <!--End PulumiCodeChooser -->
    56  //
    57  // ## Import
    58  //
    59  // Using `pulumi import`, import Lex V2 Models Bot using the `id`. For example:
    60  //
    61  // ```sh
    62  // $ pulumi import aws:lex/v2modelsBot:V2modelsBot example bot-id-12345678
    63  // ```
    64  type V2modelsBot struct {
    65  	pulumi.CustomResourceState
    66  
    67  	Arn pulumi.StringOutput `pulumi:"arn"`
    68  	// Provides information on additional privacy protections Amazon Lex should use with the bot's data. See `dataPrivacy`
    69  	DataPrivacies V2modelsBotDataPrivacyArrayOutput `pulumi:"dataPrivacies"`
    70  	// Description of the bot. It appears in lists to help you identify a particular bot.
    71  	Description pulumi.StringPtrOutput `pulumi:"description"`
    72  	// Time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot. You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.
    73  	IdleSessionTtlInSeconds pulumi.IntOutput `pulumi:"idleSessionTtlInSeconds"`
    74  	// List of bot members in a network to be created. See `botMembers`.
    75  	Members V2modelsBotMemberArrayOutput `pulumi:"members"`
    76  	// Name of the bot. The bot name must be unique in the account that creates the bot. Type String. Length Constraints: Minimum length of 1. Maximum length of 100.
    77  	Name pulumi.StringOutput `pulumi:"name"`
    78  	// ARN of an IAM role that has permission to access the bot.
    79  	//
    80  	// The following arguments are optional:
    81  	RoleArn pulumi.StringOutput `pulumi:"roleArn"`
    82  	// List of tags to add to the bot. You can only add tags when you create a bot.
    83  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    84  	// Deprecated: Please use `tags` instead.
    85  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    86  	// List of tags to add to the test alias for a bot. You can only add tags when you create a bot.
    87  	TestBotAliasTags pulumi.StringMapOutput       `pulumi:"testBotAliasTags"`
    88  	Timeouts         V2modelsBotTimeoutsPtrOutput `pulumi:"timeouts"`
    89  	// Type of a bot to create. Possible values are `"Bot"` and `"BotNetwork"`.
    90  	Type pulumi.StringOutput `pulumi:"type"`
    91  }
    92  
    93  // NewV2modelsBot registers a new resource with the given unique name, arguments, and options.
    94  func NewV2modelsBot(ctx *pulumi.Context,
    95  	name string, args *V2modelsBotArgs, opts ...pulumi.ResourceOption) (*V2modelsBot, error) {
    96  	if args == nil {
    97  		return nil, errors.New("missing one or more required arguments")
    98  	}
    99  
   100  	if args.IdleSessionTtlInSeconds == nil {
   101  		return nil, errors.New("invalid value for required argument 'IdleSessionTtlInSeconds'")
   102  	}
   103  	if args.RoleArn == nil {
   104  		return nil, errors.New("invalid value for required argument 'RoleArn'")
   105  	}
   106  	opts = internal.PkgResourceDefaultOpts(opts)
   107  	var resource V2modelsBot
   108  	err := ctx.RegisterResource("aws:lex/v2modelsBot:V2modelsBot", name, args, &resource, opts...)
   109  	if err != nil {
   110  		return nil, err
   111  	}
   112  	return &resource, nil
   113  }
   114  
   115  // GetV2modelsBot gets an existing V2modelsBot resource's state with the given name, ID, and optional
   116  // state properties that are used to uniquely qualify the lookup (nil if not required).
   117  func GetV2modelsBot(ctx *pulumi.Context,
   118  	name string, id pulumi.IDInput, state *V2modelsBotState, opts ...pulumi.ResourceOption) (*V2modelsBot, error) {
   119  	var resource V2modelsBot
   120  	err := ctx.ReadResource("aws:lex/v2modelsBot:V2modelsBot", name, id, state, &resource, opts...)
   121  	if err != nil {
   122  		return nil, err
   123  	}
   124  	return &resource, nil
   125  }
   126  
   127  // Input properties used for looking up and filtering V2modelsBot resources.
   128  type v2modelsBotState struct {
   129  	Arn *string `pulumi:"arn"`
   130  	// Provides information on additional privacy protections Amazon Lex should use with the bot's data. See `dataPrivacy`
   131  	DataPrivacies []V2modelsBotDataPrivacy `pulumi:"dataPrivacies"`
   132  	// Description of the bot. It appears in lists to help you identify a particular bot.
   133  	Description *string `pulumi:"description"`
   134  	// Time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot. You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.
   135  	IdleSessionTtlInSeconds *int `pulumi:"idleSessionTtlInSeconds"`
   136  	// List of bot members in a network to be created. See `botMembers`.
   137  	Members []V2modelsBotMember `pulumi:"members"`
   138  	// Name of the bot. The bot name must be unique in the account that creates the bot. Type String. Length Constraints: Minimum length of 1. Maximum length of 100.
   139  	Name *string `pulumi:"name"`
   140  	// ARN of an IAM role that has permission to access the bot.
   141  	//
   142  	// The following arguments are optional:
   143  	RoleArn *string `pulumi:"roleArn"`
   144  	// List of tags to add to the bot. You can only add tags when you create a bot.
   145  	Tags map[string]string `pulumi:"tags"`
   146  	// Deprecated: Please use `tags` instead.
   147  	TagsAll map[string]string `pulumi:"tagsAll"`
   148  	// List of tags to add to the test alias for a bot. You can only add tags when you create a bot.
   149  	TestBotAliasTags map[string]string    `pulumi:"testBotAliasTags"`
   150  	Timeouts         *V2modelsBotTimeouts `pulumi:"timeouts"`
   151  	// Type of a bot to create. Possible values are `"Bot"` and `"BotNetwork"`.
   152  	Type *string `pulumi:"type"`
   153  }
   154  
   155  type V2modelsBotState struct {
   156  	Arn pulumi.StringPtrInput
   157  	// Provides information on additional privacy protections Amazon Lex should use with the bot's data. See `dataPrivacy`
   158  	DataPrivacies V2modelsBotDataPrivacyArrayInput
   159  	// Description of the bot. It appears in lists to help you identify a particular bot.
   160  	Description pulumi.StringPtrInput
   161  	// Time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot. You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.
   162  	IdleSessionTtlInSeconds pulumi.IntPtrInput
   163  	// List of bot members in a network to be created. See `botMembers`.
   164  	Members V2modelsBotMemberArrayInput
   165  	// Name of the bot. The bot name must be unique in the account that creates the bot. Type String. Length Constraints: Minimum length of 1. Maximum length of 100.
   166  	Name pulumi.StringPtrInput
   167  	// ARN of an IAM role that has permission to access the bot.
   168  	//
   169  	// The following arguments are optional:
   170  	RoleArn pulumi.StringPtrInput
   171  	// List of tags to add to the bot. You can only add tags when you create a bot.
   172  	Tags pulumi.StringMapInput
   173  	// Deprecated: Please use `tags` instead.
   174  	TagsAll pulumi.StringMapInput
   175  	// List of tags to add to the test alias for a bot. You can only add tags when you create a bot.
   176  	TestBotAliasTags pulumi.StringMapInput
   177  	Timeouts         V2modelsBotTimeoutsPtrInput
   178  	// Type of a bot to create. Possible values are `"Bot"` and `"BotNetwork"`.
   179  	Type pulumi.StringPtrInput
   180  }
   181  
   182  func (V2modelsBotState) ElementType() reflect.Type {
   183  	return reflect.TypeOf((*v2modelsBotState)(nil)).Elem()
   184  }
   185  
   186  type v2modelsBotArgs struct {
   187  	// Provides information on additional privacy protections Amazon Lex should use with the bot's data. See `dataPrivacy`
   188  	DataPrivacies []V2modelsBotDataPrivacy `pulumi:"dataPrivacies"`
   189  	// Description of the bot. It appears in lists to help you identify a particular bot.
   190  	Description *string `pulumi:"description"`
   191  	// Time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot. You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.
   192  	IdleSessionTtlInSeconds int `pulumi:"idleSessionTtlInSeconds"`
   193  	// List of bot members in a network to be created. See `botMembers`.
   194  	Members []V2modelsBotMember `pulumi:"members"`
   195  	// Name of the bot. The bot name must be unique in the account that creates the bot. Type String. Length Constraints: Minimum length of 1. Maximum length of 100.
   196  	Name *string `pulumi:"name"`
   197  	// ARN of an IAM role that has permission to access the bot.
   198  	//
   199  	// The following arguments are optional:
   200  	RoleArn string `pulumi:"roleArn"`
   201  	// List of tags to add to the bot. You can only add tags when you create a bot.
   202  	Tags map[string]string `pulumi:"tags"`
   203  	// List of tags to add to the test alias for a bot. You can only add tags when you create a bot.
   204  	TestBotAliasTags map[string]string    `pulumi:"testBotAliasTags"`
   205  	Timeouts         *V2modelsBotTimeouts `pulumi:"timeouts"`
   206  	// Type of a bot to create. Possible values are `"Bot"` and `"BotNetwork"`.
   207  	Type *string `pulumi:"type"`
   208  }
   209  
   210  // The set of arguments for constructing a V2modelsBot resource.
   211  type V2modelsBotArgs struct {
   212  	// Provides information on additional privacy protections Amazon Lex should use with the bot's data. See `dataPrivacy`
   213  	DataPrivacies V2modelsBotDataPrivacyArrayInput
   214  	// Description of the bot. It appears in lists to help you identify a particular bot.
   215  	Description pulumi.StringPtrInput
   216  	// Time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot. You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.
   217  	IdleSessionTtlInSeconds pulumi.IntInput
   218  	// List of bot members in a network to be created. See `botMembers`.
   219  	Members V2modelsBotMemberArrayInput
   220  	// Name of the bot. The bot name must be unique in the account that creates the bot. Type String. Length Constraints: Minimum length of 1. Maximum length of 100.
   221  	Name pulumi.StringPtrInput
   222  	// ARN of an IAM role that has permission to access the bot.
   223  	//
   224  	// The following arguments are optional:
   225  	RoleArn pulumi.StringInput
   226  	// List of tags to add to the bot. You can only add tags when you create a bot.
   227  	Tags pulumi.StringMapInput
   228  	// List of tags to add to the test alias for a bot. You can only add tags when you create a bot.
   229  	TestBotAliasTags pulumi.StringMapInput
   230  	Timeouts         V2modelsBotTimeoutsPtrInput
   231  	// Type of a bot to create. Possible values are `"Bot"` and `"BotNetwork"`.
   232  	Type pulumi.StringPtrInput
   233  }
   234  
   235  func (V2modelsBotArgs) ElementType() reflect.Type {
   236  	return reflect.TypeOf((*v2modelsBotArgs)(nil)).Elem()
   237  }
   238  
   239  type V2modelsBotInput interface {
   240  	pulumi.Input
   241  
   242  	ToV2modelsBotOutput() V2modelsBotOutput
   243  	ToV2modelsBotOutputWithContext(ctx context.Context) V2modelsBotOutput
   244  }
   245  
   246  func (*V2modelsBot) ElementType() reflect.Type {
   247  	return reflect.TypeOf((**V2modelsBot)(nil)).Elem()
   248  }
   249  
   250  func (i *V2modelsBot) ToV2modelsBotOutput() V2modelsBotOutput {
   251  	return i.ToV2modelsBotOutputWithContext(context.Background())
   252  }
   253  
   254  func (i *V2modelsBot) ToV2modelsBotOutputWithContext(ctx context.Context) V2modelsBotOutput {
   255  	return pulumi.ToOutputWithContext(ctx, i).(V2modelsBotOutput)
   256  }
   257  
   258  // V2modelsBotArrayInput is an input type that accepts V2modelsBotArray and V2modelsBotArrayOutput values.
   259  // You can construct a concrete instance of `V2modelsBotArrayInput` via:
   260  //
   261  //	V2modelsBotArray{ V2modelsBotArgs{...} }
   262  type V2modelsBotArrayInput interface {
   263  	pulumi.Input
   264  
   265  	ToV2modelsBotArrayOutput() V2modelsBotArrayOutput
   266  	ToV2modelsBotArrayOutputWithContext(context.Context) V2modelsBotArrayOutput
   267  }
   268  
   269  type V2modelsBotArray []V2modelsBotInput
   270  
   271  func (V2modelsBotArray) ElementType() reflect.Type {
   272  	return reflect.TypeOf((*[]*V2modelsBot)(nil)).Elem()
   273  }
   274  
   275  func (i V2modelsBotArray) ToV2modelsBotArrayOutput() V2modelsBotArrayOutput {
   276  	return i.ToV2modelsBotArrayOutputWithContext(context.Background())
   277  }
   278  
   279  func (i V2modelsBotArray) ToV2modelsBotArrayOutputWithContext(ctx context.Context) V2modelsBotArrayOutput {
   280  	return pulumi.ToOutputWithContext(ctx, i).(V2modelsBotArrayOutput)
   281  }
   282  
   283  // V2modelsBotMapInput is an input type that accepts V2modelsBotMap and V2modelsBotMapOutput values.
   284  // You can construct a concrete instance of `V2modelsBotMapInput` via:
   285  //
   286  //	V2modelsBotMap{ "key": V2modelsBotArgs{...} }
   287  type V2modelsBotMapInput interface {
   288  	pulumi.Input
   289  
   290  	ToV2modelsBotMapOutput() V2modelsBotMapOutput
   291  	ToV2modelsBotMapOutputWithContext(context.Context) V2modelsBotMapOutput
   292  }
   293  
   294  type V2modelsBotMap map[string]V2modelsBotInput
   295  
   296  func (V2modelsBotMap) ElementType() reflect.Type {
   297  	return reflect.TypeOf((*map[string]*V2modelsBot)(nil)).Elem()
   298  }
   299  
   300  func (i V2modelsBotMap) ToV2modelsBotMapOutput() V2modelsBotMapOutput {
   301  	return i.ToV2modelsBotMapOutputWithContext(context.Background())
   302  }
   303  
   304  func (i V2modelsBotMap) ToV2modelsBotMapOutputWithContext(ctx context.Context) V2modelsBotMapOutput {
   305  	return pulumi.ToOutputWithContext(ctx, i).(V2modelsBotMapOutput)
   306  }
   307  
   308  type V2modelsBotOutput struct{ *pulumi.OutputState }
   309  
   310  func (V2modelsBotOutput) ElementType() reflect.Type {
   311  	return reflect.TypeOf((**V2modelsBot)(nil)).Elem()
   312  }
   313  
   314  func (o V2modelsBotOutput) ToV2modelsBotOutput() V2modelsBotOutput {
   315  	return o
   316  }
   317  
   318  func (o V2modelsBotOutput) ToV2modelsBotOutputWithContext(ctx context.Context) V2modelsBotOutput {
   319  	return o
   320  }
   321  
   322  func (o V2modelsBotOutput) Arn() pulumi.StringOutput {
   323  	return o.ApplyT(func(v *V2modelsBot) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   324  }
   325  
   326  // Provides information on additional privacy protections Amazon Lex should use with the bot's data. See `dataPrivacy`
   327  func (o V2modelsBotOutput) DataPrivacies() V2modelsBotDataPrivacyArrayOutput {
   328  	return o.ApplyT(func(v *V2modelsBot) V2modelsBotDataPrivacyArrayOutput { return v.DataPrivacies }).(V2modelsBotDataPrivacyArrayOutput)
   329  }
   330  
   331  // Description of the bot. It appears in lists to help you identify a particular bot.
   332  func (o V2modelsBotOutput) Description() pulumi.StringPtrOutput {
   333  	return o.ApplyT(func(v *V2modelsBot) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   334  }
   335  
   336  // Time, in seconds, that Amazon Lex should keep information about a user's conversation with the bot. You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.
   337  func (o V2modelsBotOutput) IdleSessionTtlInSeconds() pulumi.IntOutput {
   338  	return o.ApplyT(func(v *V2modelsBot) pulumi.IntOutput { return v.IdleSessionTtlInSeconds }).(pulumi.IntOutput)
   339  }
   340  
   341  // List of bot members in a network to be created. See `botMembers`.
   342  func (o V2modelsBotOutput) Members() V2modelsBotMemberArrayOutput {
   343  	return o.ApplyT(func(v *V2modelsBot) V2modelsBotMemberArrayOutput { return v.Members }).(V2modelsBotMemberArrayOutput)
   344  }
   345  
   346  // Name of the bot. The bot name must be unique in the account that creates the bot. Type String. Length Constraints: Minimum length of 1. Maximum length of 100.
   347  func (o V2modelsBotOutput) Name() pulumi.StringOutput {
   348  	return o.ApplyT(func(v *V2modelsBot) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   349  }
   350  
   351  // ARN of an IAM role that has permission to access the bot.
   352  //
   353  // The following arguments are optional:
   354  func (o V2modelsBotOutput) RoleArn() pulumi.StringOutput {
   355  	return o.ApplyT(func(v *V2modelsBot) pulumi.StringOutput { return v.RoleArn }).(pulumi.StringOutput)
   356  }
   357  
   358  // List of tags to add to the bot. You can only add tags when you create a bot.
   359  func (o V2modelsBotOutput) Tags() pulumi.StringMapOutput {
   360  	return o.ApplyT(func(v *V2modelsBot) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   361  }
   362  
   363  // Deprecated: Please use `tags` instead.
   364  func (o V2modelsBotOutput) TagsAll() pulumi.StringMapOutput {
   365  	return o.ApplyT(func(v *V2modelsBot) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   366  }
   367  
   368  // List of tags to add to the test alias for a bot. You can only add tags when you create a bot.
   369  func (o V2modelsBotOutput) TestBotAliasTags() pulumi.StringMapOutput {
   370  	return o.ApplyT(func(v *V2modelsBot) pulumi.StringMapOutput { return v.TestBotAliasTags }).(pulumi.StringMapOutput)
   371  }
   372  
   373  func (o V2modelsBotOutput) Timeouts() V2modelsBotTimeoutsPtrOutput {
   374  	return o.ApplyT(func(v *V2modelsBot) V2modelsBotTimeoutsPtrOutput { return v.Timeouts }).(V2modelsBotTimeoutsPtrOutput)
   375  }
   376  
   377  // Type of a bot to create. Possible values are `"Bot"` and `"BotNetwork"`.
   378  func (o V2modelsBotOutput) Type() pulumi.StringOutput {
   379  	return o.ApplyT(func(v *V2modelsBot) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
   380  }
   381  
   382  type V2modelsBotArrayOutput struct{ *pulumi.OutputState }
   383  
   384  func (V2modelsBotArrayOutput) ElementType() reflect.Type {
   385  	return reflect.TypeOf((*[]*V2modelsBot)(nil)).Elem()
   386  }
   387  
   388  func (o V2modelsBotArrayOutput) ToV2modelsBotArrayOutput() V2modelsBotArrayOutput {
   389  	return o
   390  }
   391  
   392  func (o V2modelsBotArrayOutput) ToV2modelsBotArrayOutputWithContext(ctx context.Context) V2modelsBotArrayOutput {
   393  	return o
   394  }
   395  
   396  func (o V2modelsBotArrayOutput) Index(i pulumi.IntInput) V2modelsBotOutput {
   397  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *V2modelsBot {
   398  		return vs[0].([]*V2modelsBot)[vs[1].(int)]
   399  	}).(V2modelsBotOutput)
   400  }
   401  
   402  type V2modelsBotMapOutput struct{ *pulumi.OutputState }
   403  
   404  func (V2modelsBotMapOutput) ElementType() reflect.Type {
   405  	return reflect.TypeOf((*map[string]*V2modelsBot)(nil)).Elem()
   406  }
   407  
   408  func (o V2modelsBotMapOutput) ToV2modelsBotMapOutput() V2modelsBotMapOutput {
   409  	return o
   410  }
   411  
   412  func (o V2modelsBotMapOutput) ToV2modelsBotMapOutputWithContext(ctx context.Context) V2modelsBotMapOutput {
   413  	return o
   414  }
   415  
   416  func (o V2modelsBotMapOutput) MapIndex(k pulumi.StringInput) V2modelsBotOutput {
   417  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *V2modelsBot {
   418  		return vs[0].(map[string]*V2modelsBot)[vs[1].(string)]
   419  	}).(V2modelsBotOutput)
   420  }
   421  
   422  func init() {
   423  	pulumi.RegisterInputType(reflect.TypeOf((*V2modelsBotInput)(nil)).Elem(), &V2modelsBot{})
   424  	pulumi.RegisterInputType(reflect.TypeOf((*V2modelsBotArrayInput)(nil)).Elem(), V2modelsBotArray{})
   425  	pulumi.RegisterInputType(reflect.TypeOf((*V2modelsBotMapInput)(nil)).Elem(), V2modelsBotMap{})
   426  	pulumi.RegisterOutputType(V2modelsBotOutput{})
   427  	pulumi.RegisterOutputType(V2modelsBotArrayOutput{})
   428  	pulumi.RegisterOutputType(V2modelsBotMapOutput{})
   429  }