github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/lex/botAlias.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  // Provides an Amazon Lex Bot Alias resource. For more information see
    16  // [Amazon Lex: How It Works](https://docs.aws.amazon.com/lex/latest/dg/how-it-works.html)
    17  //
    18  // ## Example Usage
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lex"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			_, err := lex.NewBotAlias(ctx, "order_flowers_prod", &lex.BotAliasArgs{
    34  //				BotName:     pulumi.String("OrderFlowers"),
    35  //				BotVersion:  pulumi.String("1"),
    36  //				Description: pulumi.String("Production Version of the OrderFlowers Bot."),
    37  //				Name:        pulumi.String("OrderFlowersProd"),
    38  //			})
    39  //			if err != nil {
    40  //				return err
    41  //			}
    42  //			return nil
    43  //		})
    44  //	}
    45  //
    46  // ```
    47  // <!--End PulumiCodeChooser -->
    48  //
    49  // ## Import
    50  //
    51  // Using `pulumi import`, import bot aliases using an ID with the format `bot_name:bot_alias_name`. For example:
    52  //
    53  // ```sh
    54  // $ pulumi import aws:lex/botAlias:BotAlias order_flowers_prod OrderFlowers:OrderFlowersProd
    55  // ```
    56  type BotAlias struct {
    57  	pulumi.CustomResourceState
    58  
    59  	// The ARN of the bot alias.
    60  	Arn pulumi.StringOutput `pulumi:"arn"`
    61  	// The name of the bot.
    62  	BotName pulumi.StringOutput `pulumi:"botName"`
    63  	// The version of the bot.
    64  	BotVersion pulumi.StringOutput `pulumi:"botVersion"`
    65  	// Checksum of the bot alias.
    66  	Checksum pulumi.StringOutput `pulumi:"checksum"`
    67  	// The settings that determine how Amazon Lex uses conversation logs for the alias. Attributes are documented under conversation_logs.
    68  	ConversationLogs BotAliasConversationLogsPtrOutput `pulumi:"conversationLogs"`
    69  	// The date that the bot alias was created.
    70  	CreatedDate pulumi.StringOutput `pulumi:"createdDate"`
    71  	// A description of the alias. Must be less than or equal to 200 characters in length.
    72  	Description pulumi.StringPtrOutput `pulumi:"description"`
    73  	// The date that the bot alias was updated. When you create a resource, the creation date and the last updated date are the same.
    74  	LastUpdatedDate pulumi.StringOutput `pulumi:"lastUpdatedDate"`
    75  	// The name of the alias. The name is not case sensitive. Must be less than or equal to 100 characters in length.
    76  	Name pulumi.StringOutput `pulumi:"name"`
    77  }
    78  
    79  // NewBotAlias registers a new resource with the given unique name, arguments, and options.
    80  func NewBotAlias(ctx *pulumi.Context,
    81  	name string, args *BotAliasArgs, opts ...pulumi.ResourceOption) (*BotAlias, error) {
    82  	if args == nil {
    83  		return nil, errors.New("missing one or more required arguments")
    84  	}
    85  
    86  	if args.BotName == nil {
    87  		return nil, errors.New("invalid value for required argument 'BotName'")
    88  	}
    89  	if args.BotVersion == nil {
    90  		return nil, errors.New("invalid value for required argument 'BotVersion'")
    91  	}
    92  	opts = internal.PkgResourceDefaultOpts(opts)
    93  	var resource BotAlias
    94  	err := ctx.RegisterResource("aws:lex/botAlias:BotAlias", name, args, &resource, opts...)
    95  	if err != nil {
    96  		return nil, err
    97  	}
    98  	return &resource, nil
    99  }
   100  
   101  // GetBotAlias gets an existing BotAlias resource's state with the given name, ID, and optional
   102  // state properties that are used to uniquely qualify the lookup (nil if not required).
   103  func GetBotAlias(ctx *pulumi.Context,
   104  	name string, id pulumi.IDInput, state *BotAliasState, opts ...pulumi.ResourceOption) (*BotAlias, error) {
   105  	var resource BotAlias
   106  	err := ctx.ReadResource("aws:lex/botAlias:BotAlias", name, id, state, &resource, opts...)
   107  	if err != nil {
   108  		return nil, err
   109  	}
   110  	return &resource, nil
   111  }
   112  
   113  // Input properties used for looking up and filtering BotAlias resources.
   114  type botAliasState struct {
   115  	// The ARN of the bot alias.
   116  	Arn *string `pulumi:"arn"`
   117  	// The name of the bot.
   118  	BotName *string `pulumi:"botName"`
   119  	// The version of the bot.
   120  	BotVersion *string `pulumi:"botVersion"`
   121  	// Checksum of the bot alias.
   122  	Checksum *string `pulumi:"checksum"`
   123  	// The settings that determine how Amazon Lex uses conversation logs for the alias. Attributes are documented under conversation_logs.
   124  	ConversationLogs *BotAliasConversationLogs `pulumi:"conversationLogs"`
   125  	// The date that the bot alias was created.
   126  	CreatedDate *string `pulumi:"createdDate"`
   127  	// A description of the alias. Must be less than or equal to 200 characters in length.
   128  	Description *string `pulumi:"description"`
   129  	// The date that the bot alias was updated. When you create a resource, the creation date and the last updated date are the same.
   130  	LastUpdatedDate *string `pulumi:"lastUpdatedDate"`
   131  	// The name of the alias. The name is not case sensitive. Must be less than or equal to 100 characters in length.
   132  	Name *string `pulumi:"name"`
   133  }
   134  
   135  type BotAliasState struct {
   136  	// The ARN of the bot alias.
   137  	Arn pulumi.StringPtrInput
   138  	// The name of the bot.
   139  	BotName pulumi.StringPtrInput
   140  	// The version of the bot.
   141  	BotVersion pulumi.StringPtrInput
   142  	// Checksum of the bot alias.
   143  	Checksum pulumi.StringPtrInput
   144  	// The settings that determine how Amazon Lex uses conversation logs for the alias. Attributes are documented under conversation_logs.
   145  	ConversationLogs BotAliasConversationLogsPtrInput
   146  	// The date that the bot alias was created.
   147  	CreatedDate pulumi.StringPtrInput
   148  	// A description of the alias. Must be less than or equal to 200 characters in length.
   149  	Description pulumi.StringPtrInput
   150  	// The date that the bot alias was updated. When you create a resource, the creation date and the last updated date are the same.
   151  	LastUpdatedDate pulumi.StringPtrInput
   152  	// The name of the alias. The name is not case sensitive. Must be less than or equal to 100 characters in length.
   153  	Name pulumi.StringPtrInput
   154  }
   155  
   156  func (BotAliasState) ElementType() reflect.Type {
   157  	return reflect.TypeOf((*botAliasState)(nil)).Elem()
   158  }
   159  
   160  type botAliasArgs struct {
   161  	// The name of the bot.
   162  	BotName string `pulumi:"botName"`
   163  	// The version of the bot.
   164  	BotVersion string `pulumi:"botVersion"`
   165  	// The settings that determine how Amazon Lex uses conversation logs for the alias. Attributes are documented under conversation_logs.
   166  	ConversationLogs *BotAliasConversationLogs `pulumi:"conversationLogs"`
   167  	// A description of the alias. Must be less than or equal to 200 characters in length.
   168  	Description *string `pulumi:"description"`
   169  	// The name of the alias. The name is not case sensitive. Must be less than or equal to 100 characters in length.
   170  	Name *string `pulumi:"name"`
   171  }
   172  
   173  // The set of arguments for constructing a BotAlias resource.
   174  type BotAliasArgs struct {
   175  	// The name of the bot.
   176  	BotName pulumi.StringInput
   177  	// The version of the bot.
   178  	BotVersion pulumi.StringInput
   179  	// The settings that determine how Amazon Lex uses conversation logs for the alias. Attributes are documented under conversation_logs.
   180  	ConversationLogs BotAliasConversationLogsPtrInput
   181  	// A description of the alias. Must be less than or equal to 200 characters in length.
   182  	Description pulumi.StringPtrInput
   183  	// The name of the alias. The name is not case sensitive. Must be less than or equal to 100 characters in length.
   184  	Name pulumi.StringPtrInput
   185  }
   186  
   187  func (BotAliasArgs) ElementType() reflect.Type {
   188  	return reflect.TypeOf((*botAliasArgs)(nil)).Elem()
   189  }
   190  
   191  type BotAliasInput interface {
   192  	pulumi.Input
   193  
   194  	ToBotAliasOutput() BotAliasOutput
   195  	ToBotAliasOutputWithContext(ctx context.Context) BotAliasOutput
   196  }
   197  
   198  func (*BotAlias) ElementType() reflect.Type {
   199  	return reflect.TypeOf((**BotAlias)(nil)).Elem()
   200  }
   201  
   202  func (i *BotAlias) ToBotAliasOutput() BotAliasOutput {
   203  	return i.ToBotAliasOutputWithContext(context.Background())
   204  }
   205  
   206  func (i *BotAlias) ToBotAliasOutputWithContext(ctx context.Context) BotAliasOutput {
   207  	return pulumi.ToOutputWithContext(ctx, i).(BotAliasOutput)
   208  }
   209  
   210  // BotAliasArrayInput is an input type that accepts BotAliasArray and BotAliasArrayOutput values.
   211  // You can construct a concrete instance of `BotAliasArrayInput` via:
   212  //
   213  //	BotAliasArray{ BotAliasArgs{...} }
   214  type BotAliasArrayInput interface {
   215  	pulumi.Input
   216  
   217  	ToBotAliasArrayOutput() BotAliasArrayOutput
   218  	ToBotAliasArrayOutputWithContext(context.Context) BotAliasArrayOutput
   219  }
   220  
   221  type BotAliasArray []BotAliasInput
   222  
   223  func (BotAliasArray) ElementType() reflect.Type {
   224  	return reflect.TypeOf((*[]*BotAlias)(nil)).Elem()
   225  }
   226  
   227  func (i BotAliasArray) ToBotAliasArrayOutput() BotAliasArrayOutput {
   228  	return i.ToBotAliasArrayOutputWithContext(context.Background())
   229  }
   230  
   231  func (i BotAliasArray) ToBotAliasArrayOutputWithContext(ctx context.Context) BotAliasArrayOutput {
   232  	return pulumi.ToOutputWithContext(ctx, i).(BotAliasArrayOutput)
   233  }
   234  
   235  // BotAliasMapInput is an input type that accepts BotAliasMap and BotAliasMapOutput values.
   236  // You can construct a concrete instance of `BotAliasMapInput` via:
   237  //
   238  //	BotAliasMap{ "key": BotAliasArgs{...} }
   239  type BotAliasMapInput interface {
   240  	pulumi.Input
   241  
   242  	ToBotAliasMapOutput() BotAliasMapOutput
   243  	ToBotAliasMapOutputWithContext(context.Context) BotAliasMapOutput
   244  }
   245  
   246  type BotAliasMap map[string]BotAliasInput
   247  
   248  func (BotAliasMap) ElementType() reflect.Type {
   249  	return reflect.TypeOf((*map[string]*BotAlias)(nil)).Elem()
   250  }
   251  
   252  func (i BotAliasMap) ToBotAliasMapOutput() BotAliasMapOutput {
   253  	return i.ToBotAliasMapOutputWithContext(context.Background())
   254  }
   255  
   256  func (i BotAliasMap) ToBotAliasMapOutputWithContext(ctx context.Context) BotAliasMapOutput {
   257  	return pulumi.ToOutputWithContext(ctx, i).(BotAliasMapOutput)
   258  }
   259  
   260  type BotAliasOutput struct{ *pulumi.OutputState }
   261  
   262  func (BotAliasOutput) ElementType() reflect.Type {
   263  	return reflect.TypeOf((**BotAlias)(nil)).Elem()
   264  }
   265  
   266  func (o BotAliasOutput) ToBotAliasOutput() BotAliasOutput {
   267  	return o
   268  }
   269  
   270  func (o BotAliasOutput) ToBotAliasOutputWithContext(ctx context.Context) BotAliasOutput {
   271  	return o
   272  }
   273  
   274  // The ARN of the bot alias.
   275  func (o BotAliasOutput) Arn() pulumi.StringOutput {
   276  	return o.ApplyT(func(v *BotAlias) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   277  }
   278  
   279  // The name of the bot.
   280  func (o BotAliasOutput) BotName() pulumi.StringOutput {
   281  	return o.ApplyT(func(v *BotAlias) pulumi.StringOutput { return v.BotName }).(pulumi.StringOutput)
   282  }
   283  
   284  // The version of the bot.
   285  func (o BotAliasOutput) BotVersion() pulumi.StringOutput {
   286  	return o.ApplyT(func(v *BotAlias) pulumi.StringOutput { return v.BotVersion }).(pulumi.StringOutput)
   287  }
   288  
   289  // Checksum of the bot alias.
   290  func (o BotAliasOutput) Checksum() pulumi.StringOutput {
   291  	return o.ApplyT(func(v *BotAlias) pulumi.StringOutput { return v.Checksum }).(pulumi.StringOutput)
   292  }
   293  
   294  // The settings that determine how Amazon Lex uses conversation logs for the alias. Attributes are documented under conversation_logs.
   295  func (o BotAliasOutput) ConversationLogs() BotAliasConversationLogsPtrOutput {
   296  	return o.ApplyT(func(v *BotAlias) BotAliasConversationLogsPtrOutput { return v.ConversationLogs }).(BotAliasConversationLogsPtrOutput)
   297  }
   298  
   299  // The date that the bot alias was created.
   300  func (o BotAliasOutput) CreatedDate() pulumi.StringOutput {
   301  	return o.ApplyT(func(v *BotAlias) pulumi.StringOutput { return v.CreatedDate }).(pulumi.StringOutput)
   302  }
   303  
   304  // A description of the alias. Must be less than or equal to 200 characters in length.
   305  func (o BotAliasOutput) Description() pulumi.StringPtrOutput {
   306  	return o.ApplyT(func(v *BotAlias) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   307  }
   308  
   309  // The date that the bot alias was updated. When you create a resource, the creation date and the last updated date are the same.
   310  func (o BotAliasOutput) LastUpdatedDate() pulumi.StringOutput {
   311  	return o.ApplyT(func(v *BotAlias) pulumi.StringOutput { return v.LastUpdatedDate }).(pulumi.StringOutput)
   312  }
   313  
   314  // The name of the alias. The name is not case sensitive. Must be less than or equal to 100 characters in length.
   315  func (o BotAliasOutput) Name() pulumi.StringOutput {
   316  	return o.ApplyT(func(v *BotAlias) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   317  }
   318  
   319  type BotAliasArrayOutput struct{ *pulumi.OutputState }
   320  
   321  func (BotAliasArrayOutput) ElementType() reflect.Type {
   322  	return reflect.TypeOf((*[]*BotAlias)(nil)).Elem()
   323  }
   324  
   325  func (o BotAliasArrayOutput) ToBotAliasArrayOutput() BotAliasArrayOutput {
   326  	return o
   327  }
   328  
   329  func (o BotAliasArrayOutput) ToBotAliasArrayOutputWithContext(ctx context.Context) BotAliasArrayOutput {
   330  	return o
   331  }
   332  
   333  func (o BotAliasArrayOutput) Index(i pulumi.IntInput) BotAliasOutput {
   334  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *BotAlias {
   335  		return vs[0].([]*BotAlias)[vs[1].(int)]
   336  	}).(BotAliasOutput)
   337  }
   338  
   339  type BotAliasMapOutput struct{ *pulumi.OutputState }
   340  
   341  func (BotAliasMapOutput) ElementType() reflect.Type {
   342  	return reflect.TypeOf((*map[string]*BotAlias)(nil)).Elem()
   343  }
   344  
   345  func (o BotAliasMapOutput) ToBotAliasMapOutput() BotAliasMapOutput {
   346  	return o
   347  }
   348  
   349  func (o BotAliasMapOutput) ToBotAliasMapOutputWithContext(ctx context.Context) BotAliasMapOutput {
   350  	return o
   351  }
   352  
   353  func (o BotAliasMapOutput) MapIndex(k pulumi.StringInput) BotAliasOutput {
   354  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *BotAlias {
   355  		return vs[0].(map[string]*BotAlias)[vs[1].(string)]
   356  	}).(BotAliasOutput)
   357  }
   358  
   359  func init() {
   360  	pulumi.RegisterInputType(reflect.TypeOf((*BotAliasInput)(nil)).Elem(), &BotAlias{})
   361  	pulumi.RegisterInputType(reflect.TypeOf((*BotAliasArrayInput)(nil)).Elem(), BotAliasArray{})
   362  	pulumi.RegisterInputType(reflect.TypeOf((*BotAliasMapInput)(nil)).Elem(), BotAliasMap{})
   363  	pulumi.RegisterOutputType(BotAliasOutput{})
   364  	pulumi.RegisterOutputType(BotAliasArrayOutput{})
   365  	pulumi.RegisterOutputType(BotAliasMapOutput{})
   366  }