com.pulumi.awsnative.ec2.kotlin.Eip.kt Maven / Gradle / Ivy
@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 [Eip].
*/
@PulumiTagMarker
public class EipResourceBuilder internal constructor() {
public var name: String? = null
public var args: EipArgs = EipArgs()
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 EipArgsBuilder.() -> Unit) {
val builder = EipArgsBuilder()
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(): Eip {
val builtJavaResource = com.pulumi.awsnative.ec2.Eip(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Eip(builtJavaResource)
}
}
/**
* Specifies an Elastic IP (EIP) address and can, optionally, associate it with an Amazon EC2 instance.
* You can allocate an Elastic IP address from an address pool owned by AWS or from an address pool created from a public IPv4 address range that you have brought to AWS for use with your AWS resources using bring your own IP addresses (BYOIP). For more information, see [Bring Your Own IP Addresses (BYOIP)](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html) in the *Amazon EC2 User Guide*.
* For more information, see [Elastic IP Addresses](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) in the *Amazon EC2 User Guide*.
*/
public class Eip internal constructor(
override val javaResource: com.pulumi.awsnative.ec2.Eip,
) : KotlinCustomResource(javaResource, EipMapper) {
/**
* The ID that AWS assigns to represent the allocation of the address for use with Amazon VPC. This is returned only for VPC elastic IP addresses. For example, `eipalloc-5723d13e` .
*/
public val allocationId: Output
get() = javaResource.allocationId().applyValue({ args0 -> args0 })
/**
* The network (``vpc``).
* If you define an Elastic IP address and associate it with a VPC that is defined in the same template, you must declare a dependency on the VPC-gateway attachment by using the [DependsOn Attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html) on this resource.
*/
public val domain: Output?
get() = javaResource.domain().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The ID of the instance.
* Updates to the ``InstanceId`` property may require *some interruptions*. Updates on an EIP reassociates the address on its associated resource.
*/
public val instanceId: Output?
get() = javaResource.instanceId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* A unique set of Availability Zones, Local Zones, or Wavelength Zones from which AWS advertises IP addresses. Use this parameter to limit the IP address to this location. IP addresses cannot move between network border groups.
* Use [DescribeAvailabilityZones](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAvailabilityZones.html) to view the network border groups.
*/
public val networkBorderGroup: Output?
get() = javaResource.networkBorderGroup().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The Elastic IP address.
*/
public val publicIp: Output
get() = javaResource.publicIp().applyValue({ args0 -> args0 })
/**
* The ID of an address pool that you own. Use this parameter to let Amazon EC2 select an address from the address pool.
* Updates to the ``PublicIpv4Pool`` property may require *some interruptions*. Updates on an EIP reassociates the address on its associated resource.
*/
public val publicIpv4Pool: Output?
get() = javaResource.publicIpv4Pool().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Any tags assigned to the Elastic IP address.
* Updates to the ``Tags`` property may require *some interruptions*. Updates on an EIP reassociates the address on its associated resource.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> toKotlin(args0) })
})
}).orElse(null)
})
/**
* The Elastic IP address you are accepting for transfer. You can only accept one transferred address. For more information on Elastic IP address transfers, see [Transfer Elastic IP addresses](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#transfer-EIPs-intro) in the *Amazon Virtual Private Cloud User Guide*.
*/
public val transferAddress: Output?
get() = javaResource.transferAddress().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
}
public object EipMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.ec2.Eip::class == javaResource::class
override fun map(javaResource: Resource): Eip = Eip(javaResource as com.pulumi.awsnative.ec2.Eip)
}
/**
* @see [Eip].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Eip].
*/
public suspend fun eip(name: String, block: suspend EipResourceBuilder.() -> Unit): Eip {
val builder = EipResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Eip].
* @param name The _unique_ name of the resulting resource.
*/
public fun eip(name: String): Eip {
val builder = EipResourceBuilder()
builder.name(name)
return builder.build()
}