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

com.pulumi.awsnative.lightsail.kotlin.InstanceArgs.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.11.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.lightsail.kotlin

import com.pulumi.awsnative.kotlin.inputs.TagArgs
import com.pulumi.awsnative.kotlin.inputs.TagArgsBuilder
import com.pulumi.awsnative.lightsail.InstanceArgs.builder
import com.pulumi.awsnative.lightsail.kotlin.inputs.InstanceAddOnArgs
import com.pulumi.awsnative.lightsail.kotlin.inputs.InstanceAddOnArgsBuilder
import com.pulumi.awsnative.lightsail.kotlin.inputs.InstanceHardwareArgs
import com.pulumi.awsnative.lightsail.kotlin.inputs.InstanceHardwareArgsBuilder
import com.pulumi.awsnative.lightsail.kotlin.inputs.InstanceLocationArgs
import com.pulumi.awsnative.lightsail.kotlin.inputs.InstanceLocationArgsBuilder
import com.pulumi.awsnative.lightsail.kotlin.inputs.InstanceNetworkingArgs
import com.pulumi.awsnative.lightsail.kotlin.inputs.InstanceNetworkingArgsBuilder
import com.pulumi.awsnative.lightsail.kotlin.inputs.InstanceStateArgs
import com.pulumi.awsnative.lightsail.kotlin.inputs.InstanceStateArgsBuilder
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Resource Type definition for AWS::Lightsail::Instance
 * @property addOns An array of objects representing the add-ons to enable for the new instance.
 * @property availabilityZone The Availability Zone in which to create your instance. Use the following format: us-east-2a (case sensitive). Be sure to add the include Availability Zones parameter to your request.
 * @property blueprintId The ID for a virtual private server image (e.g., app_wordpress_4_4 or app_lamp_7_0 ). Use the get blueprints operation to return a list of available images (or blueprints ).
 * @property bundleId The bundle of specification information for your virtual private server (or instance ), including the pricing plan (e.g., micro_1_0 ).
 * @property hardware The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM.
 * > The instance restarts when performing an attach disk or detach disk request. This resets the public IP address of your instance if a static IP isn't attached to it.
 * @property instanceName The names to use for your new Lightsail instance.
 * @property keyPairName The name of your key pair.
 * @property location The location for the instance, such as the AWS Region and Availability Zone.
 * > The `Location` property is read-only and should not be specified in a create instance or update instance request.
 * @property networking The public ports and the monthly amount of data transfer allocated for the instance.
 * @property state The status code and the state (for example, `running` ) of the instance.
 * > The `State` property is read-only and should not be specified in a create instance or update instance request.
 * @property tags An array of key-value pairs to apply to this resource.
 * @property userData A launch script you can create that configures a server with additional user data. For example, you might want to run apt-get -y update.
 */
