All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.awsnative.autoscaling.kotlin.outputs.AutoScalingGroupMixedInstancesPolicy.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 1.24.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.autoscaling.kotlin.outputs

import kotlin.Suppress

/**
 * Use this structure to launch multiple instance types and On-Demand Instances and Spot Instances within a single Auto Scaling group.
 *  A mixed instances policy contains information that Amazon EC2 Auto Scaling can use to launch instances and help optimize your costs. For more information, see [Auto Scaling groups with multiple instance types and purchase options](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-mixed-instances-groups.html) in the *Amazon EC2 Auto Scaling User Guide*.
 *  You can create a mixed instances policy for new and existing Auto Scaling groups. You must use a launch template to configure the policy. You cannot use a launch configuration.
 *  There are key differences between Spot Instances and On-Demand Instances:
 *   +  The price for Spot Instances varies based on demand
 *   +  Amazon EC2 can terminate an individual Spot Instance as the availability of, or price for, Spot Instances changes
 *  When a Spot Instance is terminated, Amazon EC2 Auto Scaling group attempts to launch a replacement instance to maintain the desired capacity for the group.
 *   ``MixedInstancesPolicy`` is a property of the [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) resource.
 * @property instancesDistribution The instances distribution.
 * @property launchTemplate One or more launch templates and the instance types (overrides) that are used to launch EC2 instances to fulfill On-Demand and Spot capacities.
 */
public data class AutoScalingGroupMixedInstancesPolicy(
    public val instancesDistribution: AutoScalingGroupInstancesDistribution? = null,
    public val launchTemplate: AutoScalingGroupLaunchTemplate,
) {
    public companion object {
        public fun toKotlin(javaType: com.pulumi.awsnative.autoscaling.outputs.AutoScalingGroupMixedInstancesPolicy): AutoScalingGroupMixedInstancesPolicy = AutoScalingGroupMixedInstancesPolicy(
            instancesDistribution = javaType.instancesDistribution().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.autoscaling.kotlin.outputs.AutoScalingGroupInstancesDistribution.Companion.toKotlin(args0)
                })
            }).orElse(null),
            launchTemplate = javaType.launchTemplate().let({ args0 ->
                com.pulumi.awsnative.autoscaling.kotlin.outputs.AutoScalingGroupLaunchTemplate.Companion.toKotlin(args0)
            }),
        )
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy