GameServerGroup

class GameServerGroup : KotlinCustomResource

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

Properties

Link copied to clipboard
val arn: Output<String>

The ARN of the GameLift Game Server Group.

Link copied to clipboard

The ARN of the created EC2 Auto Scaling group.

Link copied to clipboard

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

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

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
val id: Output<String>
Link copied to clipboard
Link copied to clipboard
val maxSize: Output<Int>

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>

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 pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val roleArn: Output<String>

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>>?

Key-value map of resource tags

Link copied to clipboard
val tagsAll: Output<Map<String, String>>
Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val vpcSubnets: Output<List<String>>?

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