com.pulumi.awsnative.ec2.kotlin.IpamPoolCidr.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 [IpamPoolCidr].
*/
@PulumiTagMarker
public class IpamPoolCidrResourceBuilder internal constructor() {
public var name: String? = null
public var args: IpamPoolCidrArgs = IpamPoolCidrArgs()
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 IpamPoolCidrArgsBuilder.() -> Unit) {
val builder = IpamPoolCidrArgsBuilder()
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(): IpamPoolCidr {
val builtJavaResource = com.pulumi.awsnative.ec2.IpamPoolCidr(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return IpamPoolCidr(builtJavaResource)
}
}
/**
* Resource Schema of AWS::EC2::IPAMPoolCidr Type
*/
public class IpamPoolCidr internal constructor(
override val javaResource: com.pulumi.awsnative.ec2.IpamPoolCidr,
) : KotlinCustomResource(javaResource, IpamPoolCidrMapper) {
/**
* Represents a single IPv4 or IPv6 CIDR
*/
public val cidr: Output?
get() = javaResource.cidr().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* Id of the IPAM Pool Cidr.
*/
public val ipamPoolCidrId: Output
get() = javaResource.ipamPoolCidrId().applyValue({ args0 -> args0 })
/**
* Id of the IPAM Pool.
*/
public val ipamPoolId: Output
get() = javaResource.ipamPoolId().applyValue({ args0 -> args0 })
/**
* The desired netmask length of the provision. 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)
})
/**
* Provisioned state of the cidr.
*/
public val state: Output
get() = javaResource.state().applyValue({ args0 -> args0 })
}
public object IpamPoolCidrMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.ec2.IpamPoolCidr::class == javaResource::class
override fun map(javaResource: Resource): IpamPoolCidr = IpamPoolCidr(
javaResource as
com.pulumi.awsnative.ec2.IpamPoolCidr,
)
}
/**
* @see [IpamPoolCidr].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [IpamPoolCidr].
*/
public suspend fun ipamPoolCidr(
name: String,
block: suspend IpamPoolCidrResourceBuilder.() -> Unit,
): IpamPoolCidr {
val builder = IpamPoolCidrResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [IpamPoolCidr].
* @param name The _unique_ name of the resulting resource.
*/
public fun ipamPoolCidr(name: String): IpamPoolCidr {
val builder = IpamPoolCidrResourceBuilder()
builder.name(name)
return builder.build()
}