![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.awsnative.ec2.kotlin.VpcGatewayAttachment.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 [VpcGatewayAttachment].
*/
@PulumiTagMarker
public class VpcGatewayAttachmentResourceBuilder internal constructor() {
public var name: String? = null
public var args: VpcGatewayAttachmentArgs = VpcGatewayAttachmentArgs()
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 VpcGatewayAttachmentArgsBuilder.() -> Unit) {
val builder = VpcGatewayAttachmentArgsBuilder()
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(): VpcGatewayAttachment {
val builtJavaResource = com.pulumi.awsnative.ec2.VpcGatewayAttachment(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return VpcGatewayAttachment(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::EC2::VPCGatewayAttachment
*/
public class VpcGatewayAttachment internal constructor(
override val javaResource: com.pulumi.awsnative.ec2.VpcGatewayAttachment,
) : KotlinCustomResource(javaResource, VpcGatewayAttachmentMapper) {
/**
* Used to identify if this resource is an Internet Gateway or Vpn Gateway Attachment
*/
public val attachmentType: Output
get() = javaResource.attachmentType().applyValue({ args0 -> args0 })
/**
* The ID of the internet gateway. You must specify either InternetGatewayId or VpnGatewayId, but not both.
*/
public val internetGatewayId: Output?
get() = javaResource.internetGatewayId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The ID of the VPC.
*/
public val vpcId: Output
get() = javaResource.vpcId().applyValue({ args0 -> args0 })
/**
* The ID of the virtual private gateway. You must specify either InternetGatewayId or VpnGatewayId, but not both.
*/
public val vpnGatewayId: Output?
get() = javaResource.vpnGatewayId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
}
public object VpcGatewayAttachmentMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.ec2.VpcGatewayAttachment::class == javaResource::class
override fun map(javaResource: Resource): VpcGatewayAttachment = VpcGatewayAttachment(
javaResource
as com.pulumi.awsnative.ec2.VpcGatewayAttachment,
)
}
/**
* @see [VpcGatewayAttachment].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [VpcGatewayAttachment].
*/
public suspend fun vpcGatewayAttachment(
name: String,
block: suspend VpcGatewayAttachmentResourceBuilder.() -> Unit,
): VpcGatewayAttachment {
val builder = VpcGatewayAttachmentResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [VpcGatewayAttachment].
* @param name The _unique_ name of the resulting resource.
*/
public fun vpcGatewayAttachment(name: String): VpcGatewayAttachment {
val builder = VpcGatewayAttachmentResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy