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

com.pulumi.awsnative.ec2.kotlin.VpcPeeringConnection.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.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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List

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

    public var args: VpcPeeringConnectionArgs = VpcPeeringConnectionArgs()

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

/**
 * Resource Type definition for AWS::EC2::VPCPeeringConnection
 */
public class VpcPeeringConnection internal constructor(
    override val javaResource: com.pulumi.awsnative.ec2.VpcPeeringConnection,
) : KotlinCustomResource(javaResource, VpcPeeringConnectionMapper) {
    /**
     * The ID of the peering connection.
     */
    public val awsId: Output
        get() = javaResource.awsId().applyValue({ args0 -> args0 })

    /**
     * The AWS account ID of the owner of the accepter VPC.
     */
    public val peerOwnerId: Output?
        get() = javaResource.peerOwnerId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Region code for the accepter VPC, if the accepter VPC is located in a Region other than the Region in which you make the request.
     */
    public val peerRegion: Output?
        get() = javaResource.peerRegion().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Amazon Resource Name (ARN) of the VPC peer role for the peering connection in another AWS account.
     */
    public val peerRoleArn: Output?
        get() = javaResource.peerRoleArn().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The ID of the VPC with which you are creating the VPC peering connection. You must specify this parameter in the request.
     */
    public val peerVpcId: Output
        get() = javaResource.peerVpcId().applyValue({ args0 -> args0 })

    /**
     * Any tags assigned to the resource.
     */
    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 VpcPeeringConnectionMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.ec2.VpcPeeringConnection::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy