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

com.pulumi.awsnative.ec2.kotlin.Host.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.ec2.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

/**
 * Builder for [Host].
 */
@PulumiTagMarker
public class HostResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: HostArgs = HostArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend HostArgsBuilder.() -> Unit) {
        val builder = HostArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): Host {
        val builtJavaResource = com.pulumi.awsnative.ec2.Host(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Host(builtJavaResource)
    }
}

/**
 * Resource Type definition for AWS::EC2::Host
 */
public class Host internal constructor(
    override val javaResource: com.pulumi.awsnative.ec2.Host,
) : KotlinCustomResource(javaResource, HostMapper) {
    /**
     * The ID of the Outpost hardware asset.
     */
    public val assetId: Output?
        get() = javaResource.assetId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID.
     */
    public val autoPlacement: Output?
        get() = javaResource.autoPlacement().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Availability Zone in which to allocate the Dedicated Host.
     */
    public val availabilityZone: Output
        get() = javaResource.availabilityZone().applyValue({ args0 -> args0 })

    /**
     * ID of the host created.
     */
    public val hostId: Output
        get() = javaResource.hostId().applyValue({ args0 -> args0 })

    /**
     * Automatically allocates a new dedicated host and moves your instances on to it if a degradation is detected on your current host.
     */
    public val hostMaintenance: Output?
        get() = javaResource.hostMaintenance().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default.
     */
    public val hostRecovery: Output?
        get() = javaResource.hostRecovery().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family.
     */
    public val instanceFamily: Output?
        get() = javaResource.instanceFamily().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only.
     */
    public val instanceType: Output?
        get() = javaResource.instanceType().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Amazon Resource Name (ARN) of the Amazon Web Services Outpost on which to allocate the Dedicated Host.
     */
    public val outpostArn: Output?
        get() = javaResource.outpostArn().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

public object HostMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.ec2.Host::class == javaResource::class

    override fun map(javaResource: Resource): Host = Host(
        javaResource as
            com.pulumi.awsnative.ec2.Host,
    )
}

/**
 * @see [Host].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [Host].
 */
public suspend fun host(name: String, block: suspend HostResourceBuilder.() -> Unit): Host {
    val builder = HostResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Host].
 * @param name The _unique_ name of the resulting resource.
 */
public fun host(name: String): Host {
    val builder = HostResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy