com.pulumi.awsnative.gamelift.kotlin.GameServerGroup.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.gamelift.kotlin
import com.pulumi.awsnative.gamelift.kotlin.enums.GameServerGroupBalancingStrategy
import com.pulumi.awsnative.gamelift.kotlin.enums.GameServerGroupDeleteOption
import com.pulumi.awsnative.gamelift.kotlin.enums.GameServerGroupGameServerProtectionPolicy
import com.pulumi.awsnative.gamelift.kotlin.outputs.GameServerGroupAutoScalingPolicy
import com.pulumi.awsnative.gamelift.kotlin.outputs.GameServerGroupInstanceDefinition
import com.pulumi.awsnative.gamelift.kotlin.outputs.GameServerGroupLaunchTemplate
import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Double
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.gamelift.kotlin.enums.GameServerGroupBalancingStrategy.Companion.toKotlin as gameServerGroupBalancingStrategyToKotlin
import com.pulumi.awsnative.gamelift.kotlin.enums.GameServerGroupDeleteOption.Companion.toKotlin as gameServerGroupDeleteOptionToKotlin
import com.pulumi.awsnative.gamelift.kotlin.enums.GameServerGroupGameServerProtectionPolicy.Companion.toKotlin as gameServerGroupGameServerProtectionPolicyToKotlin
import com.pulumi.awsnative.gamelift.kotlin.outputs.GameServerGroupAutoScalingPolicy.Companion.toKotlin as gameServerGroupAutoScalingPolicyToKotlin
import com.pulumi.awsnative.gamelift.kotlin.outputs.GameServerGroupInstanceDefinition.Companion.toKotlin as gameServerGroupInstanceDefinitionToKotlin
import com.pulumi.awsnative.gamelift.kotlin.outputs.GameServerGroupLaunchTemplate.Companion.toKotlin as gameServerGroupLaunchTemplateToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* Builder for [GameServerGroup].
*/
@PulumiTagMarker
public class GameServerGroupResourceBuilder internal constructor() {
public var name: String? = null
public var args: GameServerGroupArgs = GameServerGroupArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend GameServerGroupArgsBuilder.() -> Unit) {
val builder = GameServerGroupArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): GameServerGroup {
val builtJavaResource = com.pulumi.awsnative.gamelift.GameServerGroup(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return GameServerGroup(builtJavaResource)
}
}
/**
* The AWS::GameLift::GameServerGroup resource creates an Amazon GameLift (GameLift) GameServerGroup.
*/
public class GameServerGroup internal constructor(
override val javaResource: com.pulumi.awsnative.gamelift.GameServerGroup,
) : KotlinCustomResource(javaResource, GameServerGroupMapper) {
/**
* A generated unique ID for the EC2 Auto Scaling group that is associated with this game server group.
*/
public val autoScalingGroupArn: Output
get() = javaResource.autoScalingGroupArn().applyValue({ args0 -> args0 })
/**
* Configuration settings to define a scaling policy for the Auto Scaling group that is optimized for game hosting. Updating this game server group property will not take effect for the created EC2 Auto Scaling group, please update the EC2 Auto Scaling group directly after creating the resource.
*/
public val autoScalingPolicy: Output?
get() = javaResource.autoScalingPolicy().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> gameServerGroupAutoScalingPolicyToKotlin(args0) })
}).orElse(null)
})
/**
* The fallback balancing method to use for the game server group when Spot Instances in a Region become unavailable or are not viable for game hosting.
*/
public val balancingStrategy: Output?
get() = javaResource.balancingStrategy().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> gameServerGroupBalancingStrategyToKotlin(args0) })
}).orElse(null)
})
/**
* The type of delete to perform.
*/
public val deleteOption: Output?
get() = javaResource.deleteOption().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
gameServerGroupDeleteOptionToKotlin(args0)
})
}).orElse(null)
})
/**
* A generated unique ID for the game server group.
*/
public val gameServerGroupArn: Output
get() = javaResource.gameServerGroupArn().applyValue({ args0 -> args0 })
/**
* An identifier for the new game server group.
*/
public val gameServerGroupName: Output
get() = javaResource.gameServerGroupName().applyValue({ args0 -> args0 })
/**
* A flag that indicates whether instances in the game server group are protected from early termination.
*/
public val gameServerProtectionPolicy: Output?
get() = javaResource.gameServerProtectionPolicy().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
gameServerGroupGameServerProtectionPolicyToKotlin(args0)
})
}).orElse(null)
})
/**
* A set of EC2 instance types to use when creating instances in the group.
*/
public val instanceDefinitions: Output>
get() = javaResource.instanceDefinitions().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> gameServerGroupInstanceDefinitionToKotlin(args0) })
})
})
/**
* The EC2 launch template that contains configuration settings and game server code to be deployed to all instances in the game server group. Updating this game server group property will not take effect for the created EC2 Auto Scaling group, please update the EC2 Auto Scaling group directly after creating the resource.
*/
public val launchTemplate: Output?
get() = javaResource.launchTemplate().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> gameServerGroupLaunchTemplateToKotlin(args0) })
}).orElse(null)
})
/**
* The maximum number of instances allowed in the EC2 Auto Scaling group. Updating this game server group property will not take effect for the created EC2 Auto Scaling group, please update the EC2 Auto Scaling group directly after creating the resource.
*/
public val maxSize: Output?
get() = javaResource.maxSize().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The minimum number of instances allowed in the EC2 Auto Scaling group. Updating this game server group property will not take effect for the created EC2 Auto Scaling group, please update the EC2 Auto Scaling group directly after creating the resource.
*/
public val minSize: Output?
get() = javaResource.minSize().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The Amazon Resource Name (ARN) for an IAM role that allows Amazon GameLift to access your EC2 Auto Scaling groups.
*/
public val roleArn: Output
get() = javaResource.roleArn().applyValue({ args0 -> args0 })
/**
* A list of labels to assign to the new game server group resource. Updating game server group tags with CloudFormation will not take effect. Please update this property using AWS GameLift APIs instead.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
/**
* A list of virtual private cloud (VPC) subnets to use with instances in the game server group. Updating this game server group property will not take effect for the created EC2 Auto Scaling group, please update the EC2 Auto Scaling group directly after creating the resource.
*/
public val vpcSubnets: Output>?
get() = javaResource.vpcSubnets().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0
})
}).orElse(null)
})
}
public object GameServerGroupMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.gamelift.GameServerGroup::class == javaResource::class
override fun map(javaResource: Resource): GameServerGroup = GameServerGroup(
javaResource as
com.pulumi.awsnative.gamelift.GameServerGroup,
)
}
/**
* @see [GameServerGroup].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [GameServerGroup].
*/
public suspend fun gameServerGroup(
name: String,
block: suspend GameServerGroupResourceBuilder.() -> Unit,
): GameServerGroup {
val builder = GameServerGroupResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [GameServerGroup].
* @param name The _unique_ name of the resulting resource.
*/
public fun gameServerGroup(name: String): GameServerGroup {
val builder = GameServerGroupResourceBuilder()
builder.name(name)
return builder.build()
}