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

com.pulumi.awsnative.ec2.kotlin.TransitGatewayVpcAttachment.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.ec2.kotlin

import com.pulumi.awsnative.ec2.kotlin.outputs.OptionsProperties
import com.pulumi.awsnative.kotlin.outputs.Tag
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
import kotlin.collections.List
import com.pulumi.awsnative.ec2.kotlin.outputs.OptionsProperties.Companion.toKotlin as optionsPropertiesToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: TransitGatewayVpcAttachmentArgs = TransitGatewayVpcAttachmentArgs()

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

/**
 * Resource Type definition for AWS::EC2::TransitGatewayVpcAttachment
 */
public class TransitGatewayVpcAttachment internal constructor(
    override val javaResource: com.pulumi.awsnative.ec2.TransitGatewayVpcAttachment,
) : KotlinCustomResource(javaResource, TransitGatewayVpcAttachmentMapper) {
    /**
     * The IDs of one or more subnets to add. You can specify at most one subnet per Availability Zone.
     */
    public val addSubnetIds: Output>?
        get() = javaResource.addSubnetIds().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

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

    /**
     * The options for the transit gateway vpc attachment.
     */
    public val options: Output?
        get() = javaResource.options().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    optionsPropertiesToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The IDs of one or more subnets to remove.
     */
    public val removeSubnetIds: Output>?
        get() = javaResource.removeSubnetIds().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * The IDs of the subnets.
     */
    public val subnetIds: Output>
        get() = javaResource.subnetIds().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

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

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

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

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy