GameServerGroupArgs

data class GameServerGroupArgs(val autoScalingPolicy: Output<GameServerGroupAutoScalingPolicyArgs>? = null, val balancingStrategy: Output<String>? = null, val gameServerGroupName: Output<String>? = null, val gameServerProtectionPolicy: Output<String>? = null, val instanceDefinitions: Output<List<GameServerGroupInstanceDefinitionArgs>>? = null, val launchTemplate: Output<GameServerGroupLaunchTemplateArgs>? = null, val maxSize: Output<Int>? = null, val minSize: Output<Int>? = null, val roleArn: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val vpcSubnets: Output<List<String>>? = null) : ConvertibleToJava<GameServerGroupArgs>

Provides an GameLift Game Server Group resource.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.gamelift.GameServerGroup;
import com.pulumi.aws.gamelift.GameServerGroupArgs;
import com.pulumi.aws.gamelift.inputs.GameServerGroupInstanceDefinitionArgs;
import com.pulumi.aws.gamelift.inputs.GameServerGroupLaunchTemplateArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new GameServerGroup("example", GameServerGroupArgs.builder()
.gameServerGroupName("example")
.instanceDefinitions(
GameServerGroupInstanceDefinitionArgs.builder()
.instanceType("c5.large")
.build(),
GameServerGroupInstanceDefinitionArgs.builder()
.instanceType("c5a.large")
.build())
.launchTemplate(GameServerGroupLaunchTemplateArgs.builder()
.id(aws_launch_template.example().id())
.build())
.maxSize(1)
.minSize(1)
.roleArn(aws_iam_role.example().arn())
.build(), CustomResourceOptions.builder()
.dependsOn(aws_iam_role_policy_attachment.example())
.build());
}
}

Example IAM Role for GameLift Game Server Group

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.iam.RolePolicyAttachment;
import com.pulumi.aws.iam.RolePolicyAttachmentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var current = AwsFunctions.getPartition();
final var assumeRole = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.effect("Allow")
.principals(GetPolicyDocumentStatementPrincipalArgs.builder()
.type("Service")
.identifiers(
"autoscaling.amazonaws.com",
"gamelift.amazonaws.com")
.build())
.actions("sts:AssumeRole")
.build())
.build());
var exampleRole = new Role("exampleRole", RoleArgs.builder()
.assumeRolePolicy(assumeRole.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
.build());
var exampleRolePolicyAttachment = new RolePolicyAttachment("exampleRolePolicyAttachment", RolePolicyAttachmentArgs.builder()
.policyArn(String.format("arn:%s:iam::aws:policy/GameLiftGameServerGroupPolicy", current.applyValue(getPartitionResult -> getPartitionResult.partition())))
.role(exampleRole.name())
.build());
}
}

Import

GameLift Game Server Group can be imported using the name, e.g.

$ pulumi import aws:gamelift/gameServerGroup:GameServerGroup example example

Constructors

Link copied to clipboard
constructor(autoScalingPolicy: Output<GameServerGroupAutoScalingPolicyArgs>? = null, balancingStrategy: Output<String>? = null, gameServerGroupName: Output<String>? = null, gameServerProtectionPolicy: Output<String>? = null, instanceDefinitions: Output<List<GameServerGroupInstanceDefinitionArgs>>? = null, launchTemplate: Output<GameServerGroupLaunchTemplateArgs>? = null, maxSize: Output<Int>? = null, minSize: Output<Int>? = null, roleArn: Output<String>? = null, tags: Output<Map<String, String>>? = null, vpcSubnets: Output<List<String>>? = null)

Properties

Link copied to clipboard
Link copied to clipboard
val balancingStrategy: Output<String>? = null

Indicates how GameLift FleetIQ balances the use of Spot Instances and On-Demand Instances. Valid values: SPOT_ONLY, SPOT_PREFERRED, ON_DEMAND_ONLY. Defaults to SPOT_PREFERRED.

Link copied to clipboard
val gameServerGroupName: Output<String>? = null

Name of the game server group. This value is used to generate unique ARN identifiers for the EC2 Auto Scaling group and the GameLift FleetIQ game server group.

Link copied to clipboard
val gameServerProtectionPolicy: Output<String>? = null

Indicates whether instances in the game server group are protected from early termination. Unprotected instances that have active game servers running might be terminated during a scale-down event, causing players to be dropped from the game. Protected instances cannot be terminated while there are active game servers running except in the event of a forced game server group deletion. Valid values: NO_PROTECTION, FULL_PROTECTION. Defaults to NO_PROTECTION.

Link copied to clipboard
Link copied to clipboard
val maxSize: Output<Int>? = null

The maximum number of instances allowed in the EC2 Auto Scaling group. During automatic scaling events, GameLift FleetIQ and EC2 do not scale up the group above this maximum.

Link copied to clipboard
val minSize: Output<Int>? = null

The minimum number of instances allowed in the EC2 Auto Scaling group. During automatic scaling events, GameLift FleetIQ and EC2 do not scale down the group below this minimum.

Link copied to clipboard
val roleArn: Output<String>? = null

ARN for an IAM role that allows Amazon GameLift to access your EC2 Auto Scaling groups.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Key-value map of resource tags

Link copied to clipboard
val vpcSubnets: Output<List<String>>? = null

A list of VPC subnets to use with instances in the game server group. By default, all GameLift FleetIQ-supported Availability Zones are used.

Functions

Link copied to clipboard
open override fun toJava(): GameServerGroupArgs