com.pulumi.awsnative.ec2.kotlin.IpamAllocation.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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [IpamAllocation].
*/
@PulumiTagMarker
public class IpamAllocationResourceBuilder internal constructor() {
public var name: String? = null
public var args: IpamAllocationArgs = IpamAllocationArgs()
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 IpamAllocationArgsBuilder.() -> Unit) {
val builder = IpamAllocationArgsBuilder()
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(): IpamAllocation {
val builtJavaResource = com.pulumi.awsnative.ec2.IpamAllocation(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return IpamAllocation(builtJavaResource)
}
}
/**
* Resource Schema of AWS::EC2::IPAMAllocation Type
*/
public class IpamAllocation internal constructor(
override val javaResource: com.pulumi.awsnative.ec2.IpamAllocation,
) : KotlinCustomResource(javaResource, IpamAllocationMapper) {
/**
* The CIDR you would like to allocate from the IPAM pool. Note the following:
* - If there is no DefaultNetmaskLength allocation rule set on the pool, you must specify either the NetmaskLength or the CIDR.
* - If the DefaultNetmaskLength allocation rule is set on the pool, you can specify either the NetmaskLength or the CIDR and the DefaultNetmaskLength allocation rule will be ignored.
* Possible values: Any available IPv4 or IPv6 CIDR.
*/
public val cidr: Output?
get() = javaResource.cidr().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* A description for the allocation.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Id of the allocation.
*/
public val ipamPoolAllocationId: Output
get() = javaResource.ipamPoolAllocationId().applyValue({ args0 -> args0 })
/**
* Id of the IPAM Pool.
*/
public val ipamPoolId: Output
get() = javaResource.ipamPoolId().applyValue({ args0 -> args0 })
/**
* The desired netmask length of the allocation. If set, IPAM will choose a block of free space with this size and return the CIDR representing it.
*/
public val netmaskLength: Output?
get() = javaResource.netmaskLength().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
}
public object IpamAllocationMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.ec2.IpamAllocation::class == javaResource::class
override fun map(javaResource: Resource): IpamAllocation = IpamAllocation(
javaResource as
com.pulumi.awsnative.ec2.IpamAllocation,
)
}
/**
* @see [IpamAllocation].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [IpamAllocation].
*/
public suspend fun ipamAllocation(
name: String,
block: suspend IpamAllocationResourceBuilder.() -> Unit,
): IpamAllocation {
val builder = IpamAllocationResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [IpamAllocation].
* @param name The _unique_ name of the resulting resource.
*/
public fun ipamAllocation(name: String): IpamAllocation {
val builder = IpamAllocationResourceBuilder()
builder.name(name)
return builder.build()
}