com.pulumi.awsnative.ec2.kotlin.IpamPool.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.enums.IpamPoolAwsService
import com.pulumi.awsnative.ec2.kotlin.enums.IpamPoolIpamScopeType
import com.pulumi.awsnative.ec2.kotlin.enums.IpamPoolPublicIpSource
import com.pulumi.awsnative.ec2.kotlin.enums.IpamPoolState
import com.pulumi.awsnative.ec2.kotlin.outputs.IpamPoolProvisionedCidr
import com.pulumi.awsnative.ec2.kotlin.outputs.IpamPoolSourceResource
import com.pulumi.awsnative.ec2.kotlin.outputs.IpamPoolTag
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.enums.IpamPoolAwsService.Companion.toKotlin as ipamPoolAwsServiceToKotlin
import com.pulumi.awsnative.ec2.kotlin.enums.IpamPoolIpamScopeType.Companion.toKotlin as ipamPoolIpamScopeTypeToKotlin
import com.pulumi.awsnative.ec2.kotlin.enums.IpamPoolPublicIpSource.Companion.toKotlin as ipamPoolPublicIpSourceToKotlin
import com.pulumi.awsnative.ec2.kotlin.enums.IpamPoolState.Companion.toKotlin as ipamPoolStateToKotlin
import com.pulumi.awsnative.ec2.kotlin.outputs.IpamPoolProvisionedCidr.Companion.toKotlin as ipamPoolProvisionedCidrToKotlin
import com.pulumi.awsnative.ec2.kotlin.outputs.IpamPoolSourceResource.Companion.toKotlin as ipamPoolSourceResourceToKotlin
import com.pulumi.awsnative.ec2.kotlin.outputs.IpamPoolTag.Companion.toKotlin as ipamPoolTagToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
/**
* Builder for [IpamPool].
*/
@PulumiTagMarker
public class IpamPoolResourceBuilder internal constructor() {
public var name: String? = null
public var args: IpamPoolArgs = IpamPoolArgs()
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 IpamPoolArgsBuilder.() -> Unit) {
val builder = IpamPoolArgsBuilder()
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(): IpamPool {
val builtJavaResource = com.pulumi.awsnative.ec2.IpamPool(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return IpamPool(builtJavaResource)
}
}
/**
* Resource Schema of AWS::EC2::IPAMPool Type
*/
public class IpamPool internal constructor(
override val javaResource: com.pulumi.awsnative.ec2.IpamPool,
) : KotlinCustomResource(javaResource, IpamPoolMapper) {
/**
* The address family of the address space in this pool. Either IPv4 or IPv6.
*/
public val addressFamily: Output
get() = javaResource.addressFamily().applyValue({ args0 -> args0 })
/**
* The default netmask length for allocations made from this pool. This value is used when the netmask length of an allocation isn't specified.
*/
public val allocationDefaultNetmaskLength: Output?
get() = javaResource.allocationDefaultNetmaskLength().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The maximum allowed netmask length for allocations made from this pool.
*/
public val allocationMaxNetmaskLength: Output?
get() = javaResource.allocationMaxNetmaskLength().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The minimum allowed netmask length for allocations made from this pool.
*/
public val allocationMinNetmaskLength: Output?
get() = javaResource.allocationMinNetmaskLength().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* When specified, an allocation will not be allowed unless a resource has a matching set of tags.
*/
public val allocationResourceTags: Output>?
get() = javaResource.allocationResourceTags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0.let({ args0 -> ipamPoolTagToKotlin(args0) }) })
}).orElse(null)
})
/**
* The Amazon Resource Name (ARN) of the IPAM Pool.
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* Determines what to do if IPAM discovers resources that haven't been assigned an allocation. If set to true, an allocation will be made automatically.
*/
public val autoImport: Output?
get() = javaResource.autoImport().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Limits which service in Amazon Web Services that the pool can be used in.
*/
public val awsService: Output?
get() = javaResource.awsService().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
ipamPoolAwsServiceToKotlin(args0)
})
}).orElse(null)
})
/**
* The description of the IPAM pool.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The Amazon Resource Name (ARN) of the IPAM this pool is a part of.
*/
public val ipamArn: Output
get() = javaResource.ipamArn().applyValue({ args0 -> args0 })
/**
* Id of the IPAM Pool.
*/
public val ipamPoolId: Output
get() = javaResource.ipamPoolId().applyValue({ args0 -> args0 })
/**
* The Amazon Resource Name (ARN) of the scope this pool is a part of.
*/
public val ipamScopeArn: Output
get() = javaResource.ipamScopeArn().applyValue({ args0 -> args0 })
/**
* The Id of the scope this pool is a part of.
*/
public val ipamScopeId: Output
get() = javaResource.ipamScopeId().applyValue({ args0 -> args0 })
/**
* Determines whether this scope contains publicly routable space or space for a private network
*/
public val ipamScopeType: Output
get() = javaResource.ipamScopeType().applyValue({ args0 ->
args0.let({ args0 ->
ipamPoolIpamScopeTypeToKotlin(args0)
})
})
/**
* The region of this pool. If not set, this will default to "None" which will disable non-custom allocations. If the locale has been specified for the source pool, this value must match.
*/
public val locale: Output?
get() = javaResource.locale().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The depth of this pool in the source pool hierarchy.
*/
public val poolDepth: Output
get() = javaResource.poolDepth().applyValue({ args0 -> args0 })
/**
* A list of cidrs representing the address space available for allocation in this pool.
*/
public val provisionedCidrs: Output>?
get() = javaResource.provisionedCidrs().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
ipamPoolProvisionedCidrToKotlin(args0)
})
})
}).orElse(null)
})
/**
* The IP address source for pools in the public scope. Only used for provisioning IP address CIDRs to pools in the public scope. Default is `byoip`.
*/
public val publicIpSource: Output?
get() = javaResource.publicIpSource().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> ipamPoolPublicIpSourceToKotlin(args0) })
}).orElse(null)
})
/**
* Determines whether or not address space from this pool is publicly advertised. Must be set if and only if the pool is IPv6.
*/
public val publiclyAdvertisable: Output?
get() = javaResource.publiclyAdvertisable().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The Id of this pool's source. If set, all space provisioned in this pool must be free space provisioned in the parent pool.
*/
public val sourceIpamPoolId: Output?
get() = javaResource.sourceIpamPoolId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The resource used to provision CIDRs to a resource planning pool.
*/
public val sourceResource: Output?
get() = javaResource.sourceResource().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> ipamPoolSourceResourceToKotlin(args0) })
}).orElse(null)
})
/**
* The state of this pool. This can be one of the following values: "create-in-progress", "create-complete", "modify-in-progress", "modify-complete", "delete-in-progress", or "delete-complete"
*/
public val state: Output
get() = javaResource.state().applyValue({ args0 ->
args0.let({ args0 ->
ipamPoolStateToKotlin(args0)
})
})
/**
* An explanation of how the pool arrived at it current state.
*/
public val stateMessage: Output
get() = javaResource.stateMessage().applyValue({ args0 -> args0 })
/**
* An array of key-value pairs to apply to this resource.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> tagToKotlin(args0) })
})
}).orElse(null)
})
}
public object IpamPoolMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.ec2.IpamPool::class == javaResource::class
override fun map(javaResource: Resource): IpamPool = IpamPool(
javaResource as
com.pulumi.awsnative.ec2.IpamPool,
)
}
/**
* @see [IpamPool].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [IpamPool].
*/
public suspend fun ipamPool(name: String, block: suspend IpamPoolResourceBuilder.() -> Unit): IpamPool {
val builder = IpamPoolResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [IpamPool].
* @param name The _unique_ name of the resulting resource.
*/
public fun ipamPool(name: String): IpamPool {
val builder = IpamPoolResourceBuilder()
builder.name(name)
return builder.build()
}