public data class InstanceArgs(
    public val addOns: Output>? = null,
    public val availabilityZone: Output? = null,
    public val blueprintId: Output? = null,
    public val bundleId: Output? = null,
    public val hardware: Output? = null,
    public val instanceName: Output? = null,
    public val keyPairName: Output? = null,
    public val location: Output? = null,
    public val networking: Output? = null,
    public val state: Output? = null,
    public val tags: Output>? = null,
    public val userData: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.lightsail.InstanceArgs =
        com.pulumi.awsnative.lightsail.InstanceArgs.builder()
            .addOns(addOns?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .availabilityZone(availabilityZone?.applyValue({ args0 -> args0 }))
            .blueprintId(blueprintId?.applyValue({ args0 -> args0 }))
            .bundleId(bundleId?.applyValue({ args0 -> args0 }))
            .hardware(hardware?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .instanceName(instanceName?.applyValue({ args0 -> args0 }))
            .keyPairName(keyPairName?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .networking(networking?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .state(state?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .userData(userData?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [InstanceArgs].
 */
@PulumiTagMarker
public class InstanceArgsBuilder internal constructor() {
    private var addOns: Output>? = null

    private var availabilityZone: Output? = null

    private var blueprintId: Output? = null

    private var bundleId: Output? = null

    private var hardware: Output? = null

    private var instanceName: Output? = null

    private var keyPairName: Output? = null

    private var location: Output? = null

    private var networking: Output? = null

    private var state: Output? = null

    private var tags: Output>? = null

    private var userData: Output? = null

    /**
     * @param value An array of objects representing the add-ons to enable for the new instance.
     */
    @JvmName("iseoemvgufuwmsfm")
    public suspend fun addOns(`value`: Output>) {
        this.addOns = value
    }

    @JvmName("vdmncucluatirqid")
    public suspend fun addOns(vararg values: Output) {
        this.addOns = Output.all(values.asList())
    }

    /**
     * @param values An array of objects representing the add-ons to enable for the new instance.
     */
    @JvmName("vmqvkbcidmjenaqw")
    public suspend fun addOns(values: List>) {
        this.addOns = Output.all(values)
    }

    /**
     * @param value The Availability Zone in which to create your instance. Use the following format: us-east-2a (case sensitive). Be sure to add the include Availability Zones parameter to your request.
     */
    @JvmName("nrektytklafoytob")
    public suspend fun availabilityZone(`value`: Output) {
        this.availabilityZone = value
    }

    /**
     * @param value The ID for a virtual private server image (e.g., app_wordpress_4_4 or app_lamp_7_0 ). Use the get blueprints operation to return a list of available images (or blueprints ).
     */
    @JvmName("xymuqvnbcxtdrwci")
    public suspend fun blueprintId(`value`: Output) {
        this.blueprintId = value
    }

    /**
     * @param value The bundle of specification information for your virtual private server (or instance ), including the pricing plan (e.g., micro_1_0 ).
     */
    @JvmName("kgkjbsepqwrordaw")
    public suspend fun bundleId(`value`: Output) {
        this.bundleId = value
    }

    /**
     * @param value The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM.
     * > The instance restarts when performing an attach disk or detach disk request. This resets the public IP address of your instance if a static IP isn't attached to it.
     */
    @JvmName("ivrpbtqrbobpjodx")
    public suspend fun hardware(`value`: Output) {
        this.hardware = value
    }

    /**
     * @param value The names to use for your new Lightsail instance.
     */
    @JvmName("qsruejqqdjojdxvb")
    public suspend fun instanceName(`value`: Output) {
        this.instanceName = value
    }

    /**
     * @param value The name of your key pair.
     */
    @JvmName("dyuwrpjhwedchgkj")
    public suspend fun keyPairName(`value`: Output) {
        this.keyPairName = value
    }

    /**
     * @param value The location for the instance, such as the AWS Region and Availability Zone.
     * > The `Location` property is read-only and should not be specified in a create instance or update instance request.
     */
    @JvmName("geypdywyenqmquvi")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The public ports and the monthly amount of data transfer allocated for the instance.
     */
    @JvmName("gwalfmbsyasaavxl")
    public suspend fun networking(`value`: Output) {
        this.networking = value
    }

    /**
     * @param value The status code and the state (for example, `running` ) of the instance.
     * > The `State` property is read-only and should not be specified in a create instance or update instance request.
     */
    @JvmName("ofedqdsbpebjeknd")
    public suspend fun state(`value`: Output) {
        this.state = value
    }

    /**
     * @param value An array of key-value pairs to apply to this resource.
     */
    @JvmName("fkcfyxurpuxfovqu")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    @JvmName("ubpmvsjwjsvoloap")
    public suspend fun tags(vararg values: Output) {
        this.tags = Output.all(values.asList())
    }

    /**
     * @param values An array of key-value pairs to apply to this resource.
     */
    @JvmName("xjinmsjnygpygqan")
    public suspend fun tags(values: List>) {
        this.tags = Output.all(values)
    }

    /**
     * @param value A launch script you can create that configures a server with additional user data. For example, you might want to run apt-get -y update.
     */
    @JvmName("bblbjottlrqylpra")
    public suspend fun userData(`value`: Output) {
        this.userData = value
    }

    /**
     * @param value An array of objects representing the add-ons to enable for the new instance.
     */
    @JvmName("noqfmsigwysbgavn")
    public suspend fun addOns(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.addOns = mapped
    }

    /**
     * @param argument An array of objects representing the add-ons to enable for the new instance.
     */
    @JvmName("shimmqrqdtubihaq")
    public suspend fun addOns(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            InstanceAddOnArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.addOns = mapped
    }

    /**
     * @param argument An array of objects representing the add-ons to enable for the new instance.
     */
    @JvmName("fbfhianusvgikruk")
    public suspend fun addOns(vararg argument: suspend InstanceAddOnArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            InstanceAddOnArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.addOns = mapped
    }

    /**
     * @param argument An array of objects representing the add-ons to enable for the new instance.
     */
    @JvmName("xohhjxexqhilhqnp")
    public suspend fun addOns(argument: suspend InstanceAddOnArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(InstanceAddOnArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.addOns = mapped
    }

    /**
     * @param values An array of objects representing the add-ons to enable for the new instance.
     */
    @JvmName("rafmvpwtahadwhnb")
    public suspend fun addOns(vararg values: InstanceAddOnArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.addOns = mapped
    }

    /**
     * @param value The Availability Zone in which to create your instance. Use the following format: us-east-2a (case sensitive). Be sure to add the include Availability Zones parameter to your request.
     */
    @JvmName("aamlrkngkpwcdhks")
    public suspend fun availabilityZone(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.availabilityZone = mapped
    }

    /**
     * @param value The ID for a virtual private server image (e.g., app_wordpress_4_4 or app_lamp_7_0 ). Use the get blueprints operation to return a list of available images (or blueprints ).
     */
    @JvmName("ttpxtnatrtqthsnc")
    public suspend fun blueprintId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.blueprintId = mapped
    }

    /**
     * @param value The bundle of specification information for your virtual private server (or instance ), including the pricing plan (e.g., micro_1_0 ).
     */
    @JvmName("gvhpwggxqogtjqwe")
    public suspend fun bundleId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.bundleId = mapped
    }

    /**
     * @param value The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM.
     * > The instance restarts when performing an attach disk or detach disk request. This resets the public IP address of your instance if a static IP isn't attached to it.
     */
    @JvmName("hlxvlaqonmoftqil")
    public suspend fun hardware(`value`: InstanceHardwareArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hardware = mapped
    }

    /**
     * @param argument The hardware properties for the instance, such as the vCPU count, attached disks, and amount of RAM.
     * > The instance restarts when performing an attach disk or detach disk request. This resets the public IP address of your instance if a static IP isn't attached to it.
     */
    @JvmName("pimjfrwnjgbcpymn")
    public suspend fun hardware(argument: suspend InstanceHardwareArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceHardwareArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.hardware = mapped
    }

    /**
     * @param value The names to use for your new Lightsail instance.
     */
    @JvmName("fcuxjreewmsxirpm")
    public suspend fun instanceName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceName = mapped
    }

    /**
     * @param value The name of your key pair.
     */
    @JvmName("ljqpvugdjbaausmf")
    public suspend fun keyPairName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.keyPairName = mapped
    }

    /**
     * @param value The location for the instance, such as the AWS Region and Availability Zone.
     * > The `Location` property is read-only and should not be specified in a create instance or update instance request.
     */
    @JvmName("lxeehepivvyosasg")
    public suspend fun location(`value`: InstanceLocationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param argument The location for the instance, such as the AWS Region and Availability Zone.
     * > The `Location` property is read-only and should not be specified in a create instance or update instance request.
     */
    @JvmName("emmvmobfqenipfdp")
    public suspend fun location(argument: suspend InstanceLocationArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceLocationArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.location = mapped
    }

    /**
     * @param value The public ports and the monthly amount of data transfer allocated for the instance.
     */
    @JvmName("uwxvxdqgrnsimkxp")
    public suspend fun networking(`value`: InstanceNetworkingArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.networking = mapped
    }

    /**
     * @param argument The public ports and the monthly amount of data transfer allocated for the instance.
     */
    @JvmName("uxmtewqycrbshrtg")
    public suspend fun networking(argument: suspend InstanceNetworkingArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceNetworkingArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.networking = mapped
    }

    /**
     * @param value The status code and the state (for example, `running` ) of the instance.
     * > The `State` property is read-only and should not be specified in a create instance or update instance request.
     */
    @JvmName("djgrjvpcsbixbufw")
    public suspend fun state(`value`: InstanceStateArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.state = mapped
    }

    /**
     * @param argument The status code and the state (for example, `running` ) of the instance.
     * > The `State` property is read-only and should not be specified in a create instance or update instance request.
     */
    @JvmName("ivismyixbbyjbjpf")
    public suspend fun state(argument: suspend InstanceStateArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceStateArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.state = mapped
    }

    /**
     * @param value An array of key-value pairs to apply to this resource.
     */
    @JvmName("lfmthmyrewtslmec")
    public suspend fun tags(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param argument An array of key-value pairs to apply to this resource.
     */
    @JvmName("jxxvwtbgnbbgmxsn")
    public suspend fun tags(argument: List Unit>) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument An array of key-value pairs to apply to this resource.
     */
    @JvmName("enqtqqeyffpwvnxg")
    public suspend fun tags(vararg argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { TagArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param argument An array of key-value pairs to apply to this resource.
     */
    @JvmName("urjxqjiqbdktlxoj")
    public suspend fun tags(argument: suspend TagArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TagArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.tags = mapped
    }

    /**
     * @param values An array of key-value pairs to apply to this resource.
     */
    @JvmName("asrgklwhkcvasrpe")
    public suspend fun tags(vararg values: TagArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value A launch script you can create that configures a server with additional user data. For example, you might want to run apt-get -y update.
     */
    @JvmName("ajwnmhosghhcwmax")
    public suspend fun userData(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.userData = mapped
    }

    internal fun build(): InstanceArgs = InstanceArgs(
        addOns = addOns,
        availabilityZone = availabilityZone,
        blueprintId = blueprintId,
        bundleId = bundleId,
        hardware = hardware,
        instanceName = instanceName,
        keyPairName = keyPairName,
        location = location,
        networking = networking,
        state = state,
        tags = tags,
        userData = userData,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy