com.pulumi.awsnative.ec2.kotlin.TransitGatewayAttachment.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@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 [TransitGatewayAttachment].
*/
@PulumiTagMarker
public class TransitGatewayAttachmentResourceBuilder internal constructor() {
public var name: String? = null
public var args: TransitGatewayAttachmentArgs = TransitGatewayAttachmentArgs()
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 TransitGatewayAttachmentArgsBuilder.() -> Unit) {
val builder = TransitGatewayAttachmentArgsBuilder()
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(): TransitGatewayAttachment {
val builtJavaResource =
com.pulumi.awsnative.ec2.TransitGatewayAttachment(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return TransitGatewayAttachment(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::EC2::TransitGatewayAttachment
*/
public class TransitGatewayAttachment internal constructor(
override val javaResource: com.pulumi.awsnative.ec2.TransitGatewayAttachment,
) : KotlinCustomResource(javaResource, TransitGatewayAttachmentMapper) {
/**
* 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. You can specify only one subnet per Availability Zone. You must specify at least one subnet, but we recommend that you specify two subnets for better availability. The transit gateway uses one IP address from each specified subnet.
*/
public val subnetIds: Output>
get() = javaResource.subnetIds().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
/**
* The tags for the 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 TransitGatewayAttachmentMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.ec2.TransitGatewayAttachment::class == javaResource::class
override fun map(javaResource: Resource): TransitGatewayAttachment =
TransitGatewayAttachment(javaResource as com.pulumi.awsnative.ec2.TransitGatewayAttachment)
}
/**
* @see [TransitGatewayAttachment].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [TransitGatewayAttachment].
*/
public suspend fun transitGatewayAttachment(
name: String,
block: suspend TransitGatewayAttachmentResourceBuilder.() -> Unit,
): TransitGatewayAttachment {
val builder = TransitGatewayAttachmentResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [TransitGatewayAttachment].
* @param name The _unique_ name of the resulting resource.
*/
public fun transitGatewayAttachment(name: String): TransitGatewayAttachment {
val builder = TransitGatewayAttachmentResourceBuilder()
builder.name(name)
return builder.build()
}