github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/gamelift/alias.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 gamelift
     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 a GameLift Alias resource.
    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/gamelift"
    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 := gamelift.NewAlias(ctx, "example", &gamelift.AliasArgs{
    33  //				Name:        pulumi.String("example-alias"),
    34  //				Description: pulumi.String("Example Description"),
    35  //				RoutingStrategy: &gamelift.AliasRoutingStrategyArgs{
    36  //					Message: pulumi.String("Example Message"),
    37  //					Type:    pulumi.String("TERMINAL"),
    38  //				},
    39  //			})
    40  //			if err != nil {
    41  //				return err
    42  //			}
    43  //			return nil
    44  //		})
    45  //	}
    46  //
    47  // ```
    48  // <!--End PulumiCodeChooser -->
    49  //
    50  // ## Import
    51  //
    52  // Using `pulumi import`, import GameLift Aliases using the ID. For example:
    53  //
    54  // ```sh
    55  // $ pulumi import aws:gamelift/alias:Alias example <alias-id>
    56  // ```
    57  type Alias struct {
    58  	pulumi.CustomResourceState
    59  
    60  	// Alias ARN.
    61  	Arn pulumi.StringOutput `pulumi:"arn"`
    62  	// Description of the alias.
    63  	Description pulumi.StringPtrOutput `pulumi:"description"`
    64  	// Name of the alias.
    65  	Name pulumi.StringOutput `pulumi:"name"`
    66  	// Specifies the fleet and/or routing type to use for the alias.
    67  	RoutingStrategy AliasRoutingStrategyOutput `pulumi:"routingStrategy"`
    68  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    69  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    70  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    71  	//
    72  	// Deprecated: Please use `tags` instead.
    73  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    74  }
    75  
    76  // NewAlias registers a new resource with the given unique name, arguments, and options.
    77  func NewAlias(ctx *pulumi.Context,
    78  	name string, args *AliasArgs, opts ...pulumi.ResourceOption) (*Alias, error) {
    79  	if args == nil {
    80  		return nil, errors.New("missing one or more required arguments")
    81  	}
    82  
    83  	if args.RoutingStrategy == nil {
    84  		return nil, errors.New("invalid value for required argument 'RoutingStrategy'")
    85  	}
    86  	opts = internal.PkgResourceDefaultOpts(opts)
    87  	var resource Alias
    88  	err := ctx.RegisterResource("aws:gamelift/alias:Alias", name, args, &resource, opts...)
    89  	if err != nil {
    90  		return nil, err
    91  	}
    92  	return &resource, nil
    93  }
    94  
    95  // GetAlias gets an existing Alias resource's state with the given name, ID, and optional
    96  // state properties that are used to uniquely qualify the lookup (nil if not required).
    97  func GetAlias(ctx *pulumi.Context,
    98  	name string, id pulumi.IDInput, state *AliasState, opts ...pulumi.ResourceOption) (*Alias, error) {
    99  	var resource Alias
   100  	err := ctx.ReadResource("aws:gamelift/alias:Alias", name, id, state, &resource, opts...)
   101  	if err != nil {
   102  		return nil, err
   103  	}
   104  	return &resource, nil
   105  }
   106  
   107  // Input properties used for looking up and filtering Alias resources.
   108  type aliasState struct {
   109  	// Alias ARN.
   110  	Arn *string `pulumi:"arn"`
   111  	// Description of the alias.
   112  	Description *string `pulumi:"description"`
   113  	// Name of the alias.
   114  	Name *string `pulumi:"name"`
   115  	// Specifies the fleet and/or routing type to use for the alias.
   116  	RoutingStrategy *AliasRoutingStrategy `pulumi:"routingStrategy"`
   117  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   118  	Tags map[string]string `pulumi:"tags"`
   119  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   120  	//
   121  	// Deprecated: Please use `tags` instead.
   122  	TagsAll map[string]string `pulumi:"tagsAll"`
   123  }
   124  
   125  type AliasState struct {
   126  	// Alias ARN.
   127  	Arn pulumi.StringPtrInput
   128  	// Description of the alias.
   129  	Description pulumi.StringPtrInput
   130  	// Name of the alias.
   131  	Name pulumi.StringPtrInput
   132  	// Specifies the fleet and/or routing type to use for the alias.
   133  	RoutingStrategy AliasRoutingStrategyPtrInput
   134  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   135  	Tags pulumi.StringMapInput
   136  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   137  	//
   138  	// Deprecated: Please use `tags` instead.
   139  	TagsAll pulumi.StringMapInput
   140  }
   141  
   142  func (AliasState) ElementType() reflect.Type {
   143  	return reflect.TypeOf((*aliasState)(nil)).Elem()
   144  }
   145  
   146  type aliasArgs struct {
   147  	// Description of the alias.
   148  	Description *string `pulumi:"description"`
   149  	// Name of the alias.
   150  	Name *string `pulumi:"name"`
   151  	// Specifies the fleet and/or routing type to use for the alias.
   152  	RoutingStrategy AliasRoutingStrategy `pulumi:"routingStrategy"`
   153  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   154  	Tags map[string]string `pulumi:"tags"`
   155  }
   156  
   157  // The set of arguments for constructing a Alias resource.
   158  type AliasArgs struct {
   159  	// Description of the alias.
   160  	Description pulumi.StringPtrInput
   161  	// Name of the alias.
   162  	Name pulumi.StringPtrInput
   163  	// Specifies the fleet and/or routing type to use for the alias.
   164  	RoutingStrategy AliasRoutingStrategyInput
   165  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   166  	Tags pulumi.StringMapInput
   167  }
   168  
   169  func (AliasArgs) ElementType() reflect.Type {
   170  	return reflect.TypeOf((*aliasArgs)(nil)).Elem()
   171  }
   172  
   173  type AliasInput interface {
   174  	pulumi.Input
   175  
   176  	ToAliasOutput() AliasOutput
   177  	ToAliasOutputWithContext(ctx context.Context) AliasOutput
   178  }
   179  
   180  func (*Alias) ElementType() reflect.Type {
   181  	return reflect.TypeOf((**Alias)(nil)).Elem()
   182  }
   183  
   184  func (i *Alias) ToAliasOutput() AliasOutput {
   185  	return i.ToAliasOutputWithContext(context.Background())
   186  }
   187  
   188  func (i *Alias) ToAliasOutputWithContext(ctx context.Context) AliasOutput {
   189  	return pulumi.ToOutputWithContext(ctx, i).(AliasOutput)
   190  }
   191  
   192  // AliasArrayInput is an input type that accepts AliasArray and AliasArrayOutput values.
   193  // You can construct a concrete instance of `AliasArrayInput` via:
   194  //
   195  //	AliasArray{ AliasArgs{...} }
   196  type AliasArrayInput interface {
   197  	pulumi.Input
   198  
   199  	ToAliasArrayOutput() AliasArrayOutput
   200  	ToAliasArrayOutputWithContext(context.Context) AliasArrayOutput
   201  }
   202  
   203  type AliasArray []AliasInput
   204  
   205  func (AliasArray) ElementType() reflect.Type {
   206  	return reflect.TypeOf((*[]*Alias)(nil)).Elem()
   207  }
   208  
   209  func (i AliasArray) ToAliasArrayOutput() AliasArrayOutput {
   210  	return i.ToAliasArrayOutputWithContext(context.Background())
   211  }
   212  
   213  func (i AliasArray) ToAliasArrayOutputWithContext(ctx context.Context) AliasArrayOutput {
   214  	return pulumi.ToOutputWithContext(ctx, i).(AliasArrayOutput)
   215  }
   216  
   217  // AliasMapInput is an input type that accepts AliasMap and AliasMapOutput values.
   218  // You can construct a concrete instance of `AliasMapInput` via:
   219  //
   220  //	AliasMap{ "key": AliasArgs{...} }
   221  type AliasMapInput interface {
   222  	pulumi.Input
   223  
   224  	ToAliasMapOutput() AliasMapOutput
   225  	ToAliasMapOutputWithContext(context.Context) AliasMapOutput
   226  }
   227  
   228  type AliasMap map[string]AliasInput
   229  
   230  func (AliasMap) ElementType() reflect.Type {
   231  	return reflect.TypeOf((*map[string]*Alias)(nil)).Elem()
   232  }
   233  
   234  func (i AliasMap) ToAliasMapOutput() AliasMapOutput {
   235  	return i.ToAliasMapOutputWithContext(context.Background())
   236  }
   237  
   238  func (i AliasMap) ToAliasMapOutputWithContext(ctx context.Context) AliasMapOutput {
   239  	return pulumi.ToOutputWithContext(ctx, i).(AliasMapOutput)
   240  }
   241  
   242  type AliasOutput struct{ *pulumi.OutputState }
   243  
   244  func (AliasOutput) ElementType() reflect.Type {
   245  	return reflect.TypeOf((**Alias)(nil)).Elem()
   246  }
   247  
   248  func (o AliasOutput) ToAliasOutput() AliasOutput {
   249  	return o
   250  }
   251  
   252  func (o AliasOutput) ToAliasOutputWithContext(ctx context.Context) AliasOutput {
   253  	return o
   254  }
   255  
   256  // Alias ARN.
   257  func (o AliasOutput) Arn() pulumi.StringOutput {
   258  	return o.ApplyT(func(v *Alias) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   259  }
   260  
   261  // Description of the alias.
   262  func (o AliasOutput) Description() pulumi.StringPtrOutput {
   263  	return o.ApplyT(func(v *Alias) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   264  }
   265  
   266  // Name of the alias.
   267  func (o AliasOutput) Name() pulumi.StringOutput {
   268  	return o.ApplyT(func(v *Alias) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   269  }
   270  
   271  // Specifies the fleet and/or routing type to use for the alias.
   272  func (o AliasOutput) RoutingStrategy() AliasRoutingStrategyOutput {
   273  	return o.ApplyT(func(v *Alias) AliasRoutingStrategyOutput { return v.RoutingStrategy }).(AliasRoutingStrategyOutput)
   274  }
   275  
   276  // Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   277  func (o AliasOutput) Tags() pulumi.StringMapOutput {
   278  	return o.ApplyT(func(v *Alias) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   279  }
   280  
   281  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   282  //
   283  // Deprecated: Please use `tags` instead.
   284  func (o AliasOutput) TagsAll() pulumi.StringMapOutput {
   285  	return o.ApplyT(func(v *Alias) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   286  }
   287  
   288  type AliasArrayOutput struct{ *pulumi.OutputState }
   289  
   290  func (AliasArrayOutput) ElementType() reflect.Type {
   291  	return reflect.TypeOf((*[]*Alias)(nil)).Elem()
   292  }
   293  
   294  func (o AliasArrayOutput) ToAliasArrayOutput() AliasArrayOutput {
   295  	return o
   296  }
   297  
   298  func (o AliasArrayOutput) ToAliasArrayOutputWithContext(ctx context.Context) AliasArrayOutput {
   299  	return o
   300  }
   301  
   302  func (o AliasArrayOutput) Index(i pulumi.IntInput) AliasOutput {
   303  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Alias {
   304  		return vs[0].([]*Alias)[vs[1].(int)]
   305  	}).(AliasOutput)
   306  }
   307  
   308  type AliasMapOutput struct{ *pulumi.OutputState }
   309  
   310  func (AliasMapOutput) ElementType() reflect.Type {
   311  	return reflect.TypeOf((*map[string]*Alias)(nil)).Elem()
   312  }
   313  
   314  func (o AliasMapOutput) ToAliasMapOutput() AliasMapOutput {
   315  	return o
   316  }
   317  
   318  func (o AliasMapOutput) ToAliasMapOutputWithContext(ctx context.Context) AliasMapOutput {
   319  	return o
   320  }
   321  
   322  func (o AliasMapOutput) MapIndex(k pulumi.StringInput) AliasOutput {
   323  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Alias {
   324  		return vs[0].(map[string]*Alias)[vs[1].(string)]
   325  	}).(AliasOutput)
   326  }
   327  
   328  func init() {
   329  	pulumi.RegisterInputType(reflect.TypeOf((*AliasInput)(nil)).Elem(), &Alias{})
   330  	pulumi.RegisterInputType(reflect.TypeOf((*AliasArrayInput)(nil)).Elem(), AliasArray{})
   331  	pulumi.RegisterInputType(reflect.TypeOf((*AliasMapInput)(nil)).Elem(), AliasMap{})
   332  	pulumi.RegisterOutputType(AliasOutput{})
   333  	pulumi.RegisterOutputType(AliasArrayOutput{})
   334  	pulumi.RegisterOutputType(AliasMapOutput{})
   335  }