![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.awsnative.ec2.kotlin.NetworkInterfaceAttachment.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.ec2.kotlin
import com.pulumi.awsnative.ec2.kotlin.outputs.NetworkInterfaceAttachmentEnaSrdSpecification
import com.pulumi.awsnative.ec2.kotlin.outputs.NetworkInterfaceAttachmentEnaSrdSpecification.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
/**
* Builder for [NetworkInterfaceAttachment].
*/
@PulumiTagMarker
public class NetworkInterfaceAttachmentResourceBuilder internal constructor() {
public var name: String? = null
public var args: NetworkInterfaceAttachmentArgs = NetworkInterfaceAttachmentArgs()
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 NetworkInterfaceAttachmentArgsBuilder.() -> Unit) {
val builder = NetworkInterfaceAttachmentArgsBuilder()
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(): NetworkInterfaceAttachment {
val builtJavaResource =
com.pulumi.awsnative.ec2.NetworkInterfaceAttachment(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return NetworkInterfaceAttachment(builtJavaResource)
}
}
/**
* Attaches an elastic network interface (ENI) to an Amazon EC2 instance. You can use this resource type to attach additional network interfaces to an instance without interruption.
*/
public class NetworkInterfaceAttachment internal constructor(
override val javaResource: com.pulumi.awsnative.ec2.NetworkInterfaceAttachment,
) : KotlinCustomResource(javaResource, NetworkInterfaceAttachmentMapper) {
/**
* The ID of the network interface attachment.
*/
public val attachmentId: Output
get() = javaResource.attachmentId().applyValue({ args0 -> args0 })
/**
* Whether to delete the network interface when the instance terminates. By default, this value is set to ``true``.
*/
public val deleteOnTermination: Output?
get() = javaResource.deleteOnTermination().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The network interface's position in the attachment order. For example, the first attached network interface has a ``DeviceIndex`` of 0.
*/
public val deviceIndex: Output
get() = javaResource.deviceIndex().applyValue({ args0 -> args0 })
/**
* Configures ENA Express for the network interface that this action attaches to the instance.
*/
public val enaSrdSpecification: Output?
get() = javaResource.enaSrdSpecification().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> toKotlin(args0) })
}).orElse(null)
})
/**
* The ID of the instance to which you will attach the ENI.
*/
public val instanceId: Output
get() = javaResource.instanceId().applyValue({ args0 -> args0 })
/**
* The ID of the ENI that you want to attach.
*/
public val networkInterfaceId: Output
get() = javaResource.networkInterfaceId().applyValue({ args0 -> args0 })
}
public object NetworkInterfaceAttachmentMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.ec2.NetworkInterfaceAttachment::class == javaResource::class
override fun map(javaResource: Resource): NetworkInterfaceAttachment =
NetworkInterfaceAttachment(
javaResource as
com.pulumi.awsnative.ec2.NetworkInterfaceAttachment,
)
}
/**
* @see [NetworkInterfaceAttachment].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [NetworkInterfaceAttachment].
*/
public suspend fun networkInterfaceAttachment(
name: String,
block: suspend NetworkInterfaceAttachmentResourceBuilder.() -> Unit,
): NetworkInterfaceAttachment {
val builder = NetworkInterfaceAttachmentResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [NetworkInterfaceAttachment].
* @param name The _unique_ name of the resulting resource.
*/
public fun networkInterfaceAttachment(name: String): NetworkInterfaceAttachment {
val builder = NetworkInterfaceAttachmentResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy