
com.pulumi.awsnative.ec2.kotlin.NetworkInterface.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.NetworkInterfaceConnectionTrackingSpecification
import com.pulumi.awsnative.ec2.kotlin.outputs.NetworkInterfaceInstanceIpv6Address
import com.pulumi.awsnative.ec2.kotlin.outputs.NetworkInterfaceIpv4PrefixSpecification
import com.pulumi.awsnative.ec2.kotlin.outputs.NetworkInterfaceIpv6PrefixSpecification
import com.pulumi.awsnative.ec2.kotlin.outputs.NetworkInterfacePrivateIpAddressSpecification
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.ec2.kotlin.outputs.NetworkInterfaceConnectionTrackingSpecification.Companion.toKotlin as networkInterfaceConnectionTrackingSpecificationToKotlin
import com.pulumi.awsnative.ec2.kotlin.outputs.NetworkInterfaceInstanceIpv6Address.Companion.toKotlin as networkInterfaceInstanceIpv6AddressToKotlin
import com.pulumi.awsnative.ec2.kotlin.outputs.NetworkInterfaceIpv4PrefixSpecification.Companion.toKotlin as networkInterfaceIpv4PrefixSpecificationToKotlin
import com.pulumi.awsnative.ec2.kotlin.outputs.NetworkInterfaceIpv6PrefixSpecification.Companion.toKotlin as networkInterfaceIpv6PrefixSpecificationToKotlin
import com.pulumi.awsnative.ec2.kotlin.outputs.NetworkInterfacePrivateIpAddressSpecification.Companion.toKotlin as networkInterfacePrivateIpAddressSpecificationToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* Builder for [NetworkInterface].
*/
@PulumiTagMarker
public class NetworkInterfaceResourceBuilder internal constructor() {
public var name: String? = null
public var args: NetworkInterfaceArgs = NetworkInterfaceArgs()
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 NetworkInterfaceArgsBuilder.() -> Unit) {
val builder = NetworkInterfaceArgsBuilder()
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(): NetworkInterface {
val builtJavaResource = com.pulumi.awsnative.ec2.NetworkInterface(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return NetworkInterface(builtJavaResource)
}
}
/**
* The AWS::EC2::NetworkInterface resource creates network interface
*/
public class NetworkInterface internal constructor(
override val javaResource: com.pulumi.awsnative.ec2.NetworkInterface,
) : KotlinCustomResource(javaResource, NetworkInterfaceMapper) {
/**
* Network interface id.
*/
public val awsId: Output
get() = javaResource.awsId().applyValue({ args0 -> args0 })
/**
* A connection tracking specification for the network interface.
*/
public val connectionTrackingSpecification:
Output?
get() = javaResource.connectionTrackingSpecification().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
networkInterfaceConnectionTrackingSpecificationToKotlin(args0)
})
}).orElse(null)
})
/**
* A description for the network interface.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* If you have instances or ENIs that rely on the IPv6 address not changing, to avoid disrupting traffic to instances or ENIs, you can enable a primary IPv6 address. Enable this option to automatically assign an IPv6 associated with the ENI attached to your instance to be the primary IPv6 address. When you enable an IPv6 address to be a primary IPv6, you cannot disable it. Traffic will be routed to the primary IPv6 address until the instance is terminated or the ENI is detached. If you have multiple IPv6 addresses associated with an ENI and you enable a primary IPv6 address, the first IPv6 address associated with the ENI becomes the primary IPv6 address.
*/
public val enablePrimaryIpv6: Output?
get() = javaResource.enablePrimaryIpv6().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* A list of security group IDs associated with this network interface.
*/
public val groupSet: Output>?
get() = javaResource.groupSet().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0
})
}).orElse(null)
})
/**
* Indicates the type of network interface.
*/
public val interfaceType: Output?
get() = javaResource.interfaceType().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The number of IPv4 prefixes to assign to a network interface. When you specify a number of IPv4 prefixes, Amazon EC2 selects these prefixes from your existing subnet CIDR reservations, if available, or from free spaces in the subnet. By default, these will be /28 prefixes. You can't specify a count of IPv4 prefixes if you've specified one of the following: specific IPv4 prefixes, specific private IPv4 addresses, or a count of private IPv4 addresses.
*/
public val ipv4PrefixCount: Output?
get() = javaResource.ipv4PrefixCount().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Assigns a list of IPv4 prefixes to the network interface. If you want EC2 to automatically assign IPv4 prefixes, use the Ipv4PrefixCount property and do not specify this property. Presently, only /28 prefixes are supported. You can't specify IPv4 prefixes if you've specified one of the following: a count of IPv4 prefixes, specific private IPv4 addresses, or a count of private IPv4 addresses.
*/
public val ipv4Prefixes: Output>?
get() = javaResource.ipv4Prefixes().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
networkInterfaceIpv4PrefixSpecificationToKotlin(args0)
})
})
}).orElse(null)
})
/**
* The number of IPv6 addresses to assign to a network interface. Amazon EC2 automatically selects the IPv6 addresses from the subnet range. To specify specific IPv6 addresses, use the Ipv6Addresses property and don't specify this property.
*/
public val ipv6AddressCount: Output?
get() = javaResource.ipv6AddressCount().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet to associate with the network interface. If you're specifying a number of IPv6 addresses, use the Ipv6AddressCount property and don't specify this property.
*/
public val ipv6Addresses: Output>?
get() = javaResource.ipv6Addresses().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
networkInterfaceInstanceIpv6AddressToKotlin(args0)
})
})
}).orElse(null)
})
/**
* The number of IPv6 prefixes to assign to a network interface. When you specify a number of IPv6 prefixes, Amazon EC2 selects these prefixes from your existing subnet CIDR reservations, if available, or from free spaces in the subnet. By default, these will be /80 prefixes. You can't specify a count of IPv6 prefixes if you've specified one of the following: specific IPv6 prefixes, specific IPv6 addresses, or a count of IPv6 addresses.
*/
public val ipv6PrefixCount: Output?
get() = javaResource.ipv6PrefixCount().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Assigns a list of IPv6 prefixes to the network interface. If you want EC2 to automatically assign IPv6 prefixes, use the Ipv6PrefixCount property and do not specify this property. Presently, only /80 prefixes are supported. You can't specify IPv6 prefixes if you've specified one of the following: a count of IPv6 prefixes, specific IPv6 addresses, or a count of IPv6 addresses.
*/
public val ipv6Prefixes: Output>?
get() = javaResource.ipv6Prefixes().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
networkInterfaceIpv6PrefixSpecificationToKotlin(args0)
})
})
}).orElse(null)
})
/**
* The primary IPv6 address
*/
public val primaryIpv6Address: Output
get() = javaResource.primaryIpv6Address().applyValue({ args0 -> args0 })
/**
* Returns the primary private IP address of the network interface.
*/
public val primaryPrivateIpAddress: Output
get() = javaResource.primaryPrivateIpAddress().applyValue({ args0 -> args0 })
/**
* Assigns a single private IP address to the network interface, which is used as the primary private IP address. If you want to specify multiple private IP address, use the PrivateIpAddresses property.
*/
public val privateIpAddress: Output?
get() = javaResource.privateIpAddress().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Assigns a list of private IP addresses to the network interface. You can specify a primary private IP address by setting the value of the Primary property to true in the PrivateIpAddressSpecification property. If you want EC2 to automatically assign private IP addresses, use the SecondaryPrivateIpAddressCount property and do not specify this property.
*/
public val privateIpAddresses: Output>?
get() = javaResource.privateIpAddresses().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
networkInterfacePrivateIpAddressSpecificationToKotlin(args0)
})
})
}).orElse(null)
})
/**
* The number of secondary private IPv4 addresses to assign to a network interface. When you specify a number of secondary IPv4 addresses, Amazon EC2 selects these IP addresses within the subnet's IPv4 CIDR range. You can't specify this option and specify more than one private IP address using privateIpAddresses
*/
public val secondaryPrivateIpAddressCount: Output?
get() = javaResource.secondaryPrivateIpAddressCount().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Returns the secondary private IP addresses of the network interface.
*/
public val secondaryPrivateIpAddresses: Output>
get() = javaResource.secondaryPrivateIpAddresses().applyValue({ args0 ->
args0.map({ args0 ->
args0
})
})
/**
* Indicates whether traffic to or from the instance is validated.
*/
public val sourceDestCheck: Output?
get() = javaResource.sourceDestCheck().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The ID of the subnet to associate with the network interface.
*/
public val subnetId: Output
get() = javaResource.subnetId().applyValue({ args0 -> args0 })
/**
* An arbitrary set of tags (key-value pairs) for this network interface.
*/
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 VPC
*/
public val vpcId: Output
get() = javaResource.vpcId().applyValue({ args0 -> args0 })
}
public object NetworkInterfaceMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.ec2.NetworkInterface::class == javaResource::class
override fun map(javaResource: Resource): NetworkInterface = NetworkInterface(
javaResource as
com.pulumi.awsnative.ec2.NetworkInterface,
)
}
/**
* @see [NetworkInterface].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [NetworkInterface].
*/
public suspend fun networkInterface(
name: String,
block: suspend NetworkInterfaceResourceBuilder.() -> Unit,
): NetworkInterface {
val builder = NetworkInterfaceResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [NetworkInterface].
* @param name The _unique_ name of the resulting resource.
*/
public fun networkInterface(name: String): NetworkInterface {
val builder = NetworkInterfaceResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy