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

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

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

package com.pulumi.awsnative.ec2.kotlin

import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List

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

    public var args: VpcArgs = VpcArgs()

    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 VpcArgsBuilder.() -> Unit) {
        val builder = VpcArgsBuilder()
        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(): Vpc {
        val builtJavaResource = com.pulumi.awsnative.ec2.Vpc(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Vpc(builtJavaResource)
    }
}

/**
 * Specifies a virtual private cloud (VPC).
 *  To add an IPv6 CIDR block to the VPC, see [AWS::EC2::VPCCidrBlock](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpccidrblock.html).
 *  For more information, see [Virtual private clouds (VPC)](https://docs.aws.amazon.com/vpc/latest/userguide/configure-your-vpc.html) in the *Amazon VPC User Guide*.
 */
public class Vpc internal constructor(
    override val javaResource: com.pulumi.awsnative.ec2.Vpc,
) : KotlinCustomResource(javaResource, VpcMapper) {
    /**
     * The IPv4 network range for the VPC, in CIDR notation. For example, ``10.0.0.0/16``. We modify the specified CIDR block to its canonical form; for example, if you specify ``100.68.0.18/18``, we modify it to ``100.68.0.0/18``.
     *  You must specify either``CidrBlock`` or ``Ipv4IpamPoolId``.
     */
    public val cidrBlock: Output?
        get() = javaResource.cidrBlock().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The association IDs of the IPv4 CIDR blocks for the VPC. For example, [ vpc-cidr-assoc-0280ab6b ].
     */
    public val cidrBlockAssociations: Output>
        get() = javaResource.cidrBlockAssociations().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * The ID of the default network ACL for the VPC. For example, acl-814dafe3.
     */
    public val defaultNetworkAcl: Output
        get() = javaResource.defaultNetworkAcl().applyValue({ args0 -> args0 })

    /**
     * The ID of the default security group for the VPC. For example, sg-b178e0d3.
     */
    public val defaultSecurityGroup: Output
        get() = javaResource.defaultSecurityGroup().applyValue({ args0 -> args0 })

    /**
     * Indicates whether the instances launched in the VPC get DNS hostnames. If enabled, instances in the VPC get DNS hostnames; otherwise, they do not. Disabled by default for nondefault VPCs. For more information, see [DNS attributes in your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-support).
     *  You can only enable DNS hostnames if you've enabled DNS support.
     */
    public val enableDnsHostnames: Output?
        get() = javaResource.enableDnsHostnames().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Indicates whether the DNS resolution is supported for the VPC. If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled. Enabled by default. For more information, see [DNS attributes in your VPC](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-support).
     */
    public val enableDnsSupport: Output?
        get() = javaResource.enableDnsSupport().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The allowed tenancy of instances launched into the VPC.
     *   +   ``default``: An instance launched into the VPC runs on shared hardware by default, unless you explicitly specify a different tenancy during instance launch.
     *   +   ``dedicated``: An instance launched into the VPC runs on dedicated hardware by default, unless you explicitly specify a tenancy of ``host`` during instance launch. You cannot specify a tenancy of ``default`` during instance launch.
     *  Updating ``InstanceTenancy`` requires no replacement only if you are updating its value from ``dedicated`` to ``default``. Updating ``InstanceTenancy`` from ``default`` to ``dedicated`` requires replacement.
     */
    public val instanceTenancy: Output?
        get() = javaResource.instanceTenancy().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. For more information, see [What is IPAM?](https://docs.aws.amazon.com//vpc/latest/ipam/what-is-it-ipam.html) in the *Amazon VPC IPAM User Guide*.
     *  You must specify either``CidrBlock`` or ``Ipv4IpamPoolId``.
     */
    public val ipv4IpamPoolId: Output?
        get() = javaResource.ipv4IpamPoolId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see [What is IPAM?](https://docs.aws.amazon.com//vpc/latest/ipam/what-is-it-ipam.html) in the *Amazon VPC IPAM User Guide*.
     */
    public val ipv4NetmaskLength: Output?
        get() = javaResource.ipv4NetmaskLength().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The IPv6 CIDR blocks for the VPC. For example, [ 2001:db8:1234:1a00::/56 ].
     */
    public val ipv6CidrBlocks: Output>
        get() = javaResource.ipv6CidrBlocks().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * The tags for the VPC.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> toKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * The ID of the VPC.
     */
    public val vpcId: Output
        get() = javaResource.vpcId().applyValue({ args0 -> args0 })
}

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy