github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/gamelift/gameSessionQueue.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  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Provides an GameLift Game Session Queue resource.
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/gamelift"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := gamelift.NewGameSessionQueue(ctx, "test", &gamelift.GameSessionQueueArgs{
    32  //				Name: pulumi.String("example-session-queue"),
    33  //				Destinations: pulumi.StringArray{
    34  //					usWest2Fleet.Arn,
    35  //					euCentral1Fleet.Arn,
    36  //				},
    37  //				NotificationTarget: pulumi.Any(gameSessionQueueNotifications.Arn),
    38  //				PlayerLatencyPolicies: gamelift.GameSessionQueuePlayerLatencyPolicyArray{
    39  //					&gamelift.GameSessionQueuePlayerLatencyPolicyArgs{
    40  //						MaximumIndividualPlayerLatencyMilliseconds: pulumi.Int(100),
    41  //						PolicyDurationSeconds:                      pulumi.Int(5),
    42  //					},
    43  //					&gamelift.GameSessionQueuePlayerLatencyPolicyArgs{
    44  //						MaximumIndividualPlayerLatencyMilliseconds: pulumi.Int(200),
    45  //					},
    46  //				},
    47  //				TimeoutInSeconds: pulumi.Int(60),
    48  //			})
    49  //			if err != nil {
    50  //				return err
    51  //			}
    52  //			return nil
    53  //		})
    54  //	}
    55  //
    56  // ```
    57  // <!--End PulumiCodeChooser -->
    58  //
    59  // ## Import
    60  //
    61  // Using `pulumi import`, import GameLift Game Session Queues using their `name`. For example:
    62  //
    63  // ```sh
    64  // $ pulumi import aws:gamelift/gameSessionQueue:GameSessionQueue example example
    65  // ```
    66  type GameSessionQueue struct {
    67  	pulumi.CustomResourceState
    68  
    69  	// Game Session Queue ARN.
    70  	Arn pulumi.StringOutput `pulumi:"arn"`
    71  	// Information to be added to all events that are related to this game session queue.
    72  	CustomEventData pulumi.StringPtrOutput `pulumi:"customEventData"`
    73  	// List of fleet/alias ARNs used by session queue for placing game sessions.
    74  	Destinations pulumi.StringArrayOutput `pulumi:"destinations"`
    75  	// Name of the session queue.
    76  	Name pulumi.StringOutput `pulumi:"name"`
    77  	// An SNS topic ARN that is set up to receive game session placement notifications.
    78  	NotificationTarget pulumi.StringPtrOutput `pulumi:"notificationTarget"`
    79  	// One or more policies used to choose fleet based on player latency. See below.
    80  	PlayerLatencyPolicies GameSessionQueuePlayerLatencyPolicyArrayOutput `pulumi:"playerLatencyPolicies"`
    81  	// 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.
    82  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    83  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    84  	//
    85  	// Deprecated: Please use `tags` instead.
    86  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    87  	// Maximum time a game session request can remain in the queue.
    88  	TimeoutInSeconds pulumi.IntPtrOutput `pulumi:"timeoutInSeconds"`
    89  }
    90  
    91  // NewGameSessionQueue registers a new resource with the given unique name, arguments, and options.
    92  func NewGameSessionQueue(ctx *pulumi.Context,
    93  	name string, args *GameSessionQueueArgs, opts ...pulumi.ResourceOption) (*GameSessionQueue, error) {
    94  	if args == nil {
    95  		args = &GameSessionQueueArgs{}
    96  	}
    97  
    98  	opts = internal.PkgResourceDefaultOpts(opts)
    99  	var resource GameSessionQueue
   100  	err := ctx.RegisterResource("aws:gamelift/gameSessionQueue:GameSessionQueue", name, args, &resource, opts...)
   101  	if err != nil {
   102  		return nil, err
   103  	}
   104  	return &resource, nil
   105  }
   106  
   107  // GetGameSessionQueue gets an existing GameSessionQueue resource's state with the given name, ID, and optional
   108  // state properties that are used to uniquely qualify the lookup (nil if not required).
   109  func GetGameSessionQueue(ctx *pulumi.Context,
   110  	name string, id pulumi.IDInput, state *GameSessionQueueState, opts ...pulumi.ResourceOption) (*GameSessionQueue, error) {
   111  	var resource GameSessionQueue
   112  	err := ctx.ReadResource("aws:gamelift/gameSessionQueue:GameSessionQueue", name, id, state, &resource, opts...)
   113  	if err != nil {
   114  		return nil, err
   115  	}
   116  	return &resource, nil
   117  }
   118  
   119  // Input properties used for looking up and filtering GameSessionQueue resources.
   120  type gameSessionQueueState struct {
   121  	// Game Session Queue ARN.
   122  	Arn *string `pulumi:"arn"`
   123  	// Information to be added to all events that are related to this game session queue.
   124  	CustomEventData *string `pulumi:"customEventData"`
   125  	// List of fleet/alias ARNs used by session queue for placing game sessions.
   126  	Destinations []string `pulumi:"destinations"`
   127  	// Name of the session queue.
   128  	Name *string `pulumi:"name"`
   129  	// An SNS topic ARN that is set up to receive game session placement notifications.
   130  	NotificationTarget *string `pulumi:"notificationTarget"`
   131  	// One or more policies used to choose fleet based on player latency. See below.
   132  	PlayerLatencyPolicies []GameSessionQueuePlayerLatencyPolicy `pulumi:"playerLatencyPolicies"`
   133  	// 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.
   134  	Tags map[string]string `pulumi:"tags"`
   135  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   136  	//
   137  	// Deprecated: Please use `tags` instead.
   138  	TagsAll map[string]string `pulumi:"tagsAll"`
   139  	// Maximum time a game session request can remain in the queue.
   140  	TimeoutInSeconds *int `pulumi:"timeoutInSeconds"`
   141  }
   142  
   143  type GameSessionQueueState struct {
   144  	// Game Session Queue ARN.
   145  	Arn pulumi.StringPtrInput
   146  	// Information to be added to all events that are related to this game session queue.
   147  	CustomEventData pulumi.StringPtrInput
   148  	// List of fleet/alias ARNs used by session queue for placing game sessions.
   149  	Destinations pulumi.StringArrayInput
   150  	// Name of the session queue.
   151  	Name pulumi.StringPtrInput
   152  	// An SNS topic ARN that is set up to receive game session placement notifications.
   153  	NotificationTarget pulumi.StringPtrInput
   154  	// One or more policies used to choose fleet based on player latency. See below.
   155  	PlayerLatencyPolicies GameSessionQueuePlayerLatencyPolicyArrayInput
   156  	// 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.
   157  	Tags pulumi.StringMapInput
   158  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   159  	//
   160  	// Deprecated: Please use `tags` instead.
   161  	TagsAll pulumi.StringMapInput
   162  	// Maximum time a game session request can remain in the queue.
   163  	TimeoutInSeconds pulumi.IntPtrInput
   164  }
   165  
   166  func (GameSessionQueueState) ElementType() reflect.Type {
   167  	return reflect.TypeOf((*gameSessionQueueState)(nil)).Elem()
   168  }
   169  
   170  type gameSessionQueueArgs struct {
   171  	// Information to be added to all events that are related to this game session queue.
   172  	CustomEventData *string `pulumi:"customEventData"`
   173  	// List of fleet/alias ARNs used by session queue for placing game sessions.
   174  	Destinations []string `pulumi:"destinations"`
   175  	// Name of the session queue.
   176  	Name *string `pulumi:"name"`
   177  	// An SNS topic ARN that is set up to receive game session placement notifications.
   178  	NotificationTarget *string `pulumi:"notificationTarget"`
   179  	// One or more policies used to choose fleet based on player latency. See below.
   180  	PlayerLatencyPolicies []GameSessionQueuePlayerLatencyPolicy `pulumi:"playerLatencyPolicies"`
   181  	// 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.
   182  	Tags map[string]string `pulumi:"tags"`
   183  	// Maximum time a game session request can remain in the queue.
   184  	TimeoutInSeconds *int `pulumi:"timeoutInSeconds"`
   185  }
   186  
   187  // The set of arguments for constructing a GameSessionQueue resource.
   188  type GameSessionQueueArgs struct {
   189  	// Information to be added to all events that are related to this game session queue.
   190  	CustomEventData pulumi.StringPtrInput
   191  	// List of fleet/alias ARNs used by session queue for placing game sessions.
   192  	Destinations pulumi.StringArrayInput
   193  	// Name of the session queue.
   194  	Name pulumi.StringPtrInput
   195  	// An SNS topic ARN that is set up to receive game session placement notifications.
   196  	NotificationTarget pulumi.StringPtrInput
   197  	// One or more policies used to choose fleet based on player latency. See below.
   198  	PlayerLatencyPolicies GameSessionQueuePlayerLatencyPolicyArrayInput
   199  	// 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.
   200  	Tags pulumi.StringMapInput
   201  	// Maximum time a game session request can remain in the queue.
   202  	TimeoutInSeconds pulumi.IntPtrInput
   203  }
   204  
   205  func (GameSessionQueueArgs) ElementType() reflect.Type {
   206  	return reflect.TypeOf((*gameSessionQueueArgs)(nil)).Elem()
   207  }
   208  
   209  type GameSessionQueueInput interface {
   210  	pulumi.Input
   211  
   212  	ToGameSessionQueueOutput() GameSessionQueueOutput
   213  	ToGameSessionQueueOutputWithContext(ctx context.Context) GameSessionQueueOutput
   214  }
   215  
   216  func (*GameSessionQueue) ElementType() reflect.Type {
   217  	return reflect.TypeOf((**GameSessionQueue)(nil)).Elem()
   218  }
   219  
   220  func (i *GameSessionQueue) ToGameSessionQueueOutput() GameSessionQueueOutput {
   221  	return i.ToGameSessionQueueOutputWithContext(context.Background())
   222  }
   223  
   224  func (i *GameSessionQueue) ToGameSessionQueueOutputWithContext(ctx context.Context) GameSessionQueueOutput {
   225  	return pulumi.ToOutputWithContext(ctx, i).(GameSessionQueueOutput)
   226  }
   227  
   228  // GameSessionQueueArrayInput is an input type that accepts GameSessionQueueArray and GameSessionQueueArrayOutput values.
   229  // You can construct a concrete instance of `GameSessionQueueArrayInput` via:
   230  //
   231  //	GameSessionQueueArray{ GameSessionQueueArgs{...} }
   232  type GameSessionQueueArrayInput interface {
   233  	pulumi.Input
   234  
   235  	ToGameSessionQueueArrayOutput() GameSessionQueueArrayOutput
   236  	ToGameSessionQueueArrayOutputWithContext(context.Context) GameSessionQueueArrayOutput
   237  }
   238  
   239  type GameSessionQueueArray []GameSessionQueueInput
   240  
   241  func (GameSessionQueueArray) ElementType() reflect.Type {
   242  	return reflect.TypeOf((*[]*GameSessionQueue)(nil)).Elem()
   243  }
   244  
   245  func (i GameSessionQueueArray) ToGameSessionQueueArrayOutput() GameSessionQueueArrayOutput {
   246  	return i.ToGameSessionQueueArrayOutputWithContext(context.Background())
   247  }
   248  
   249  func (i GameSessionQueueArray) ToGameSessionQueueArrayOutputWithContext(ctx context.Context) GameSessionQueueArrayOutput {
   250  	return pulumi.ToOutputWithContext(ctx, i).(GameSessionQueueArrayOutput)
   251  }
   252  
   253  // GameSessionQueueMapInput is an input type that accepts GameSessionQueueMap and GameSessionQueueMapOutput values.
   254  // You can construct a concrete instance of `GameSessionQueueMapInput` via:
   255  //
   256  //	GameSessionQueueMap{ "key": GameSessionQueueArgs{...} }
   257  type GameSessionQueueMapInput interface {
   258  	pulumi.Input
   259  
   260  	ToGameSessionQueueMapOutput() GameSessionQueueMapOutput
   261  	ToGameSessionQueueMapOutputWithContext(context.Context) GameSessionQueueMapOutput
   262  }
   263  
   264  type GameSessionQueueMap map[string]GameSessionQueueInput
   265  
   266  func (GameSessionQueueMap) ElementType() reflect.Type {
   267  	return reflect.TypeOf((*map[string]*GameSessionQueue)(nil)).Elem()
   268  }
   269  
   270  func (i GameSessionQueueMap) ToGameSessionQueueMapOutput() GameSessionQueueMapOutput {
   271  	return i.ToGameSessionQueueMapOutputWithContext(context.Background())
   272  }
   273  
   274  func (i GameSessionQueueMap) ToGameSessionQueueMapOutputWithContext(ctx context.Context) GameSessionQueueMapOutput {
   275  	return pulumi.ToOutputWithContext(ctx, i).(GameSessionQueueMapOutput)
   276  }
   277  
   278  type GameSessionQueueOutput struct{ *pulumi.OutputState }
   279  
   280  func (GameSessionQueueOutput) ElementType() reflect.Type {
   281  	return reflect.TypeOf((**GameSessionQueue)(nil)).Elem()
   282  }
   283  
   284  func (o GameSessionQueueOutput) ToGameSessionQueueOutput() GameSessionQueueOutput {
   285  	return o
   286  }
   287  
   288  func (o GameSessionQueueOutput) ToGameSessionQueueOutputWithContext(ctx context.Context) GameSessionQueueOutput {
   289  	return o
   290  }
   291  
   292  // Game Session Queue ARN.
   293  func (o GameSessionQueueOutput) Arn() pulumi.StringOutput {
   294  	return o.ApplyT(func(v *GameSessionQueue) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   295  }
   296  
   297  // Information to be added to all events that are related to this game session queue.
   298  func (o GameSessionQueueOutput) CustomEventData() pulumi.StringPtrOutput {
   299  	return o.ApplyT(func(v *GameSessionQueue) pulumi.StringPtrOutput { return v.CustomEventData }).(pulumi.StringPtrOutput)
   300  }
   301  
   302  // List of fleet/alias ARNs used by session queue for placing game sessions.
   303  func (o GameSessionQueueOutput) Destinations() pulumi.StringArrayOutput {
   304  	return o.ApplyT(func(v *GameSessionQueue) pulumi.StringArrayOutput { return v.Destinations }).(pulumi.StringArrayOutput)
   305  }
   306  
   307  // Name of the session queue.
   308  func (o GameSessionQueueOutput) Name() pulumi.StringOutput {
   309  	return o.ApplyT(func(v *GameSessionQueue) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   310  }
   311  
   312  // An SNS topic ARN that is set up to receive game session placement notifications.
   313  func (o GameSessionQueueOutput) NotificationTarget() pulumi.StringPtrOutput {
   314  	return o.ApplyT(func(v *GameSessionQueue) pulumi.StringPtrOutput { return v.NotificationTarget }).(pulumi.StringPtrOutput)
   315  }
   316  
   317  // One or more policies used to choose fleet based on player latency. See below.
   318  func (o GameSessionQueueOutput) PlayerLatencyPolicies() GameSessionQueuePlayerLatencyPolicyArrayOutput {
   319  	return o.ApplyT(func(v *GameSessionQueue) GameSessionQueuePlayerLatencyPolicyArrayOutput {
   320  		return v.PlayerLatencyPolicies
   321  	}).(GameSessionQueuePlayerLatencyPolicyArrayOutput)
   322  }
   323  
   324  // 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.
   325  func (o GameSessionQueueOutput) Tags() pulumi.StringMapOutput {
   326  	return o.ApplyT(func(v *GameSessionQueue) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   327  }
   328  
   329  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   330  //
   331  // Deprecated: Please use `tags` instead.
   332  func (o GameSessionQueueOutput) TagsAll() pulumi.StringMapOutput {
   333  	return o.ApplyT(func(v *GameSessionQueue) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   334  }
   335  
   336  // Maximum time a game session request can remain in the queue.
   337  func (o GameSessionQueueOutput) TimeoutInSeconds() pulumi.IntPtrOutput {
   338  	return o.ApplyT(func(v *GameSessionQueue) pulumi.IntPtrOutput { return v.TimeoutInSeconds }).(pulumi.IntPtrOutput)
   339  }
   340  
   341  type GameSessionQueueArrayOutput struct{ *pulumi.OutputState }
   342  
   343  func (GameSessionQueueArrayOutput) ElementType() reflect.Type {
   344  	return reflect.TypeOf((*[]*GameSessionQueue)(nil)).Elem()
   345  }
   346  
   347  func (o GameSessionQueueArrayOutput) ToGameSessionQueueArrayOutput() GameSessionQueueArrayOutput {
   348  	return o
   349  }
   350  
   351  func (o GameSessionQueueArrayOutput) ToGameSessionQueueArrayOutputWithContext(ctx context.Context) GameSessionQueueArrayOutput {
   352  	return o
   353  }
   354  
   355  func (o GameSessionQueueArrayOutput) Index(i pulumi.IntInput) GameSessionQueueOutput {
   356  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GameSessionQueue {
   357  		return vs[0].([]*GameSessionQueue)[vs[1].(int)]
   358  	}).(GameSessionQueueOutput)
   359  }
   360  
   361  type GameSessionQueueMapOutput struct{ *pulumi.OutputState }
   362  
   363  func (GameSessionQueueMapOutput) ElementType() reflect.Type {
   364  	return reflect.TypeOf((*map[string]*GameSessionQueue)(nil)).Elem()
   365  }
   366  
   367  func (o GameSessionQueueMapOutput) ToGameSessionQueueMapOutput() GameSessionQueueMapOutput {
   368  	return o
   369  }
   370  
   371  func (o GameSessionQueueMapOutput) ToGameSessionQueueMapOutputWithContext(ctx context.Context) GameSessionQueueMapOutput {
   372  	return o
   373  }
   374  
   375  func (o GameSessionQueueMapOutput) MapIndex(k pulumi.StringInput) GameSessionQueueOutput {
   376  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GameSessionQueue {
   377  		return vs[0].(map[string]*GameSessionQueue)[vs[1].(string)]
   378  	}).(GameSessionQueueOutput)
   379  }
   380  
   381  func init() {
   382  	pulumi.RegisterInputType(reflect.TypeOf((*GameSessionQueueInput)(nil)).Elem(), &GameSessionQueue{})
   383  	pulumi.RegisterInputType(reflect.TypeOf((*GameSessionQueueArrayInput)(nil)).Elem(), GameSessionQueueArray{})
   384  	pulumi.RegisterInputType(reflect.TypeOf((*GameSessionQueueMapInput)(nil)).Elem(), GameSessionQueueMap{})
   385  	pulumi.RegisterOutputType(GameSessionQueueOutput{})
   386  	pulumi.RegisterOutputType(GameSessionQueueArrayOutput{})
   387  	pulumi.RegisterOutputType(GameSessionQueueMapOutput{})
   388  }