github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/gamelift/gameServerGroup.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 an GameLift Game Server Group 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.NewGameServerGroup(ctx, "example", &gamelift.GameServerGroupArgs{ 33 // GameServerGroupName: pulumi.String("example"), 34 // InstanceDefinitions: gamelift.GameServerGroupInstanceDefinitionArray{ 35 // &gamelift.GameServerGroupInstanceDefinitionArgs{ 36 // InstanceType: pulumi.String("c5.large"), 37 // }, 38 // &gamelift.GameServerGroupInstanceDefinitionArgs{ 39 // InstanceType: pulumi.String("c5a.large"), 40 // }, 41 // }, 42 // LaunchTemplate: &gamelift.GameServerGroupLaunchTemplateArgs{ 43 // Id: pulumi.Any(exampleAwsLaunchTemplate.Id), 44 // }, 45 // MaxSize: pulumi.Int(1), 46 // MinSize: pulumi.Int(1), 47 // RoleArn: pulumi.Any(exampleAwsIamRole.Arn), 48 // }, pulumi.DependsOn([]pulumi.Resource{ 49 // exampleAwsIamRolePolicyAttachment, 50 // })) 51 // if err != nil { 52 // return err 53 // } 54 // return nil 55 // }) 56 // } 57 // 58 // ``` 59 // <!--End PulumiCodeChooser --> 60 // 61 // Full usage: 62 // 63 // <!--Start PulumiCodeChooser --> 64 // ```go 65 // package main 66 // 67 // import ( 68 // 69 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/gamelift" 70 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 71 // 72 // ) 73 // 74 // func main() { 75 // pulumi.Run(func(ctx *pulumi.Context) error { 76 // _, err := gamelift.NewGameServerGroup(ctx, "example", &gamelift.GameServerGroupArgs{ 77 // AutoScalingPolicy: &gamelift.GameServerGroupAutoScalingPolicyArgs{ 78 // EstimatedInstanceWarmup: pulumi.Int(60), 79 // TargetTrackingConfiguration: &gamelift.GameServerGroupAutoScalingPolicyTargetTrackingConfigurationArgs{ 80 // TargetValue: pulumi.Float64(75), 81 // }, 82 // }, 83 // BalancingStrategy: pulumi.String("SPOT_ONLY"), 84 // GameServerGroupName: pulumi.String("example"), 85 // GameServerProtectionPolicy: pulumi.String("FULL_PROTECTION"), 86 // InstanceDefinitions: gamelift.GameServerGroupInstanceDefinitionArray{ 87 // &gamelift.GameServerGroupInstanceDefinitionArgs{ 88 // InstanceType: pulumi.String("c5.large"), 89 // WeightedCapacity: pulumi.String("1"), 90 // }, 91 // &gamelift.GameServerGroupInstanceDefinitionArgs{ 92 // InstanceType: pulumi.String("c5.2xlarge"), 93 // WeightedCapacity: pulumi.String("2"), 94 // }, 95 // }, 96 // LaunchTemplate: &gamelift.GameServerGroupLaunchTemplateArgs{ 97 // Id: pulumi.Any(exampleAwsLaunchTemplate.Id), 98 // Version: pulumi.String("1"), 99 // }, 100 // MaxSize: pulumi.Int(1), 101 // MinSize: pulumi.Int(1), 102 // RoleArn: pulumi.Any(exampleAwsIamRole.Arn), 103 // Tags: pulumi.StringMap{ 104 // "Name": pulumi.String("example"), 105 // }, 106 // VpcSubnets: pulumi.StringArray{ 107 // pulumi.String("subnet-12345678"), 108 // pulumi.String("subnet-23456789"), 109 // }, 110 // }, pulumi.DependsOn([]pulumi.Resource{ 111 // exampleAwsIamRolePolicyAttachment, 112 // })) 113 // if err != nil { 114 // return err 115 // } 116 // return nil 117 // }) 118 // } 119 // 120 // ``` 121 // <!--End PulumiCodeChooser --> 122 // 123 // ### Example IAM Role for GameLift Game Server Group 124 // 125 // <!--Start PulumiCodeChooser --> 126 // ```go 127 // package main 128 // 129 // import ( 130 // 131 // "fmt" 132 // 133 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws" 134 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam" 135 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 136 // 137 // ) 138 // 139 // func main() { 140 // pulumi.Run(func(ctx *pulumi.Context) error { 141 // current, err := aws.GetPartition(ctx, nil, nil) 142 // if err != nil { 143 // return err 144 // } 145 // assumeRole, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{ 146 // Statements: []iam.GetPolicyDocumentStatement{ 147 // { 148 // Effect: pulumi.StringRef("Allow"), 149 // Principals: []iam.GetPolicyDocumentStatementPrincipal{ 150 // { 151 // Type: "Service", 152 // Identifiers: []string{ 153 // "autoscaling.amazonaws.com", 154 // "gamelift.amazonaws.com", 155 // }, 156 // }, 157 // }, 158 // Actions: []string{ 159 // "sts:AssumeRole", 160 // }, 161 // }, 162 // }, 163 // }, nil) 164 // if err != nil { 165 // return err 166 // } 167 // example, err := iam.NewRole(ctx, "example", &iam.RoleArgs{ 168 // AssumeRolePolicy: pulumi.String(assumeRole.Json), 169 // Name: pulumi.String("gamelift-game-server-group-example"), 170 // }) 171 // if err != nil { 172 // return err 173 // } 174 // _, err = iam.NewRolePolicyAttachment(ctx, "example", &iam.RolePolicyAttachmentArgs{ 175 // PolicyArn: pulumi.String(fmt.Sprintf("arn:%v:iam::aws:policy/GameLiftGameServerGroupPolicy", current.Partition)), 176 // Role: example.Name, 177 // }) 178 // if err != nil { 179 // return err 180 // } 181 // return nil 182 // }) 183 // } 184 // 185 // ``` 186 // <!--End PulumiCodeChooser --> 187 // 188 // ## Import 189 // 190 // Using `pulumi import`, import GameLift Game Server Group using the `name`. For example: 191 // 192 // ```sh 193 // $ pulumi import aws:gamelift/gameServerGroup:GameServerGroup example example 194 // ``` 195 type GameServerGroup struct { 196 pulumi.CustomResourceState 197 198 // The ARN of the GameLift Game Server Group. 199 Arn pulumi.StringOutput `pulumi:"arn"` 200 // The ARN of the created EC2 Auto Scaling group. 201 AutoScalingGroupArn pulumi.StringOutput `pulumi:"autoScalingGroupArn"` 202 AutoScalingPolicy GameServerGroupAutoScalingPolicyPtrOutput `pulumi:"autoScalingPolicy"` 203 // Indicates how GameLift FleetIQ balances the use of Spot Instances and On-Demand Instances. 204 // Valid values: `SPOT_ONLY`, `SPOT_PREFERRED`, `ON_DEMAND_ONLY`. Defaults to `SPOT_PREFERRED`. 205 BalancingStrategy pulumi.StringOutput `pulumi:"balancingStrategy"` 206 // Name of the game server group. 207 // This value is used to generate unique ARN identifiers for the EC2 Auto Scaling group and the GameLift FleetIQ game server group. 208 GameServerGroupName pulumi.StringOutput `pulumi:"gameServerGroupName"` 209 // Indicates whether instances in the game server group are protected from early termination. 210 // Unprotected instances that have active game servers running might be terminated during a scale-down event, 211 // causing players to be dropped from the game. 212 // Protected instances cannot be terminated while there are active game servers running except in the event 213 // of a forced game server group deletion. 214 // Valid values: `NO_PROTECTION`, `FULL_PROTECTION`. Defaults to `NO_PROTECTION`. 215 GameServerProtectionPolicy pulumi.StringOutput `pulumi:"gameServerProtectionPolicy"` 216 InstanceDefinitions GameServerGroupInstanceDefinitionArrayOutput `pulumi:"instanceDefinitions"` 217 LaunchTemplate GameServerGroupLaunchTemplateOutput `pulumi:"launchTemplate"` 218 // The maximum number of instances allowed in the EC2 Auto Scaling group. 219 // During automatic scaling events, GameLift FleetIQ and EC2 do not scale up the group above this maximum. 220 MaxSize pulumi.IntOutput `pulumi:"maxSize"` 221 // The minimum number of instances allowed in the EC2 Auto Scaling group. 222 // During automatic scaling events, GameLift FleetIQ and EC2 do not scale down the group below this minimum. 223 MinSize pulumi.IntOutput `pulumi:"minSize"` 224 // ARN for an IAM role that allows Amazon GameLift to access your EC2 Auto Scaling groups. 225 RoleArn pulumi.StringOutput `pulumi:"roleArn"` 226 // Key-value map of resource tags 227 Tags pulumi.StringMapOutput `pulumi:"tags"` 228 // Deprecated: Please use `tags` instead. 229 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 230 // A list of VPC subnets to use with instances in the game server group. 231 // By default, all GameLift FleetIQ-supported Availability Zones are used. 232 VpcSubnets pulumi.StringArrayOutput `pulumi:"vpcSubnets"` 233 } 234 235 // NewGameServerGroup registers a new resource with the given unique name, arguments, and options. 236 func NewGameServerGroup(ctx *pulumi.Context, 237 name string, args *GameServerGroupArgs, opts ...pulumi.ResourceOption) (*GameServerGroup, error) { 238 if args == nil { 239 return nil, errors.New("missing one or more required arguments") 240 } 241 242 if args.GameServerGroupName == nil { 243 return nil, errors.New("invalid value for required argument 'GameServerGroupName'") 244 } 245 if args.InstanceDefinitions == nil { 246 return nil, errors.New("invalid value for required argument 'InstanceDefinitions'") 247 } 248 if args.LaunchTemplate == nil { 249 return nil, errors.New("invalid value for required argument 'LaunchTemplate'") 250 } 251 if args.MaxSize == nil { 252 return nil, errors.New("invalid value for required argument 'MaxSize'") 253 } 254 if args.MinSize == nil { 255 return nil, errors.New("invalid value for required argument 'MinSize'") 256 } 257 if args.RoleArn == nil { 258 return nil, errors.New("invalid value for required argument 'RoleArn'") 259 } 260 opts = internal.PkgResourceDefaultOpts(opts) 261 var resource GameServerGroup 262 err := ctx.RegisterResource("aws:gamelift/gameServerGroup:GameServerGroup", name, args, &resource, opts...) 263 if err != nil { 264 return nil, err 265 } 266 return &resource, nil 267 } 268 269 // GetGameServerGroup gets an existing GameServerGroup resource's state with the given name, ID, and optional 270 // state properties that are used to uniquely qualify the lookup (nil if not required). 271 func GetGameServerGroup(ctx *pulumi.Context, 272 name string, id pulumi.IDInput, state *GameServerGroupState, opts ...pulumi.ResourceOption) (*GameServerGroup, error) { 273 var resource GameServerGroup 274 err := ctx.ReadResource("aws:gamelift/gameServerGroup:GameServerGroup", name, id, state, &resource, opts...) 275 if err != nil { 276 return nil, err 277 } 278 return &resource, nil 279 } 280 281 // Input properties used for looking up and filtering GameServerGroup resources. 282 type gameServerGroupState struct { 283 // The ARN of the GameLift Game Server Group. 284 Arn *string `pulumi:"arn"` 285 // The ARN of the created EC2 Auto Scaling group. 286 AutoScalingGroupArn *string `pulumi:"autoScalingGroupArn"` 287 AutoScalingPolicy *GameServerGroupAutoScalingPolicy `pulumi:"autoScalingPolicy"` 288 // Indicates how GameLift FleetIQ balances the use of Spot Instances and On-Demand Instances. 289 // Valid values: `SPOT_ONLY`, `SPOT_PREFERRED`, `ON_DEMAND_ONLY`. Defaults to `SPOT_PREFERRED`. 290 BalancingStrategy *string `pulumi:"balancingStrategy"` 291 // Name of the game server group. 292 // This value is used to generate unique ARN identifiers for the EC2 Auto Scaling group and the GameLift FleetIQ game server group. 293 GameServerGroupName *string `pulumi:"gameServerGroupName"` 294 // Indicates whether instances in the game server group are protected from early termination. 295 // Unprotected instances that have active game servers running might be terminated during a scale-down event, 296 // causing players to be dropped from the game. 297 // Protected instances cannot be terminated while there are active game servers running except in the event 298 // of a forced game server group deletion. 299 // Valid values: `NO_PROTECTION`, `FULL_PROTECTION`. Defaults to `NO_PROTECTION`. 300 GameServerProtectionPolicy *string `pulumi:"gameServerProtectionPolicy"` 301 InstanceDefinitions []GameServerGroupInstanceDefinition `pulumi:"instanceDefinitions"` 302 LaunchTemplate *GameServerGroupLaunchTemplate `pulumi:"launchTemplate"` 303 // The maximum number of instances allowed in the EC2 Auto Scaling group. 304 // During automatic scaling events, GameLift FleetIQ and EC2 do not scale up the group above this maximum. 305 MaxSize *int `pulumi:"maxSize"` 306 // The minimum number of instances allowed in the EC2 Auto Scaling group. 307 // During automatic scaling events, GameLift FleetIQ and EC2 do not scale down the group below this minimum. 308 MinSize *int `pulumi:"minSize"` 309 // ARN for an IAM role that allows Amazon GameLift to access your EC2 Auto Scaling groups. 310 RoleArn *string `pulumi:"roleArn"` 311 // Key-value map of resource tags 312 Tags map[string]string `pulumi:"tags"` 313 // Deprecated: Please use `tags` instead. 314 TagsAll map[string]string `pulumi:"tagsAll"` 315 // A list of VPC subnets to use with instances in the game server group. 316 // By default, all GameLift FleetIQ-supported Availability Zones are used. 317 VpcSubnets []string `pulumi:"vpcSubnets"` 318 } 319 320 type GameServerGroupState struct { 321 // The ARN of the GameLift Game Server Group. 322 Arn pulumi.StringPtrInput 323 // The ARN of the created EC2 Auto Scaling group. 324 AutoScalingGroupArn pulumi.StringPtrInput 325 AutoScalingPolicy GameServerGroupAutoScalingPolicyPtrInput 326 // Indicates how GameLift FleetIQ balances the use of Spot Instances and On-Demand Instances. 327 // Valid values: `SPOT_ONLY`, `SPOT_PREFERRED`, `ON_DEMAND_ONLY`. Defaults to `SPOT_PREFERRED`. 328 BalancingStrategy pulumi.StringPtrInput 329 // Name of the game server group. 330 // This value is used to generate unique ARN identifiers for the EC2 Auto Scaling group and the GameLift FleetIQ game server group. 331 GameServerGroupName pulumi.StringPtrInput 332 // Indicates whether instances in the game server group are protected from early termination. 333 // Unprotected instances that have active game servers running might be terminated during a scale-down event, 334 // causing players to be dropped from the game. 335 // Protected instances cannot be terminated while there are active game servers running except in the event 336 // of a forced game server group deletion. 337 // Valid values: `NO_PROTECTION`, `FULL_PROTECTION`. Defaults to `NO_PROTECTION`. 338 GameServerProtectionPolicy pulumi.StringPtrInput 339 InstanceDefinitions GameServerGroupInstanceDefinitionArrayInput 340 LaunchTemplate GameServerGroupLaunchTemplatePtrInput 341 // The maximum number of instances allowed in the EC2 Auto Scaling group. 342 // During automatic scaling events, GameLift FleetIQ and EC2 do not scale up the group above this maximum. 343 MaxSize pulumi.IntPtrInput 344 // The minimum number of instances allowed in the EC2 Auto Scaling group. 345 // During automatic scaling events, GameLift FleetIQ and EC2 do not scale down the group below this minimum. 346 MinSize pulumi.IntPtrInput 347 // ARN for an IAM role that allows Amazon GameLift to access your EC2 Auto Scaling groups. 348 RoleArn pulumi.StringPtrInput 349 // Key-value map of resource tags 350 Tags pulumi.StringMapInput 351 // Deprecated: Please use `tags` instead. 352 TagsAll pulumi.StringMapInput 353 // A list of VPC subnets to use with instances in the game server group. 354 // By default, all GameLift FleetIQ-supported Availability Zones are used. 355 VpcSubnets pulumi.StringArrayInput 356 } 357 358 func (GameServerGroupState) ElementType() reflect.Type { 359 return reflect.TypeOf((*gameServerGroupState)(nil)).Elem() 360 } 361 362 type gameServerGroupArgs struct { 363 AutoScalingPolicy *GameServerGroupAutoScalingPolicy `pulumi:"autoScalingPolicy"` 364 // Indicates how GameLift FleetIQ balances the use of Spot Instances and On-Demand Instances. 365 // Valid values: `SPOT_ONLY`, `SPOT_PREFERRED`, `ON_DEMAND_ONLY`. Defaults to `SPOT_PREFERRED`. 366 BalancingStrategy *string `pulumi:"balancingStrategy"` 367 // Name of the game server group. 368 // This value is used to generate unique ARN identifiers for the EC2 Auto Scaling group and the GameLift FleetIQ game server group. 369 GameServerGroupName string `pulumi:"gameServerGroupName"` 370 // Indicates whether instances in the game server group are protected from early termination. 371 // Unprotected instances that have active game servers running might be terminated during a scale-down event, 372 // causing players to be dropped from the game. 373 // Protected instances cannot be terminated while there are active game servers running except in the event 374 // of a forced game server group deletion. 375 // Valid values: `NO_PROTECTION`, `FULL_PROTECTION`. Defaults to `NO_PROTECTION`. 376 GameServerProtectionPolicy *string `pulumi:"gameServerProtectionPolicy"` 377 InstanceDefinitions []GameServerGroupInstanceDefinition `pulumi:"instanceDefinitions"` 378 LaunchTemplate GameServerGroupLaunchTemplate `pulumi:"launchTemplate"` 379 // The maximum number of instances allowed in the EC2 Auto Scaling group. 380 // During automatic scaling events, GameLift FleetIQ and EC2 do not scale up the group above this maximum. 381 MaxSize int `pulumi:"maxSize"` 382 // The minimum number of instances allowed in the EC2 Auto Scaling group. 383 // During automatic scaling events, GameLift FleetIQ and EC2 do not scale down the group below this minimum. 384 MinSize int `pulumi:"minSize"` 385 // ARN for an IAM role that allows Amazon GameLift to access your EC2 Auto Scaling groups. 386 RoleArn string `pulumi:"roleArn"` 387 // Key-value map of resource tags 388 Tags map[string]string `pulumi:"tags"` 389 // A list of VPC subnets to use with instances in the game server group. 390 // By default, all GameLift FleetIQ-supported Availability Zones are used. 391 VpcSubnets []string `pulumi:"vpcSubnets"` 392 } 393 394 // The set of arguments for constructing a GameServerGroup resource. 395 type GameServerGroupArgs struct { 396 AutoScalingPolicy GameServerGroupAutoScalingPolicyPtrInput 397 // Indicates how GameLift FleetIQ balances the use of Spot Instances and On-Demand Instances. 398 // Valid values: `SPOT_ONLY`, `SPOT_PREFERRED`, `ON_DEMAND_ONLY`. Defaults to `SPOT_PREFERRED`. 399 BalancingStrategy pulumi.StringPtrInput 400 // Name of the game server group. 401 // This value is used to generate unique ARN identifiers for the EC2 Auto Scaling group and the GameLift FleetIQ game server group. 402 GameServerGroupName pulumi.StringInput 403 // Indicates whether instances in the game server group are protected from early termination. 404 // Unprotected instances that have active game servers running might be terminated during a scale-down event, 405 // causing players to be dropped from the game. 406 // Protected instances cannot be terminated while there are active game servers running except in the event 407 // of a forced game server group deletion. 408 // Valid values: `NO_PROTECTION`, `FULL_PROTECTION`. Defaults to `NO_PROTECTION`. 409 GameServerProtectionPolicy pulumi.StringPtrInput 410 InstanceDefinitions GameServerGroupInstanceDefinitionArrayInput 411 LaunchTemplate GameServerGroupLaunchTemplateInput 412 // The maximum number of instances allowed in the EC2 Auto Scaling group. 413 // During automatic scaling events, GameLift FleetIQ and EC2 do not scale up the group above this maximum. 414 MaxSize pulumi.IntInput 415 // The minimum number of instances allowed in the EC2 Auto Scaling group. 416 // During automatic scaling events, GameLift FleetIQ and EC2 do not scale down the group below this minimum. 417 MinSize pulumi.IntInput 418 // ARN for an IAM role that allows Amazon GameLift to access your EC2 Auto Scaling groups. 419 RoleArn pulumi.StringInput 420 // Key-value map of resource tags 421 Tags pulumi.StringMapInput 422 // A list of VPC subnets to use with instances in the game server group. 423 // By default, all GameLift FleetIQ-supported Availability Zones are used. 424 VpcSubnets pulumi.StringArrayInput 425 } 426 427 func (GameServerGroupArgs) ElementType() reflect.Type { 428 return reflect.TypeOf((*gameServerGroupArgs)(nil)).Elem() 429 } 430 431 type GameServerGroupInput interface { 432 pulumi.Input 433 434 ToGameServerGroupOutput() GameServerGroupOutput 435 ToGameServerGroupOutputWithContext(ctx context.Context) GameServerGroupOutput 436 } 437 438 func (*GameServerGroup) ElementType() reflect.Type { 439 return reflect.TypeOf((**GameServerGroup)(nil)).Elem() 440 } 441 442 func (i *GameServerGroup) ToGameServerGroupOutput() GameServerGroupOutput { 443 return i.ToGameServerGroupOutputWithContext(context.Background()) 444 } 445 446 func (i *GameServerGroup) ToGameServerGroupOutputWithContext(ctx context.Context) GameServerGroupOutput { 447 return pulumi.ToOutputWithContext(ctx, i).(GameServerGroupOutput) 448 } 449 450 // GameServerGroupArrayInput is an input type that accepts GameServerGroupArray and GameServerGroupArrayOutput values. 451 // You can construct a concrete instance of `GameServerGroupArrayInput` via: 452 // 453 // GameServerGroupArray{ GameServerGroupArgs{...} } 454 type GameServerGroupArrayInput interface { 455 pulumi.Input 456 457 ToGameServerGroupArrayOutput() GameServerGroupArrayOutput 458 ToGameServerGroupArrayOutputWithContext(context.Context) GameServerGroupArrayOutput 459 } 460 461 type GameServerGroupArray []GameServerGroupInput 462 463 func (GameServerGroupArray) ElementType() reflect.Type { 464 return reflect.TypeOf((*[]*GameServerGroup)(nil)).Elem() 465 } 466 467 func (i GameServerGroupArray) ToGameServerGroupArrayOutput() GameServerGroupArrayOutput { 468 return i.ToGameServerGroupArrayOutputWithContext(context.Background()) 469 } 470 471 func (i GameServerGroupArray) ToGameServerGroupArrayOutputWithContext(ctx context.Context) GameServerGroupArrayOutput { 472 return pulumi.ToOutputWithContext(ctx, i).(GameServerGroupArrayOutput) 473 } 474 475 // GameServerGroupMapInput is an input type that accepts GameServerGroupMap and GameServerGroupMapOutput values. 476 // You can construct a concrete instance of `GameServerGroupMapInput` via: 477 // 478 // GameServerGroupMap{ "key": GameServerGroupArgs{...} } 479 type GameServerGroupMapInput interface { 480 pulumi.Input 481 482 ToGameServerGroupMapOutput() GameServerGroupMapOutput 483 ToGameServerGroupMapOutputWithContext(context.Context) GameServerGroupMapOutput 484 } 485 486 type GameServerGroupMap map[string]GameServerGroupInput 487 488 func (GameServerGroupMap) ElementType() reflect.Type { 489 return reflect.TypeOf((*map[string]*GameServerGroup)(nil)).Elem() 490 } 491 492 func (i GameServerGroupMap) ToGameServerGroupMapOutput() GameServerGroupMapOutput { 493 return i.ToGameServerGroupMapOutputWithContext(context.Background()) 494 } 495 496 func (i GameServerGroupMap) ToGameServerGroupMapOutputWithContext(ctx context.Context) GameServerGroupMapOutput { 497 return pulumi.ToOutputWithContext(ctx, i).(GameServerGroupMapOutput) 498 } 499 500 type GameServerGroupOutput struct{ *pulumi.OutputState } 501 502 func (GameServerGroupOutput) ElementType() reflect.Type { 503 return reflect.TypeOf((**GameServerGroup)(nil)).Elem() 504 } 505 506 func (o GameServerGroupOutput) ToGameServerGroupOutput() GameServerGroupOutput { 507 return o 508 } 509 510 func (o GameServerGroupOutput) ToGameServerGroupOutputWithContext(ctx context.Context) GameServerGroupOutput { 511 return o 512 } 513 514 // The ARN of the GameLift Game Server Group. 515 func (o GameServerGroupOutput) Arn() pulumi.StringOutput { 516 return o.ApplyT(func(v *GameServerGroup) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 517 } 518 519 // The ARN of the created EC2 Auto Scaling group. 520 func (o GameServerGroupOutput) AutoScalingGroupArn() pulumi.StringOutput { 521 return o.ApplyT(func(v *GameServerGroup) pulumi.StringOutput { return v.AutoScalingGroupArn }).(pulumi.StringOutput) 522 } 523 524 func (o GameServerGroupOutput) AutoScalingPolicy() GameServerGroupAutoScalingPolicyPtrOutput { 525 return o.ApplyT(func(v *GameServerGroup) GameServerGroupAutoScalingPolicyPtrOutput { return v.AutoScalingPolicy }).(GameServerGroupAutoScalingPolicyPtrOutput) 526 } 527 528 // Indicates how GameLift FleetIQ balances the use of Spot Instances and On-Demand Instances. 529 // Valid values: `SPOT_ONLY`, `SPOT_PREFERRED`, `ON_DEMAND_ONLY`. Defaults to `SPOT_PREFERRED`. 530 func (o GameServerGroupOutput) BalancingStrategy() pulumi.StringOutput { 531 return o.ApplyT(func(v *GameServerGroup) pulumi.StringOutput { return v.BalancingStrategy }).(pulumi.StringOutput) 532 } 533 534 // Name of the game server group. 535 // This value is used to generate unique ARN identifiers for the EC2 Auto Scaling group and the GameLift FleetIQ game server group. 536 func (o GameServerGroupOutput) GameServerGroupName() pulumi.StringOutput { 537 return o.ApplyT(func(v *GameServerGroup) pulumi.StringOutput { return v.GameServerGroupName }).(pulumi.StringOutput) 538 } 539 540 // Indicates whether instances in the game server group are protected from early termination. 541 // Unprotected instances that have active game servers running might be terminated during a scale-down event, 542 // causing players to be dropped from the game. 543 // Protected instances cannot be terminated while there are active game servers running except in the event 544 // of a forced game server group deletion. 545 // Valid values: `NO_PROTECTION`, `FULL_PROTECTION`. Defaults to `NO_PROTECTION`. 546 func (o GameServerGroupOutput) GameServerProtectionPolicy() pulumi.StringOutput { 547 return o.ApplyT(func(v *GameServerGroup) pulumi.StringOutput { return v.GameServerProtectionPolicy }).(pulumi.StringOutput) 548 } 549 550 func (o GameServerGroupOutput) InstanceDefinitions() GameServerGroupInstanceDefinitionArrayOutput { 551 return o.ApplyT(func(v *GameServerGroup) GameServerGroupInstanceDefinitionArrayOutput { return v.InstanceDefinitions }).(GameServerGroupInstanceDefinitionArrayOutput) 552 } 553 554 func (o GameServerGroupOutput) LaunchTemplate() GameServerGroupLaunchTemplateOutput { 555 return o.ApplyT(func(v *GameServerGroup) GameServerGroupLaunchTemplateOutput { return v.LaunchTemplate }).(GameServerGroupLaunchTemplateOutput) 556 } 557 558 // The maximum number of instances allowed in the EC2 Auto Scaling group. 559 // During automatic scaling events, GameLift FleetIQ and EC2 do not scale up the group above this maximum. 560 func (o GameServerGroupOutput) MaxSize() pulumi.IntOutput { 561 return o.ApplyT(func(v *GameServerGroup) pulumi.IntOutput { return v.MaxSize }).(pulumi.IntOutput) 562 } 563 564 // The minimum number of instances allowed in the EC2 Auto Scaling group. 565 // During automatic scaling events, GameLift FleetIQ and EC2 do not scale down the group below this minimum. 566 func (o GameServerGroupOutput) MinSize() pulumi.IntOutput { 567 return o.ApplyT(func(v *GameServerGroup) pulumi.IntOutput { return v.MinSize }).(pulumi.IntOutput) 568 } 569 570 // ARN for an IAM role that allows Amazon GameLift to access your EC2 Auto Scaling groups. 571 func (o GameServerGroupOutput) RoleArn() pulumi.StringOutput { 572 return o.ApplyT(func(v *GameServerGroup) pulumi.StringOutput { return v.RoleArn }).(pulumi.StringOutput) 573 } 574 575 // Key-value map of resource tags 576 func (o GameServerGroupOutput) Tags() pulumi.StringMapOutput { 577 return o.ApplyT(func(v *GameServerGroup) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 578 } 579 580 // Deprecated: Please use `tags` instead. 581 func (o GameServerGroupOutput) TagsAll() pulumi.StringMapOutput { 582 return o.ApplyT(func(v *GameServerGroup) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 583 } 584 585 // A list of VPC subnets to use with instances in the game server group. 586 // By default, all GameLift FleetIQ-supported Availability Zones are used. 587 func (o GameServerGroupOutput) VpcSubnets() pulumi.StringArrayOutput { 588 return o.ApplyT(func(v *GameServerGroup) pulumi.StringArrayOutput { return v.VpcSubnets }).(pulumi.StringArrayOutput) 589 } 590 591 type GameServerGroupArrayOutput struct{ *pulumi.OutputState } 592 593 func (GameServerGroupArrayOutput) ElementType() reflect.Type { 594 return reflect.TypeOf((*[]*GameServerGroup)(nil)).Elem() 595 } 596 597 func (o GameServerGroupArrayOutput) ToGameServerGroupArrayOutput() GameServerGroupArrayOutput { 598 return o 599 } 600 601 func (o GameServerGroupArrayOutput) ToGameServerGroupArrayOutputWithContext(ctx context.Context) GameServerGroupArrayOutput { 602 return o 603 } 604 605 func (o GameServerGroupArrayOutput) Index(i pulumi.IntInput) GameServerGroupOutput { 606 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GameServerGroup { 607 return vs[0].([]*GameServerGroup)[vs[1].(int)] 608 }).(GameServerGroupOutput) 609 } 610 611 type GameServerGroupMapOutput struct{ *pulumi.OutputState } 612 613 func (GameServerGroupMapOutput) ElementType() reflect.Type { 614 return reflect.TypeOf((*map[string]*GameServerGroup)(nil)).Elem() 615 } 616 617 func (o GameServerGroupMapOutput) ToGameServerGroupMapOutput() GameServerGroupMapOutput { 618 return o 619 } 620 621 func (o GameServerGroupMapOutput) ToGameServerGroupMapOutputWithContext(ctx context.Context) GameServerGroupMapOutput { 622 return o 623 } 624 625 func (o GameServerGroupMapOutput) MapIndex(k pulumi.StringInput) GameServerGroupOutput { 626 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GameServerGroup { 627 return vs[0].(map[string]*GameServerGroup)[vs[1].(string)] 628 }).(GameServerGroupOutput) 629 } 630 631 func init() { 632 pulumi.RegisterInputType(reflect.TypeOf((*GameServerGroupInput)(nil)).Elem(), &GameServerGroup{}) 633 pulumi.RegisterInputType(reflect.TypeOf((*GameServerGroupArrayInput)(nil)).Elem(), GameServerGroupArray{}) 634 pulumi.RegisterInputType(reflect.TypeOf((*GameServerGroupMapInput)(nil)).Elem(), GameServerGroupMap{}) 635 pulumi.RegisterOutputType(GameServerGroupOutput{}) 636 pulumi.RegisterOutputType(GameServerGroupArrayOutput{}) 637 pulumi.RegisterOutputType(GameServerGroupMapOutput{}) 638 }