Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.aws.ec2.kotlin.SpotInstanceRequestArgs.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.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.ec2.kotlin
import com.pulumi.aws.ec2.SpotInstanceRequestArgs.builder
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestCapacityReservationSpecificationArgs
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestCapacityReservationSpecificationArgsBuilder
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestCpuOptionsArgs
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestCpuOptionsArgsBuilder
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestCreditSpecificationArgs
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestCreditSpecificationArgsBuilder
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestEbsBlockDeviceArgs
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestEbsBlockDeviceArgsBuilder
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestEnclaveOptionsArgs
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestEnclaveOptionsArgsBuilder
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestEphemeralBlockDeviceArgs
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestEphemeralBlockDeviceArgsBuilder
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestLaunchTemplateArgs
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestLaunchTemplateArgsBuilder
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestMaintenanceOptionsArgs
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestMaintenanceOptionsArgsBuilder
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestMetadataOptionsArgs
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestMetadataOptionsArgsBuilder
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestNetworkInterfaceArgs
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestNetworkInterfaceArgsBuilder
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestPrivateDnsNameOptionsArgs
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestPrivateDnsNameOptionsArgsBuilder
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestRootBlockDeviceArgs
import com.pulumi.aws.ec2.kotlin.inputs.SpotInstanceRequestRootBlockDeviceArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* Provides an EC2 Spot Instance Request resource. This allows instances to be
* requested on the spot market.
* By default this provider creates Spot Instance Requests with a `persistent` type,
* which means that for the duration of their lifetime, AWS will launch an
* instance with the configured details if and when the spot market will accept
* the requested price.
* On destruction, this provider will make an attempt to terminate the associated Spot
* Instance if there is one present.
* Spot Instances requests with a `one-time` type will close the spot request
* when the instance is terminated either by the request being below the current spot
* price availability or by a user.
* > **NOTE:** Because their behavior depends on the live status of the spot
* market, Spot Instance Requests have a unique lifecycle that makes them behave
* differently than other resources. Most importantly: there is __no
* guarantee__ that a Spot Instance exists to fulfill the request at any given
* point in time. See the [AWS Spot Instance
* documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html)
* for more information.
* > **NOTE [AWS strongly discourages](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-best-practices.html#which-spot-request-method-to-use) the use of the legacy APIs called by this resource.
* We recommend using the EC2 Instance resource with `instance_market_options` instead.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* // Request a spot instance at $0.03
* const cheapWorker = new aws.ec2.SpotInstanceRequest("cheap_worker", {
* ami: "ami-1234",
* spotPrice: "0.03",
* instanceType: "c4.xlarge",
* tags: {
* Name: "CheapWorker",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* # Request a spot instance at $0.03
* cheap_worker = aws.ec2.SpotInstanceRequest("cheap_worker",
* ami="ami-1234",
* spot_price="0.03",
* instance_type="c4.xlarge",
* tags={
* "Name": "CheapWorker",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* // Request a spot instance at $0.03
* var cheapWorker = new Aws.Ec2.SpotInstanceRequest("cheap_worker", new()
* {
* Ami = "ami-1234",
* SpotPrice = "0.03",
* InstanceType = "c4.xlarge",
* Tags =
* {
* { "Name", "CheapWorker" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* // Request a spot instance at $0.03
* _, err := ec2.NewSpotInstanceRequest(ctx, "cheap_worker", &ec2.SpotInstanceRequestArgs{
* Ami: pulumi.String("ami-1234"),
* SpotPrice: pulumi.String("0.03"),
* InstanceType: pulumi.String("c4.xlarge"),
* Tags: pulumi.StringMap{
* "Name": pulumi.String("CheapWorker"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.ec2.SpotInstanceRequest;
* import com.pulumi.aws.ec2.SpotInstanceRequestArgs;
* 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) {
* // Request a spot instance at $0.03
* var cheapWorker = new SpotInstanceRequest("cheapWorker", SpotInstanceRequestArgs.builder()
* .ami("ami-1234")
* .spotPrice("0.03")
* .instanceType("c4.xlarge")
* .tags(Map.of("Name", "CheapWorker"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* # Request a spot instance at $0.03
* cheapWorker:
* type: aws:ec2:SpotInstanceRequest
* name: cheap_worker
* properties:
* ami: ami-1234
* spotPrice: '0.03'
* instanceType: c4.xlarge
* tags:
* Name: CheapWorker
* ```
*
* @property ami AMI to use for the instance. Required unless `launch_template` is specified and the Launch Template specifes an AMI. If an AMI is specified in the Launch Template, setting `ami` will override the AMI specified in the Launch Template.
* @property associatePublicIpAddress Whether to associate a public IP address with an instance in a VPC.
* @property availabilityZone AZ to start the instance in.
* @property blockDurationMinutes The required duration for the Spot instances, in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).
* The duration period starts as soon as your Spot instance receives its instance ID. At the end of the duration period, Amazon EC2 marks the Spot instance for termination and provides a Spot instance termination notice, which gives the instance a two-minute warning before it terminates.
* Note that you can't specify an Availability Zone group or a launch group if you specify a duration.
* @property capacityReservationSpecification Describes an instance's Capacity Reservation targeting option. See Capacity Reservation Specification below for more details.
* > **NOTE:** Changing `cpu_core_count` and/or `cpu_threads_per_core` will cause the resource to be destroyed and re-created.
* @property cpuCoreCount Sets the number of CPU cores for an instance. This option is only supported on creation of instance type that support CPU Options [CPU Cores and Threads Per CPU Core Per Instance Type](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html#cpu-options-supported-instances-values) - specifying this option for unsupported instance types will return an error from the EC2 API.
* @property cpuOptions The CPU options for the instance. See CPU Options below for more details.
* @property cpuThreadsPerCore If set to 1, hyperthreading is disabled on the launched instance. Defaults to 2 if not set. See [Optimizing CPU Options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) for more information.
* @property creditSpecification Configuration block for customizing the credit specification of the instance. See Credit Specification below for more details. This provider will only perform drift detection of its value when present in a configuration. Removing this configuration on existing instances will only stop managing it. It will not change the configuration back to the default for the instance type.
* @property disableApiStop If true, enables [EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection).
* @property disableApiTermination If true, enables [EC2 Instance Termination Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingDisableAPITermination).
* @property ebsBlockDevices One or more configuration blocks with additional EBS block devices to attach to the instance. Block device configurations only apply on resource creation. See Block Devices below for details on attributes and drift detection. When accessing this as an attribute reference, it is a set of objects.
* @property ebsOptimized If true, the launched EC2 instance will be EBS-optimized. Note that if this is not set on an instance type that is optimized by default then this will show as disabled but if the instance type is optimized by default then there is no need to set this and there is no effect to disabling it. See the [EBS Optimized section](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) of the AWS User Guide for more information.
* @property enclaveOptions Enable Nitro Enclaves on launched instances. See Enclave Options below for more details.
* @property ephemeralBlockDevices One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a set of objects.
* @property getPasswordData If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `password_data` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information.
* @property hibernation If true, the launched EC2 instance will support hibernation.
* @property hostId ID of a dedicated host that the instance will be assigned to. Use when an instance is to be launched on a specific dedicated host.
* @property hostResourceGroupArn ARN of the host resource group in which to launch the instances. If you specify an ARN, omit the `tenancy` parameter or set it to `host`.
* @property iamInstanceProfile IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile. Ensure your credentials have the correct permission to assign the instance profile according to the [EC2 documentation](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html#roles-usingrole-ec2instance-permissions), notably `iam:PassRole`.
* @property instanceInitiatedShutdownBehavior Shutdown behavior for the instance. Amazon defaults this to `stop` for EBS-backed instances and `terminate` for instance-store instances. Cannot be set on instance-store instances. See [Shutdown Behavior](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingInstanceInitiatedShutdownBehavior) for more information.
* @property instanceInterruptionBehavior Indicates Spot instance behavior when it is interrupted. Valid values are `terminate`, `stop`, or `hibernate`. Default value is `terminate`.
* @property instanceType Instance type to use for the instance. Required unless `launch_template` is specified and the Launch Template specifies an instance type. If an instance type is specified in the Launch Template, setting `instance_type` will override the instance type specified in the Launch Template. Updates to this field will trigger a stop/start of the EC2 instance.
* @property ipv6AddressCount Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet.
* @property ipv6Addresses Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface
* @property keyName Key name of the Key Pair to use for the instance; which can be managed using the `aws.ec2.KeyPair` resource.
* @property launchGroup A launch group is a group of spot instances that launch together and terminate together.
* If left empty instances are launched and terminated individually.
* @property launchTemplate Specifies a Launch Template to configure the instance. Parameters configured on this resource will override the corresponding parameters in the Launch Template. See Launch Template Specification below for more details.
* @property maintenanceOptions Maintenance and recovery options for the instance. See Maintenance Options below for more details.
* @property metadataOptions Customize the metadata options of the instance. See Metadata Options below for more details.
* @property monitoring If true, the launched EC2 instance will have detailed monitoring enabled. (Available since v0.6.0)
* @property networkInterfaces Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details.
* @property placementGroup Placement Group to start the instance in.
* @property placementPartitionNumber Number of the partition the instance is in. Valid only if the `aws.ec2.PlacementGroup` resource's `strategy` argument is set to `"partition"`.
* @property privateDnsNameOptions Options for the instance hostname. The default values are inherited from the subnet. See Private DNS Name Options below for more details.
* @property privateIp Private IP address to associate with the instance in a VPC.
* @property rootBlockDevice Configuration block to customize details about the root block device of the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a list containing one object.
* @property secondaryPrivateIps List of secondary private IPv4 addresses to assign to the instance's primary network interface (eth0) in a VPC. Can only be assigned to the primary network interface (eth0) attached at instance creation, not a pre-existing network interface i.e., referenced in a `network_interface` block. Refer to the [Elastic network interfaces documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) to see the maximum number of private IP addresses allowed per instance type.
* @property securityGroups List of security group names to associate with.
* > **NOTE:** If you are creating Instances in a VPC, use `vpc_security_group_ids` instead.
* @property sourceDestCheck Controls if traffic is routed to the instance when the destination address does not match the instance. Used for NAT or VPNs. Defaults true.
* @property spotPrice The maximum price to request on the spot market.
* @property spotType If set to `one-time`, after
* the instance is terminated, the spot request will be closed.
* @property subnetId VPC Subnet ID to launch in.
* @property tags Map of tags to assign to the resource. Note that these tags apply to the instance and not block storage devices. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
* @property tenancy Tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of `dedicated` runs on single-tenant hardware. The `host` tenancy is not supported for the import-instance command. Valid values are `default`, `dedicated`, and `host`.
* @property userData User data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `user_data_base64` instead. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `user_data_replace_on_change` is set then updates to this field will trigger a destroy and recreate of the EC2 instance.
* @property userDataBase64 Can be used instead of `user_data` to pass base64-encoded binary data directly. Use this instead of `user_data` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `user_data_replace_on_change` is set then updates to this field will trigger a destroy and recreate of the EC2 instance.
* @property userDataReplaceOnChange When used in combination with `user_data` or `user_data_base64` will trigger a destroy and recreate of the EC2 instance when set to `true`. Defaults to `false` if not set.
* @property validFrom The start date and time of the request, in UTC [RFC3339](https://tools.ietf.org/html/rfc3339#section-5.8) format(for example, YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request immediately.
* @property validUntil The end date and time of the request, in UTC [RFC3339](https://tools.ietf.org/html/rfc3339#section-5.8) format(for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new Spot instance requests are placed or enabled to fulfill the request. The default end date is 7 days from the current date.
* @property volumeTags Map of tags to assign, at instance-creation time, to root and EBS volumes.
* > **NOTE:** Do not use `volume_tags` if you plan to manage block device tags outside the `aws.ec2.Instance` configuration, such as using `tags` in an `aws.ebs.Volume` resource attached via `aws.ec2.VolumeAttachment`. Doing so will result in resource cycling and inconsistent behavior.
* @property vpcSecurityGroupIds List of security group IDs to associate with.
* @property waitForFulfillment If set, this provider will
* wait for the Spot Request to be fulfilled, and will throw an error if the
* timeout of 10m is reached.
*/
public data class SpotInstanceRequestArgs(
public val ami: Output? = null,
public val associatePublicIpAddress: Output? = null,
public val availabilityZone: Output? = null,
public val blockDurationMinutes: Output? = null,
public val capacityReservationSpecification: Output? = null,
@Deprecated(
message = """
use 'cpu_options' argument instead
""",
)
public val cpuCoreCount: Output? = null,
public val cpuOptions: Output? = null,
@Deprecated(
message = """
use 'cpu_options' argument instead
""",
)
public val cpuThreadsPerCore: Output? = null,
public val creditSpecification: Output? = null,
public val disableApiStop: Output? = null,
public val disableApiTermination: Output? = null,
public val ebsBlockDevices: Output>? = null,
public val ebsOptimized: Output? = null,
public val enclaveOptions: Output? = null,
public val ephemeralBlockDevices: Output>? =
null,
public val getPasswordData: Output? = null,
public val hibernation: Output? = null,
public val hostId: Output? = null,
public val hostResourceGroupArn: Output? = null,
public val iamInstanceProfile: Output? = null,
public val instanceInitiatedShutdownBehavior: Output? = null,
public val instanceInterruptionBehavior: Output? = null,
public val instanceType: Output? = null,
public val ipv6AddressCount: Output? = null,
public val ipv6Addresses: Output>? = null,
public val keyName: Output? = null,
public val launchGroup: Output? = null,
public val launchTemplate: Output? = null,
public val maintenanceOptions: Output? = null,
public val metadataOptions: Output? = null,
public val monitoring: Output? = null,
public val networkInterfaces: Output>? = null,
public val placementGroup: Output? = null,
public val placementPartitionNumber: Output? = null,
public val privateDnsNameOptions: Output? = null,
public val privateIp: Output? = null,
public val rootBlockDevice: Output? = null,
public val secondaryPrivateIps: Output>? = null,
public val securityGroups: Output>? = null,
public val sourceDestCheck: Output? = null,
public val spotPrice: Output? = null,
public val spotType: Output? = null,
public val subnetId: Output? = null,
public val tags: Output>? = null,
public val tenancy: Output? = null,
public val userData: Output? = null,
public val userDataBase64: Output? = null,
public val userDataReplaceOnChange: Output? = null,
public val validFrom: Output? = null,
public val validUntil: Output? = null,
public val volumeTags: Output>? = null,
public val vpcSecurityGroupIds: Output>? = null,
public val waitForFulfillment: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.aws.ec2.SpotInstanceRequestArgs =
com.pulumi.aws.ec2.SpotInstanceRequestArgs.builder()
.ami(ami?.applyValue({ args0 -> args0 }))
.associatePublicIpAddress(associatePublicIpAddress?.applyValue({ args0 -> args0 }))
.availabilityZone(availabilityZone?.applyValue({ args0 -> args0 }))
.blockDurationMinutes(blockDurationMinutes?.applyValue({ args0 -> args0 }))
.capacityReservationSpecification(
capacityReservationSpecification?.applyValue({ args0 ->
args0.let({ args0 -> args0.toJava() })
}),
)
.cpuCoreCount(cpuCoreCount?.applyValue({ args0 -> args0 }))
.cpuOptions(cpuOptions?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.cpuThreadsPerCore(cpuThreadsPerCore?.applyValue({ args0 -> args0 }))
.creditSpecification(
creditSpecification?.applyValue({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}),
)
.disableApiStop(disableApiStop?.applyValue({ args0 -> args0 }))
.disableApiTermination(disableApiTermination?.applyValue({ args0 -> args0 }))
.ebsBlockDevices(
ebsBlockDevices?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.ebsOptimized(ebsOptimized?.applyValue({ args0 -> args0 }))
.enclaveOptions(enclaveOptions?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.ephemeralBlockDevices(
ephemeralBlockDevices?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> args0.toJava() })
})
}),
)
.getPasswordData(getPasswordData?.applyValue({ args0 -> args0 }))
.hibernation(hibernation?.applyValue({ args0 -> args0 }))
.hostId(hostId?.applyValue({ args0 -> args0 }))
.hostResourceGroupArn(hostResourceGroupArn?.applyValue({ args0 -> args0 }))
.iamInstanceProfile(iamInstanceProfile?.applyValue({ args0 -> args0 }))
.instanceInitiatedShutdownBehavior(
instanceInitiatedShutdownBehavior?.applyValue({ args0 ->
args0
}),
)
.instanceInterruptionBehavior(instanceInterruptionBehavior?.applyValue({ args0 -> args0 }))
.instanceType(instanceType?.applyValue({ args0 -> args0 }))
.ipv6AddressCount(ipv6AddressCount?.applyValue({ args0 -> args0 }))
.ipv6Addresses(ipv6Addresses?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.keyName(keyName?.applyValue({ args0 -> args0 }))
.launchGroup(launchGroup?.applyValue({ args0 -> args0 }))
.launchTemplate(launchTemplate?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.maintenanceOptions(
maintenanceOptions?.applyValue({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}),
)
.metadataOptions(metadataOptions?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.monitoring(monitoring?.applyValue({ args0 -> args0 }))
.networkInterfaces(
networkInterfaces?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.placementGroup(placementGroup?.applyValue({ args0 -> args0 }))
.placementPartitionNumber(placementPartitionNumber?.applyValue({ args0 -> args0 }))
.privateDnsNameOptions(
privateDnsNameOptions?.applyValue({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}),
)
.privateIp(privateIp?.applyValue({ args0 -> args0 }))
.rootBlockDevice(rootBlockDevice?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.secondaryPrivateIps(secondaryPrivateIps?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.securityGroups(securityGroups?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.sourceDestCheck(sourceDestCheck?.applyValue({ args0 -> args0 }))
.spotPrice(spotPrice?.applyValue({ args0 -> args0 }))
.spotType(spotType?.applyValue({ args0 -> args0 }))
.subnetId(subnetId?.applyValue({ args0 -> args0 }))
.tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
.tenancy(tenancy?.applyValue({ args0 -> args0 }))
.userData(userData?.applyValue({ args0 -> args0 }))
.userDataBase64(userDataBase64?.applyValue({ args0 -> args0 }))
.userDataReplaceOnChange(userDataReplaceOnChange?.applyValue({ args0 -> args0 }))
.validFrom(validFrom?.applyValue({ args0 -> args0 }))
.validUntil(validUntil?.applyValue({ args0 -> args0 }))
.volumeTags(
volumeTags?.applyValue({ args0 ->
args0.map({ args0 ->
args0.key.to(args0.value)
}).toMap()
}),
)
.vpcSecurityGroupIds(vpcSecurityGroupIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.waitForFulfillment(waitForFulfillment?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [SpotInstanceRequestArgs].
*/
@PulumiTagMarker
public class SpotInstanceRequestArgsBuilder internal constructor() {
private var ami: Output? = null
private var associatePublicIpAddress: Output? = null
private var availabilityZone: Output? = null
private var blockDurationMinutes: Output? = null
private var capacityReservationSpecification:
Output? = null
private var cpuCoreCount: Output? = null
private var cpuOptions: Output? = null
private var cpuThreadsPerCore: Output? = null
private var creditSpecification: Output? = null
private var disableApiStop: Output? = null
private var disableApiTermination: Output? = null
private var ebsBlockDevices: Output>? = null
private var ebsOptimized: Output? = null
private var enclaveOptions: Output? = null
private var ephemeralBlockDevices: Output>? =
null
private var getPasswordData: Output? = null
private var hibernation: Output? = null
private var hostId: Output? = null
private var hostResourceGroupArn: Output? = null
private var iamInstanceProfile: Output? = null
private var instanceInitiatedShutdownBehavior: Output? = null
private var instanceInterruptionBehavior: Output? = null
private var instanceType: Output? = null
private var ipv6AddressCount: Output? = null
private var ipv6Addresses: Output>? = null
private var keyName: Output? = null
private var launchGroup: Output? = null
private var launchTemplate: Output? = null
private var maintenanceOptions: Output? = null
private var metadataOptions: Output? = null
private var monitoring: Output? = null
private var networkInterfaces: Output>? = null
private var placementGroup: Output? = null
private var placementPartitionNumber: Output? = null
private var privateDnsNameOptions: Output? = null
private var privateIp: Output? = null
private var rootBlockDevice: Output? = null
private var secondaryPrivateIps: Output>? = null
private var securityGroups: Output>? = null
private var sourceDestCheck: Output? = null
private var spotPrice: Output? = null
private var spotType: Output? = null
private var subnetId: Output? = null
private var tags: Output>? = null
private var tenancy: Output? = null
private var userData: Output? = null
private var userDataBase64: Output? = null
private var userDataReplaceOnChange: Output? = null
private var validFrom: Output? = null
private var validUntil: Output? = null
private var volumeTags: Output>? = null
private var vpcSecurityGroupIds: Output>? = null
private var waitForFulfillment: Output? = null
/**
* @param value AMI to use for the instance. Required unless `launch_template` is specified and the Launch Template specifes an AMI. If an AMI is specified in the Launch Template, setting `ami` will override the AMI specified in the Launch Template.
*/
@JvmName("vpufjcerjkvyefkt")
public suspend fun ami(`value`: Output) {
this.ami = value
}
/**
* @param value Whether to associate a public IP address with an instance in a VPC.
*/
@JvmName("ridwfmvyllahmmfh")
public suspend fun associatePublicIpAddress(`value`: Output) {
this.associatePublicIpAddress = value
}
/**
* @param value AZ to start the instance in.
*/
@JvmName("ipbpbnfaohotvlna")
public suspend fun availabilityZone(`value`: Output) {
this.availabilityZone = value
}
/**
* @param value The required duration for the Spot instances, in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).
* The duration period starts as soon as your Spot instance receives its instance ID. At the end of the duration period, Amazon EC2 marks the Spot instance for termination and provides a Spot instance termination notice, which gives the instance a two-minute warning before it terminates.
* Note that you can't specify an Availability Zone group or a launch group if you specify a duration.
*/
@JvmName("srgcjyacrgvghdne")
public suspend fun blockDurationMinutes(`value`: Output) {
this.blockDurationMinutes = value
}
/**
* @param value Describes an instance's Capacity Reservation targeting option. See Capacity Reservation Specification below for more details.
* > **NOTE:** Changing `cpu_core_count` and/or `cpu_threads_per_core` will cause the resource to be destroyed and re-created.
*/
@JvmName("stikoxovuxehhxwd")
public suspend fun capacityReservationSpecification(`value`: Output) {
this.capacityReservationSpecification = value
}
/**
* @param value Sets the number of CPU cores for an instance. This option is only supported on creation of instance type that support CPU Options [CPU Cores and Threads Per CPU Core Per Instance Type](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html#cpu-options-supported-instances-values) - specifying this option for unsupported instance types will return an error from the EC2 API.
*/
@Deprecated(
message = """
use 'cpu_options' argument instead
""",
)
@JvmName("guclqrblsklcowqo")
public suspend fun cpuCoreCount(`value`: Output) {
this.cpuCoreCount = value
}
/**
* @param value The CPU options for the instance. See CPU Options below for more details.
*/
@JvmName("lwrqwkyjlwwfivyc")
public suspend fun cpuOptions(`value`: Output) {
this.cpuOptions = value
}
/**
* @param value If set to 1, hyperthreading is disabled on the launched instance. Defaults to 2 if not set. See [Optimizing CPU Options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) for more information.
*/
@Deprecated(
message = """
use 'cpu_options' argument instead
""",
)
@JvmName("xagyruljnowgswtq")
public suspend fun cpuThreadsPerCore(`value`: Output) {
this.cpuThreadsPerCore = value
}
/**
* @param value Configuration block for customizing the credit specification of the instance. See Credit Specification below for more details. This provider will only perform drift detection of its value when present in a configuration. Removing this configuration on existing instances will only stop managing it. It will not change the configuration back to the default for the instance type.
*/
@JvmName("ccdevlbpislupayo")
public suspend fun creditSpecification(`value`: Output) {
this.creditSpecification = value
}
/**
* @param value If true, enables [EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection).
*/
@JvmName("dxilydgbsrshtxhm")
public suspend fun disableApiStop(`value`: Output) {
this.disableApiStop = value
}
/**
* @param value If true, enables [EC2 Instance Termination Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingDisableAPITermination).
*/
@JvmName("rplvtbhwcpwgrans")
public suspend fun disableApiTermination(`value`: Output) {
this.disableApiTermination = value
}
/**
* @param value One or more configuration blocks with additional EBS block devices to attach to the instance. Block device configurations only apply on resource creation. See Block Devices below for details on attributes and drift detection. When accessing this as an attribute reference, it is a set of objects.
*/
@JvmName("eprghbaooxbwliaf")
public suspend fun ebsBlockDevices(`value`: Output>) {
this.ebsBlockDevices = value
}
@JvmName("xhjbvgonqwmpmypq")
public suspend fun ebsBlockDevices(vararg values: Output) {
this.ebsBlockDevices = Output.all(values.asList())
}
/**
* @param values One or more configuration blocks with additional EBS block devices to attach to the instance. Block device configurations only apply on resource creation. See Block Devices below for details on attributes and drift detection. When accessing this as an attribute reference, it is a set of objects.
*/
@JvmName("gtbdpotottcgkjvd")
public suspend fun ebsBlockDevices(values: List>) {
this.ebsBlockDevices = Output.all(values)
}
/**
* @param value If true, the launched EC2 instance will be EBS-optimized. Note that if this is not set on an instance type that is optimized by default then this will show as disabled but if the instance type is optimized by default then there is no need to set this and there is no effect to disabling it. See the [EBS Optimized section](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) of the AWS User Guide for more information.
*/
@JvmName("hwtbtyrisxhxgykp")
public suspend fun ebsOptimized(`value`: Output) {
this.ebsOptimized = value
}
/**
* @param value Enable Nitro Enclaves on launched instances. See Enclave Options below for more details.
*/
@JvmName("yfyhlyqbbkatldwb")
public suspend fun enclaveOptions(`value`: Output) {
this.enclaveOptions = value
}
/**
* @param value One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a set of objects.
*/
@JvmName("mmcoektjxpgsifcv")
public suspend fun ephemeralBlockDevices(`value`: Output>) {
this.ephemeralBlockDevices = value
}
@JvmName("ywcvonsufctjwmyt")
public suspend fun ephemeralBlockDevices(vararg values: Output) {
this.ephemeralBlockDevices = Output.all(values.asList())
}
/**
* @param values One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a set of objects.
*/
@JvmName("nbsxnfwessahwaeb")
public suspend fun ephemeralBlockDevices(values: List>) {
this.ephemeralBlockDevices = Output.all(values)
}
/**
* @param value If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `password_data` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information.
*/
@JvmName("fvdlubybwucwwgii")
public suspend fun getPasswordData(`value`: Output) {
this.getPasswordData = value
}
/**
* @param value If true, the launched EC2 instance will support hibernation.
*/
@JvmName("ietunjcewvwpdidi")
public suspend fun hibernation(`value`: Output) {
this.hibernation = value
}
/**
* @param value ID of a dedicated host that the instance will be assigned to. Use when an instance is to be launched on a specific dedicated host.
*/
@JvmName("qvhkpwnyvbckgckv")
public suspend fun hostId(`value`: Output) {
this.hostId = value
}
/**
* @param value ARN of the host resource group in which to launch the instances. If you specify an ARN, omit the `tenancy` parameter or set it to `host`.
*/
@JvmName("cacxoyneovxacrmf")
public suspend fun hostResourceGroupArn(`value`: Output) {
this.hostResourceGroupArn = value
}
/**
* @param value IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile. Ensure your credentials have the correct permission to assign the instance profile according to the [EC2 documentation](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html#roles-usingrole-ec2instance-permissions), notably `iam:PassRole`.
*/
@JvmName("eukjlhdevgdfktgx")
public suspend fun iamInstanceProfile(`value`: Output) {
this.iamInstanceProfile = value
}
/**
* @param value Shutdown behavior for the instance. Amazon defaults this to `stop` for EBS-backed instances and `terminate` for instance-store instances. Cannot be set on instance-store instances. See [Shutdown Behavior](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingInstanceInitiatedShutdownBehavior) for more information.
*/
@JvmName("virlvbltdejkytio")
public suspend fun instanceInitiatedShutdownBehavior(`value`: Output) {
this.instanceInitiatedShutdownBehavior = value
}
/**
* @param value Indicates Spot instance behavior when it is interrupted. Valid values are `terminate`, `stop`, or `hibernate`. Default value is `terminate`.
*/
@JvmName("vcpnvsjhhnofjnhk")
public suspend fun instanceInterruptionBehavior(`value`: Output) {
this.instanceInterruptionBehavior = value
}
/**
* @param value Instance type to use for the instance. Required unless `launch_template` is specified and the Launch Template specifies an instance type. If an instance type is specified in the Launch Template, setting `instance_type` will override the instance type specified in the Launch Template. Updates to this field will trigger a stop/start of the EC2 instance.
*/
@JvmName("ktlplwuqoiefymbl")
public suspend fun instanceType(`value`: Output) {
this.instanceType = value
}
/**
* @param value Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet.
*/
@JvmName("lqqlslkqvxifhggh")
public suspend fun ipv6AddressCount(`value`: Output) {
this.ipv6AddressCount = value
}
/**
* @param value Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface
*/
@JvmName("rwecvbymtlaxmgcw")
public suspend fun ipv6Addresses(`value`: Output>) {
this.ipv6Addresses = value
}
@JvmName("gsrcgnnmtsqdefyk")
public suspend fun ipv6Addresses(vararg values: Output) {
this.ipv6Addresses = Output.all(values.asList())
}
/**
* @param values Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface
*/
@JvmName("vkxhebocqunxgxaw")
public suspend fun ipv6Addresses(values: List>) {
this.ipv6Addresses = Output.all(values)
}
/**
* @param value Key name of the Key Pair to use for the instance; which can be managed using the `aws.ec2.KeyPair` resource.
*/
@JvmName("fwhxfujamdccrwid")
public suspend fun keyName(`value`: Output) {
this.keyName = value
}
/**
* @param value A launch group is a group of spot instances that launch together and terminate together.
* If left empty instances are launched and terminated individually.
*/
@JvmName("ukgocrampvlanwoh")
public suspend fun launchGroup(`value`: Output) {
this.launchGroup = value
}
/**
* @param value Specifies a Launch Template to configure the instance. Parameters configured on this resource will override the corresponding parameters in the Launch Template. See Launch Template Specification below for more details.
*/
@JvmName("inbrghmkmamlqdwh")
public suspend fun launchTemplate(`value`: Output) {
this.launchTemplate = value
}
/**
* @param value Maintenance and recovery options for the instance. See Maintenance Options below for more details.
*/
@JvmName("gbfhgcivkfasopyv")
public suspend fun maintenanceOptions(`value`: Output) {
this.maintenanceOptions = value
}
/**
* @param value Customize the metadata options of the instance. See Metadata Options below for more details.
*/
@JvmName("ebrdqqnpbcbnatnf")
public suspend fun metadataOptions(`value`: Output) {
this.metadataOptions = value
}
/**
* @param value If true, the launched EC2 instance will have detailed monitoring enabled. (Available since v0.6.0)
*/
@JvmName("lqtbynqjvuadthbv")
public suspend fun monitoring(`value`: Output) {
this.monitoring = value
}
/**
* @param value Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details.
*/
@JvmName("nuttnpfpavehjhru")
public suspend fun networkInterfaces(`value`: Output>) {
this.networkInterfaces = value
}
@JvmName("ewtwluywojtwelju")
public suspend fun networkInterfaces(vararg values: Output) {
this.networkInterfaces = Output.all(values.asList())
}
/**
* @param values Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details.
*/
@JvmName("xymjlvpjungajxej")
public suspend fun networkInterfaces(values: List>) {
this.networkInterfaces = Output.all(values)
}
/**
* @param value Placement Group to start the instance in.
*/
@JvmName("vbrtvwmjwvphmgmb")
public suspend fun placementGroup(`value`: Output) {
this.placementGroup = value
}
/**
* @param value Number of the partition the instance is in. Valid only if the `aws.ec2.PlacementGroup` resource's `strategy` argument is set to `"partition"`.
*/
@JvmName("vemvkytylbgayjov")
public suspend fun placementPartitionNumber(`value`: Output) {
this.placementPartitionNumber = value
}
/**
* @param value Options for the instance hostname. The default values are inherited from the subnet. See Private DNS Name Options below for more details.
*/
@JvmName("hsjtvbxmikoaodph")
public suspend fun privateDnsNameOptions(`value`: Output) {
this.privateDnsNameOptions = value
}
/**
* @param value Private IP address to associate with the instance in a VPC.
*/
@JvmName("dxusdssygwcstaev")
public suspend fun privateIp(`value`: Output) {
this.privateIp = value
}
/**
* @param value Configuration block to customize details about the root block device of the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a list containing one object.
*/
@JvmName("amqdfsquxldrcpps")
public suspend fun rootBlockDevice(`value`: Output) {
this.rootBlockDevice = value
}
/**
* @param value List of secondary private IPv4 addresses to assign to the instance's primary network interface (eth0) in a VPC. Can only be assigned to the primary network interface (eth0) attached at instance creation, not a pre-existing network interface i.e., referenced in a `network_interface` block. Refer to the [Elastic network interfaces documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) to see the maximum number of private IP addresses allowed per instance type.
*/
@JvmName("dgkyowajjbytbuba")
public suspend fun secondaryPrivateIps(`value`: Output>) {
this.secondaryPrivateIps = value
}
@JvmName("vxrpvwejyueoqfoq")
public suspend fun secondaryPrivateIps(vararg values: Output) {
this.secondaryPrivateIps = Output.all(values.asList())
}
/**
* @param values List of secondary private IPv4 addresses to assign to the instance's primary network interface (eth0) in a VPC. Can only be assigned to the primary network interface (eth0) attached at instance creation, not a pre-existing network interface i.e., referenced in a `network_interface` block. Refer to the [Elastic network interfaces documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) to see the maximum number of private IP addresses allowed per instance type.
*/
@JvmName("gtwjrvykxxtrcgwf")
public suspend fun secondaryPrivateIps(values: List>) {
this.secondaryPrivateIps = Output.all(values)
}
/**
* @param value List of security group names to associate with.
* > **NOTE:** If you are creating Instances in a VPC, use `vpc_security_group_ids` instead.
*/
@JvmName("vydscmqvbyhqbfph")
public suspend fun securityGroups(`value`: Output>) {
this.securityGroups = value
}
@JvmName("cloxxljkfcrbwdct")
public suspend fun securityGroups(vararg values: Output) {
this.securityGroups = Output.all(values.asList())
}
/**
* @param values List of security group names to associate with.
* > **NOTE:** If you are creating Instances in a VPC, use `vpc_security_group_ids` instead.
*/
@JvmName("sbxumkfhisdfmrxb")
public suspend fun securityGroups(values: List>) {
this.securityGroups = Output.all(values)
}
/**
* @param value Controls if traffic is routed to the instance when the destination address does not match the instance. Used for NAT or VPNs. Defaults true.
*/
@JvmName("jncnmqbcvqesondk")
public suspend fun sourceDestCheck(`value`: Output) {
this.sourceDestCheck = value
}
/**
* @param value The maximum price to request on the spot market.
*/
@JvmName("pejcayrxijhcvmhg")
public suspend fun spotPrice(`value`: Output) {
this.spotPrice = value
}
/**
* @param value If set to `one-time`, after
* the instance is terminated, the spot request will be closed.
*/
@JvmName("mhnnsmnebhjqmmni")
public suspend fun spotType(`value`: Output) {
this.spotType = value
}
/**
* @param value VPC Subnet ID to launch in.
*/
@JvmName("qbgnphyyvovqgjkb")
public suspend fun subnetId(`value`: Output) {
this.subnetId = value
}
/**
* @param value Map of tags to assign to the resource. Note that these tags apply to the instance and not block storage devices. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
@JvmName("xflgdjvneuulypnh")
public suspend fun tags(`value`: Output>) {
this.tags = value
}
/**
* @param value Tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of `dedicated` runs on single-tenant hardware. The `host` tenancy is not supported for the import-instance command. Valid values are `default`, `dedicated`, and `host`.
*/
@JvmName("ykqthobnnbhflets")
public suspend fun tenancy(`value`: Output) {
this.tenancy = value
}
/**
* @param value User data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `user_data_base64` instead. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `user_data_replace_on_change` is set then updates to this field will trigger a destroy and recreate of the EC2 instance.
*/
@JvmName("digmoomwhluysjhl")
public suspend fun userData(`value`: Output) {
this.userData = value
}
/**
* @param value Can be used instead of `user_data` to pass base64-encoded binary data directly. Use this instead of `user_data` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `user_data_replace_on_change` is set then updates to this field will trigger a destroy and recreate of the EC2 instance.
*/
@JvmName("nqjfyvcuegxpibds")
public suspend fun userDataBase64(`value`: Output) {
this.userDataBase64 = value
}
/**
* @param value When used in combination with `user_data` or `user_data_base64` will trigger a destroy and recreate of the EC2 instance when set to `true`. Defaults to `false` if not set.
*/
@JvmName("xfxrpqhmvmwulgcw")
public suspend fun userDataReplaceOnChange(`value`: Output) {
this.userDataReplaceOnChange = value
}
/**
* @param value The start date and time of the request, in UTC [RFC3339](https://tools.ietf.org/html/rfc3339#section-5.8) format(for example, YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request immediately.
*/
@JvmName("yotcjbunhgfwwawt")
public suspend fun validFrom(`value`: Output) {
this.validFrom = value
}
/**
* @param value The end date and time of the request, in UTC [RFC3339](https://tools.ietf.org/html/rfc3339#section-5.8) format(for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new Spot instance requests are placed or enabled to fulfill the request. The default end date is 7 days from the current date.
*/
@JvmName("vwxtclbxvhyplxsy")
public suspend fun validUntil(`value`: Output) {
this.validUntil = value
}
/**
* @param value Map of tags to assign, at instance-creation time, to root and EBS volumes.
* > **NOTE:** Do not use `volume_tags` if you plan to manage block device tags outside the `aws.ec2.Instance` configuration, such as using `tags` in an `aws.ebs.Volume` resource attached via `aws.ec2.VolumeAttachment`. Doing so will result in resource cycling and inconsistent behavior.
*/
@JvmName("bbvwnrqmhwhtqujj")
public suspend fun volumeTags(`value`: Output>) {
this.volumeTags = value
}
/**
* @param value List of security group IDs to associate with.
*/
@JvmName("ykdvfaborhsbebwu")
public suspend fun vpcSecurityGroupIds(`value`: Output>) {
this.vpcSecurityGroupIds = value
}
@JvmName("vcbitxruxrqpftsm")
public suspend fun vpcSecurityGroupIds(vararg values: Output) {
this.vpcSecurityGroupIds = Output.all(values.asList())
}
/**
* @param values List of security group IDs to associate with.
*/
@JvmName("cnmeqfotodstirhe")
public suspend fun vpcSecurityGroupIds(values: List>) {
this.vpcSecurityGroupIds = Output.all(values)
}
/**
* @param value If set, this provider will
* wait for the Spot Request to be fulfilled, and will throw an error if the
* timeout of 10m is reached.
*/
@JvmName("ucmtawptlxrecanq")
public suspend fun waitForFulfillment(`value`: Output) {
this.waitForFulfillment = value
}
/**
* @param value AMI to use for the instance. Required unless `launch_template` is specified and the Launch Template specifes an AMI. If an AMI is specified in the Launch Template, setting `ami` will override the AMI specified in the Launch Template.
*/
@JvmName("mxmsjgwqcpuwinnr")
public suspend fun ami(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.ami = mapped
}
/**
* @param value Whether to associate a public IP address with an instance in a VPC.
*/
@JvmName("smfeyqlriccbbwuj")
public suspend fun associatePublicIpAddress(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.associatePublicIpAddress = mapped
}
/**
* @param value AZ to start the instance in.
*/
@JvmName("nputtyvwdkxmuypw")
public suspend fun availabilityZone(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.availabilityZone = mapped
}
/**
* @param value The required duration for the Spot instances, in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360).
* The duration period starts as soon as your Spot instance receives its instance ID. At the end of the duration period, Amazon EC2 marks the Spot instance for termination and provides a Spot instance termination notice, which gives the instance a two-minute warning before it terminates.
* Note that you can't specify an Availability Zone group or a launch group if you specify a duration.
*/
@JvmName("qckdkcvlxkigxjya")
public suspend fun blockDurationMinutes(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.blockDurationMinutes = mapped
}
/**
* @param value Describes an instance's Capacity Reservation targeting option. See Capacity Reservation Specification below for more details.
* > **NOTE:** Changing `cpu_core_count` and/or `cpu_threads_per_core` will cause the resource to be destroyed and re-created.
*/
@JvmName("vkcfhdsuloyqlcns")
public suspend fun capacityReservationSpecification(`value`: SpotInstanceRequestCapacityReservationSpecificationArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.capacityReservationSpecification = mapped
}
/**
* @param argument Describes an instance's Capacity Reservation targeting option. See Capacity Reservation Specification below for more details.
* > **NOTE:** Changing `cpu_core_count` and/or `cpu_threads_per_core` will cause the resource to be destroyed and re-created.
*/
@JvmName("tqneytbnrmnclmmf")
public suspend fun capacityReservationSpecification(argument: suspend SpotInstanceRequestCapacityReservationSpecificationArgsBuilder.() -> Unit) {
val toBeMapped = SpotInstanceRequestCapacityReservationSpecificationArgsBuilder().applySuspend {
argument()
}.build()
val mapped = of(toBeMapped)
this.capacityReservationSpecification = mapped
}
/**
* @param value Sets the number of CPU cores for an instance. This option is only supported on creation of instance type that support CPU Options [CPU Cores and Threads Per CPU Core Per Instance Type](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html#cpu-options-supported-instances-values) - specifying this option for unsupported instance types will return an error from the EC2 API.
*/
@Deprecated(
message = """
use 'cpu_options' argument instead
""",
)
@JvmName("ugmuiltfpfickmps")
public suspend fun cpuCoreCount(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.cpuCoreCount = mapped
}
/**
* @param value The CPU options for the instance. See CPU Options below for more details.
*/
@JvmName("spnstiumnthqnipo")
public suspend fun cpuOptions(`value`: SpotInstanceRequestCpuOptionsArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.cpuOptions = mapped
}
/**
* @param argument The CPU options for the instance. See CPU Options below for more details.
*/
@JvmName("navdjgyuvpguhbsg")
public suspend fun cpuOptions(argument: suspend SpotInstanceRequestCpuOptionsArgsBuilder.() -> Unit) {
val toBeMapped = SpotInstanceRequestCpuOptionsArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.cpuOptions = mapped
}
/**
* @param value If set to 1, hyperthreading is disabled on the launched instance. Defaults to 2 if not set. See [Optimizing CPU Options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) for more information.
*/
@Deprecated(
message = """
use 'cpu_options' argument instead
""",
)
@JvmName("tqbindnbemshxgye")
public suspend fun cpuThreadsPerCore(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.cpuThreadsPerCore = mapped
}
/**
* @param value Configuration block for customizing the credit specification of the instance. See Credit Specification below for more details. This provider will only perform drift detection of its value when present in a configuration. Removing this configuration on existing instances will only stop managing it. It will not change the configuration back to the default for the instance type.
*/
@JvmName("orutrtequahnorog")
public suspend fun creditSpecification(`value`: SpotInstanceRequestCreditSpecificationArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.creditSpecification = mapped
}
/**
* @param argument Configuration block for customizing the credit specification of the instance. See Credit Specification below for more details. This provider will only perform drift detection of its value when present in a configuration. Removing this configuration on existing instances will only stop managing it. It will not change the configuration back to the default for the instance type.
*/
@JvmName("ttuqnmjspeokeuis")
public suspend fun creditSpecification(argument: suspend SpotInstanceRequestCreditSpecificationArgsBuilder.() -> Unit) {
val toBeMapped = SpotInstanceRequestCreditSpecificationArgsBuilder().applySuspend {
argument()
}.build()
val mapped = of(toBeMapped)
this.creditSpecification = mapped
}
/**
* @param value If true, enables [EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection).
*/
@JvmName("saqbruldmkyueinm")
public suspend fun disableApiStop(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.disableApiStop = mapped
}
/**
* @param value If true, enables [EC2 Instance Termination Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingDisableAPITermination).
*/
@JvmName("cbiuogysyoxmwfdf")
public suspend fun disableApiTermination(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.disableApiTermination = mapped
}
/**
* @param value One or more configuration blocks with additional EBS block devices to attach to the instance. Block device configurations only apply on resource creation. See Block Devices below for details on attributes and drift detection. When accessing this as an attribute reference, it is a set of objects.
*/
@JvmName("xdfptgradjnjuqpw")
public suspend fun ebsBlockDevices(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.ebsBlockDevices = mapped
}
/**
* @param argument One or more configuration blocks with additional EBS block devices to attach to the instance. Block device configurations only apply on resource creation. See Block Devices below for details on attributes and drift detection. When accessing this as an attribute reference, it is a set of objects.
*/
@JvmName("dwlbtnirnbtlkkge")
public suspend fun ebsBlockDevices(argument: List Unit>) {
val toBeMapped = argument.toList().map {
SpotInstanceRequestEbsBlockDeviceArgsBuilder().applySuspend { it() }.build()
}
val mapped = of(toBeMapped)
this.ebsBlockDevices = mapped
}
/**
* @param argument One or more configuration blocks with additional EBS block devices to attach to the instance. Block device configurations only apply on resource creation. See Block Devices below for details on attributes and drift detection. When accessing this as an attribute reference, it is a set of objects.
*/
@JvmName("dndurjqdmosicujb")
public suspend fun ebsBlockDevices(vararg argument: suspend SpotInstanceRequestEbsBlockDeviceArgsBuilder.() -> Unit) {
val toBeMapped = argument.toList().map {
SpotInstanceRequestEbsBlockDeviceArgsBuilder().applySuspend { it() }.build()
}
val mapped = of(toBeMapped)
this.ebsBlockDevices = mapped
}
/**
* @param argument One or more configuration blocks with additional EBS block devices to attach to the instance. Block device configurations only apply on resource creation. See Block Devices below for details on attributes and drift detection. When accessing this as an attribute reference, it is a set of objects.
*/
@JvmName("hgdivdosjnrdaxgc")
public suspend fun ebsBlockDevices(argument: suspend SpotInstanceRequestEbsBlockDeviceArgsBuilder.() -> Unit) {
val toBeMapped = listOf(
SpotInstanceRequestEbsBlockDeviceArgsBuilder().applySuspend {
argument()
}.build(),
)
val mapped = of(toBeMapped)
this.ebsBlockDevices = mapped
}
/**
* @param values One or more configuration blocks with additional EBS block devices to attach to the instance. Block device configurations only apply on resource creation. See Block Devices below for details on attributes and drift detection. When accessing this as an attribute reference, it is a set of objects.
*/
@JvmName("qnhdmhjnhdeorwab")
public suspend fun ebsBlockDevices(vararg values: SpotInstanceRequestEbsBlockDeviceArgs) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.ebsBlockDevices = mapped
}
/**
* @param value If true, the launched EC2 instance will be EBS-optimized. Note that if this is not set on an instance type that is optimized by default then this will show as disabled but if the instance type is optimized by default then there is no need to set this and there is no effect to disabling it. See the [EBS Optimized section](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) of the AWS User Guide for more information.
*/
@JvmName("vlcvgbdjuveamdad")
public suspend fun ebsOptimized(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.ebsOptimized = mapped
}
/**
* @param value Enable Nitro Enclaves on launched instances. See Enclave Options below for more details.
*/
@JvmName("fhykkupcelmabyft")
public suspend fun enclaveOptions(`value`: SpotInstanceRequestEnclaveOptionsArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.enclaveOptions = mapped
}
/**
* @param argument Enable Nitro Enclaves on launched instances. See Enclave Options below for more details.
*/
@JvmName("lawlnhxfyjxfkuhk")
public suspend fun enclaveOptions(argument: suspend SpotInstanceRequestEnclaveOptionsArgsBuilder.() -> Unit) {
val toBeMapped = SpotInstanceRequestEnclaveOptionsArgsBuilder().applySuspend {
argument()
}.build()
val mapped = of(toBeMapped)
this.enclaveOptions = mapped
}
/**
* @param value One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a set of objects.
*/
@JvmName("fxyjvtgwctsgumvc")
public suspend fun ephemeralBlockDevices(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.ephemeralBlockDevices = mapped
}
/**
* @param argument One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a set of objects.
*/
@JvmName("fiuxjsutgjunngvv")
public suspend fun ephemeralBlockDevices(argument: List Unit>) {
val toBeMapped = argument.toList().map {
SpotInstanceRequestEphemeralBlockDeviceArgsBuilder().applySuspend { it() }.build()
}
val mapped = of(toBeMapped)
this.ephemeralBlockDevices = mapped
}
/**
* @param argument One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a set of objects.
*/
@JvmName("kxskvworhvpwalyi")
public suspend fun ephemeralBlockDevices(vararg argument: suspend SpotInstanceRequestEphemeralBlockDeviceArgsBuilder.() -> Unit) {
val toBeMapped = argument.toList().map {
SpotInstanceRequestEphemeralBlockDeviceArgsBuilder().applySuspend { it() }.build()
}
val mapped = of(toBeMapped)
this.ephemeralBlockDevices = mapped
}
/**
* @param argument One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a set of objects.
*/
@JvmName("poxfidqvqhtegtes")
public suspend fun ephemeralBlockDevices(argument: suspend SpotInstanceRequestEphemeralBlockDeviceArgsBuilder.() -> Unit) {
val toBeMapped = listOf(
SpotInstanceRequestEphemeralBlockDeviceArgsBuilder().applySuspend {
argument()
}.build(),
)
val mapped = of(toBeMapped)
this.ephemeralBlockDevices = mapped
}
/**
* @param values One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a set of objects.
*/
@JvmName("yogdtmgabrctiivl")
public suspend fun ephemeralBlockDevices(vararg values: SpotInstanceRequestEphemeralBlockDeviceArgs) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.ephemeralBlockDevices = mapped
}
/**
* @param value If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `password_data` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information.
*/
@JvmName("vyyqyqwsobbvttdd")
public suspend fun getPasswordData(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.getPasswordData = mapped
}
/**
* @param value If true, the launched EC2 instance will support hibernation.
*/
@JvmName("wvbbjgaovwohqreo")
public suspend fun hibernation(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.hibernation = mapped
}
/**
* @param value ID of a dedicated host that the instance will be assigned to. Use when an instance is to be launched on a specific dedicated host.
*/
@JvmName("twrtmvutqfyminto")
public suspend fun hostId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.hostId = mapped
}
/**
* @param value ARN of the host resource group in which to launch the instances. If you specify an ARN, omit the `tenancy` parameter or set it to `host`.
*/
@JvmName("rddgdakpywiqgkhq")
public suspend fun hostResourceGroupArn(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.hostResourceGroupArn = mapped
}
/**
* @param value IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile. Ensure your credentials have the correct permission to assign the instance profile according to the [EC2 documentation](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html#roles-usingrole-ec2instance-permissions), notably `iam:PassRole`.
*/
@JvmName("iflfmxrdtyjndsnn")
public suspend fun iamInstanceProfile(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.iamInstanceProfile = mapped
}
/**
* @param value Shutdown behavior for the instance. Amazon defaults this to `stop` for EBS-backed instances and `terminate` for instance-store instances. Cannot be set on instance-store instances. See [Shutdown Behavior](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingInstanceInitiatedShutdownBehavior) for more information.
*/
@JvmName("cgjkvithdbdfgxtn")
public suspend fun instanceInitiatedShutdownBehavior(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.instanceInitiatedShutdownBehavior = mapped
}
/**
* @param value Indicates Spot instance behavior when it is interrupted. Valid values are `terminate`, `stop`, or `hibernate`. Default value is `terminate`.
*/
@JvmName("dlbofnhovlpqenry")
public suspend fun instanceInterruptionBehavior(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.instanceInterruptionBehavior = mapped
}
/**
* @param value Instance type to use for the instance. Required unless `launch_template` is specified and the Launch Template specifies an instance type. If an instance type is specified in the Launch Template, setting `instance_type` will override the instance type specified in the Launch Template. Updates to this field will trigger a stop/start of the EC2 instance.
*/
@JvmName("xrmoiwxuoeeaxoae")
public suspend fun instanceType(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.instanceType = mapped
}
/**
* @param value Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet.
*/
@JvmName("gjtkdafrglhtuldu")
public suspend fun ipv6AddressCount(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.ipv6AddressCount = mapped
}
/**
* @param value Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface
*/
@JvmName("npomlwmrwdsfjnsy")
public suspend fun ipv6Addresses(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.ipv6Addresses = mapped
}
/**
* @param values Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface
*/
@JvmName("bvupllfyofplvxyx")
public suspend fun ipv6Addresses(vararg values: String) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.ipv6Addresses = mapped
}
/**
* @param value Key name of the Key Pair to use for the instance; which can be managed using the `aws.ec2.KeyPair` resource.
*/
@JvmName("umyojkfrpsaqgweu")
public suspend fun keyName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.keyName = mapped
}
/**
* @param value A launch group is a group of spot instances that launch together and terminate together.
* If left empty instances are launched and terminated individually.
*/
@JvmName("fliutrhxgiqmltga")
public suspend fun launchGroup(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.launchGroup = mapped
}
/**
* @param value Specifies a Launch Template to configure the instance. Parameters configured on this resource will override the corresponding parameters in the Launch Template. See Launch Template Specification below for more details.
*/
@JvmName("ehrgcrbbooblflwj")
public suspend fun launchTemplate(`value`: SpotInstanceRequestLaunchTemplateArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.launchTemplate = mapped
}
/**
* @param argument Specifies a Launch Template to configure the instance. Parameters configured on this resource will override the corresponding parameters in the Launch Template. See Launch Template Specification below for more details.
*/
@JvmName("yuubbtvmkwqvmwjc")
public suspend fun launchTemplate(argument: suspend SpotInstanceRequestLaunchTemplateArgsBuilder.() -> Unit) {
val toBeMapped = SpotInstanceRequestLaunchTemplateArgsBuilder().applySuspend {
argument()
}.build()
val mapped = of(toBeMapped)
this.launchTemplate = mapped
}
/**
* @param value Maintenance and recovery options for the instance. See Maintenance Options below for more details.
*/
@JvmName("tmfhbgnplihbtixf")
public suspend fun maintenanceOptions(`value`: SpotInstanceRequestMaintenanceOptionsArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.maintenanceOptions = mapped
}
/**
* @param argument Maintenance and recovery options for the instance. See Maintenance Options below for more details.
*/
@JvmName("hxfbxbytxklnyuqb")
public suspend fun maintenanceOptions(argument: suspend SpotInstanceRequestMaintenanceOptionsArgsBuilder.() -> Unit) {
val toBeMapped = SpotInstanceRequestMaintenanceOptionsArgsBuilder().applySuspend {
argument()
}.build()
val mapped = of(toBeMapped)
this.maintenanceOptions = mapped
}
/**
* @param value Customize the metadata options of the instance. See Metadata Options below for more details.
*/
@JvmName("obedmckwhyhntsdt")
public suspend fun metadataOptions(`value`: SpotInstanceRequestMetadataOptionsArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.metadataOptions = mapped
}
/**
* @param argument Customize the metadata options of the instance. See Metadata Options below for more details.
*/
@JvmName("nremwcfryfigrvec")
public suspend fun metadataOptions(argument: suspend SpotInstanceRequestMetadataOptionsArgsBuilder.() -> Unit) {
val toBeMapped = SpotInstanceRequestMetadataOptionsArgsBuilder().applySuspend {
argument()
}.build()
val mapped = of(toBeMapped)
this.metadataOptions = mapped
}
/**
* @param value If true, the launched EC2 instance will have detailed monitoring enabled. (Available since v0.6.0)
*/
@JvmName("gxudtgxxxqhajwrc")
public suspend fun monitoring(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.monitoring = mapped
}
/**
* @param value Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details.
*/
@JvmName("aeahsgkdksqtviyg")
public suspend fun networkInterfaces(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.networkInterfaces = mapped
}
/**
* @param argument Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details.
*/
@JvmName("gmawqwekxtxvihbc")
public suspend fun networkInterfaces(argument: List Unit>) {
val toBeMapped = argument.toList().map {
SpotInstanceRequestNetworkInterfaceArgsBuilder().applySuspend { it() }.build()
}
val mapped = of(toBeMapped)
this.networkInterfaces = mapped
}
/**
* @param argument Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details.
*/
@JvmName("yvmukbothxmshbtq")
public suspend fun networkInterfaces(vararg argument: suspend SpotInstanceRequestNetworkInterfaceArgsBuilder.() -> Unit) {
val toBeMapped = argument.toList().map {
SpotInstanceRequestNetworkInterfaceArgsBuilder().applySuspend { it() }.build()
}
val mapped = of(toBeMapped)
this.networkInterfaces = mapped
}
/**
* @param argument Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details.
*/
@JvmName("rvgsxohrbkpwmfjp")
public suspend fun networkInterfaces(argument: suspend SpotInstanceRequestNetworkInterfaceArgsBuilder.() -> Unit) {
val toBeMapped = listOf(
SpotInstanceRequestNetworkInterfaceArgsBuilder().applySuspend {
argument()
}.build(),
)
val mapped = of(toBeMapped)
this.networkInterfaces = mapped
}
/**
* @param values Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details.
*/
@JvmName("hbyyxoeitsleyjsu")
public suspend fun networkInterfaces(vararg values: SpotInstanceRequestNetworkInterfaceArgs) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.networkInterfaces = mapped
}
/**
* @param value Placement Group to start the instance in.
*/
@JvmName("orvvldooyyibifrc")
public suspend fun placementGroup(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.placementGroup = mapped
}
/**
* @param value Number of the partition the instance is in. Valid only if the `aws.ec2.PlacementGroup` resource's `strategy` argument is set to `"partition"`.
*/
@JvmName("beeqpckwprdqsipx")
public suspend fun placementPartitionNumber(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.placementPartitionNumber = mapped
}
/**
* @param value Options for the instance hostname. The default values are inherited from the subnet. See Private DNS Name Options below for more details.
*/
@JvmName("dcfpmlslrnivowdb")
public suspend fun privateDnsNameOptions(`value`: SpotInstanceRequestPrivateDnsNameOptionsArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.privateDnsNameOptions = mapped
}
/**
* @param argument Options for the instance hostname. The default values are inherited from the subnet. See Private DNS Name Options below for more details.
*/
@JvmName("droxnhdmpygbwseh")
public suspend fun privateDnsNameOptions(argument: suspend SpotInstanceRequestPrivateDnsNameOptionsArgsBuilder.() -> Unit) {
val toBeMapped = SpotInstanceRequestPrivateDnsNameOptionsArgsBuilder().applySuspend {
argument()
}.build()
val mapped = of(toBeMapped)
this.privateDnsNameOptions = mapped
}
/**
* @param value Private IP address to associate with the instance in a VPC.
*/
@JvmName("xwfosmmokbbpcich")
public suspend fun privateIp(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.privateIp = mapped
}
/**
* @param value Configuration block to customize details about the root block device of the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a list containing one object.
*/
@JvmName("lkhriisujgrxgewn")
public suspend fun rootBlockDevice(`value`: SpotInstanceRequestRootBlockDeviceArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.rootBlockDevice = mapped
}
/**
* @param argument Configuration block to customize details about the root block device of the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a list containing one object.
*/
@JvmName("astaijihmvbuseeu")
public suspend fun rootBlockDevice(argument: suspend SpotInstanceRequestRootBlockDeviceArgsBuilder.() -> Unit) {
val toBeMapped = SpotInstanceRequestRootBlockDeviceArgsBuilder().applySuspend {
argument()
}.build()
val mapped = of(toBeMapped)
this.rootBlockDevice = mapped
}
/**
* @param value List of secondary private IPv4 addresses to assign to the instance's primary network interface (eth0) in a VPC. Can only be assigned to the primary network interface (eth0) attached at instance creation, not a pre-existing network interface i.e., referenced in a `network_interface` block. Refer to the [Elastic network interfaces documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) to see the maximum number of private IP addresses allowed per instance type.
*/
@JvmName("bqvwsepxkvaulyrb")
public suspend fun secondaryPrivateIps(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.secondaryPrivateIps = mapped
}
/**
* @param values List of secondary private IPv4 addresses to assign to the instance's primary network interface (eth0) in a VPC. Can only be assigned to the primary network interface (eth0) attached at instance creation, not a pre-existing network interface i.e., referenced in a `network_interface` block. Refer to the [Elastic network interfaces documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) to see the maximum number of private IP addresses allowed per instance type.
*/
@JvmName("hdmlglspqmsdqbvs")
public suspend fun secondaryPrivateIps(vararg values: String) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.secondaryPrivateIps = mapped
}
/**
* @param value List of security group names to associate with.
* > **NOTE:** If you are creating Instances in a VPC, use `vpc_security_group_ids` instead.
*/
@JvmName("oovlklpixhsklamv")
public suspend fun securityGroups(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.securityGroups = mapped
}
/**
* @param values List of security group names to associate with.
* > **NOTE:** If you are creating Instances in a VPC, use `vpc_security_group_ids` instead.
*/
@JvmName("pxbidnwrjlnfbmmp")
public suspend fun securityGroups(vararg values: String) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.securityGroups = mapped
}
/**
* @param value Controls if traffic is routed to the instance when the destination address does not match the instance. Used for NAT or VPNs. Defaults true.
*/
@JvmName("naxpudcqgcjjfidf")
public suspend fun sourceDestCheck(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.sourceDestCheck = mapped
}
/**
* @param value The maximum price to request on the spot market.
*/
@JvmName("cltyhjdmnxktnbwe")
public suspend fun spotPrice(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.spotPrice = mapped
}
/**
* @param value If set to `one-time`, after
* the instance is terminated, the spot request will be closed.
*/
@JvmName("engtvwjtuhimbpor")
public suspend fun spotType(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.spotType = mapped
}
/**
* @param value VPC Subnet ID to launch in.
*/
@JvmName("xptuyinwiojtwqnq")
public suspend fun subnetId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.subnetId = mapped
}
/**
* @param value Map of tags to assign to the resource. Note that these tags apply to the instance and not block storage devices. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
@JvmName("qlayjdxictmcjaad")
public suspend fun tags(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.tags = mapped
}
/**
* @param values Map of tags to assign to the resource. Note that these tags apply to the instance and not block storage devices. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
@JvmName("ftlcljcjcotthsqd")
public fun tags(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.tags = mapped
}
/**
* @param value Tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of `dedicated` runs on single-tenant hardware. The `host` tenancy is not supported for the import-instance command. Valid values are `default`, `dedicated`, and `host`.
*/
@JvmName("vxremkcmplusbuus")
public suspend fun tenancy(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.tenancy = mapped
}
/**
* @param value User data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `user_data_base64` instead. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `user_data_replace_on_change` is set then updates to this field will trigger a destroy and recreate of the EC2 instance.
*/
@JvmName("nrpoaocebwygajue")
public suspend fun userData(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.userData = mapped
}
/**
* @param value Can be used instead of `user_data` to pass base64-encoded binary data directly. Use this instead of `user_data` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `user_data_replace_on_change` is set then updates to this field will trigger a destroy and recreate of the EC2 instance.
*/
@JvmName("ikrasffsjylpipfs")
public suspend fun userDataBase64(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.userDataBase64 = mapped
}
/**
* @param value When used in combination with `user_data` or `user_data_base64` will trigger a destroy and recreate of the EC2 instance when set to `true`. Defaults to `false` if not set.
*/
@JvmName("mddlydtreebkphsq")
public suspend fun userDataReplaceOnChange(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.userDataReplaceOnChange = mapped
}
/**
* @param value The start date and time of the request, in UTC [RFC3339](https://tools.ietf.org/html/rfc3339#section-5.8) format(for example, YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request immediately.
*/
@JvmName("ibojugbwgrraueec")
public suspend fun validFrom(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.validFrom = mapped
}
/**
* @param value The end date and time of the request, in UTC [RFC3339](https://tools.ietf.org/html/rfc3339#section-5.8) format(for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new Spot instance requests are placed or enabled to fulfill the request. The default end date is 7 days from the current date.
*/
@JvmName("wfqdvvkfantagnxa")
public suspend fun validUntil(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.validUntil = mapped
}
/**
* @param value Map of tags to assign, at instance-creation time, to root and EBS volumes.
* > **NOTE:** Do not use `volume_tags` if you plan to manage block device tags outside the `aws.ec2.Instance` configuration, such as using `tags` in an `aws.ebs.Volume` resource attached via `aws.ec2.VolumeAttachment`. Doing so will result in resource cycling and inconsistent behavior.
*/
@JvmName("rnpyvdjccrscvfnp")
public suspend fun volumeTags(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.volumeTags = mapped
}
/**
* @param values Map of tags to assign, at instance-creation time, to root and EBS volumes.
* > **NOTE:** Do not use `volume_tags` if you plan to manage block device tags outside the `aws.ec2.Instance` configuration, such as using `tags` in an `aws.ebs.Volume` resource attached via `aws.ec2.VolumeAttachment`. Doing so will result in resource cycling and inconsistent behavior.
*/
@JvmName("xxgbpkvgsheoswlf")
public fun volumeTags(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.volumeTags = mapped
}
/**
* @param value List of security group IDs to associate with.
*/
@JvmName("vdunqpwjmvihlyro")
public suspend fun vpcSecurityGroupIds(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.vpcSecurityGroupIds = mapped
}
/**
* @param values List of security group IDs to associate with.
*/
@JvmName("mbqfapivjgjmbxda")
public suspend fun vpcSecurityGroupIds(vararg values: String) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.vpcSecurityGroupIds = mapped
}
/**
* @param value If set, this provider will
* wait for the Spot Request to be fulfilled, and will throw an error if the
* timeout of 10m is reached.
*/
@JvmName("brlertgppiuilqno")
public suspend fun waitForFulfillment(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.waitForFulfillment = mapped
}
internal fun build(): SpotInstanceRequestArgs = SpotInstanceRequestArgs(
ami = ami,
associatePublicIpAddress = associatePublicIpAddress,
availabilityZone = availabilityZone,
blockDurationMinutes = blockDurationMinutes,
capacityReservationSpecification = capacityReservationSpecification,
cpuCoreCount = cpuCoreCount,
cpuOptions = cpuOptions,
cpuThreadsPerCore = cpuThreadsPerCore,
creditSpecification = creditSpecification,
disableApiStop = disableApiStop,
disableApiTermination = disableApiTermination,
ebsBlockDevices = ebsBlockDevices,
ebsOptimized = ebsOptimized,
enclaveOptions = enclaveOptions,
ephemeralBlockDevices = ephemeralBlockDevices,
getPasswordData = getPasswordData,
hibernation = hibernation,
hostId = hostId,
hostResourceGroupArn = hostResourceGroupArn,
iamInstanceProfile = iamInstanceProfile,
instanceInitiatedShutdownBehavior = instanceInitiatedShutdownBehavior,
instanceInterruptionBehavior = instanceInterruptionBehavior,
instanceType = instanceType,
ipv6AddressCount = ipv6AddressCount,
ipv6Addresses = ipv6Addresses,
keyName = keyName,
launchGroup = launchGroup,
launchTemplate = launchTemplate,
maintenanceOptions = maintenanceOptions,
metadataOptions = metadataOptions,
monitoring = monitoring,
networkInterfaces = networkInterfaces,
placementGroup = placementGroup,
placementPartitionNumber = placementPartitionNumber,
privateDnsNameOptions = privateDnsNameOptions,
privateIp = privateIp,
rootBlockDevice = rootBlockDevice,
secondaryPrivateIps = secondaryPrivateIps,
securityGroups = securityGroups,
sourceDestCheck = sourceDestCheck,
spotPrice = spotPrice,
spotType = spotType,
subnetId = subnetId,
tags = tags,
tenancy = tenancy,
userData = userData,
userDataBase64 = userDataBase64,
userDataReplaceOnChange = userDataReplaceOnChange,
validFrom = validFrom,
validUntil = validUntil,
volumeTags = volumeTags,
vpcSecurityGroupIds = vpcSecurityGroupIds,
waitForFulfillment = waitForFulfillment,
)
}