All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.awsnative.ec2.kotlin.IpamScope.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.ec2.kotlin

import com.pulumi.awsnative.ec2.kotlin.enums.IpamScopeType
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.IpamScopeType.Companion.toKotlin as ipamScopeTypeToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

/**
 * Builder for [IpamScope].
 */
@PulumiTagMarker
public class IpamScopeResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: IpamScopeArgs = IpamScopeArgs()

    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 IpamScopeArgsBuilder.() -> Unit) {
        val builder = IpamScopeArgsBuilder()
        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(): IpamScope {
        val builtJavaResource = com.pulumi.awsnative.ec2.IpamScope(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return IpamScope(builtJavaResource)
    }
}

/**
 * Resource Schema of AWS::EC2::IPAMScope Type
 */
public class IpamScope internal constructor(
    override val javaResource: com.pulumi.awsnative.ec2.IpamScope,
) : KotlinCustomResource(javaResource, IpamScopeMapper) {
    /**
     * The Amazon Resource Name (ARN) of the IPAM scope.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * The description of the scope.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Amazon Resource Name (ARN) of the IPAM this scope is a part of.
     */
    public val ipamArn: Output
        get() = javaResource.ipamArn().applyValue({ args0 -> args0 })

    /**
     * The Id of the IPAM this scope is a part of.
     */
    public val ipamId: Output
        get() = javaResource.ipamId().applyValue({ args0 -> args0 })

    /**
     * Id of the IPAM scope.
     */
    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 ->
                ipamScopeTypeToKotlin(args0)
            })
        })

    /**
     * Is this one of the default scopes created with the IPAM.
     */
    public val isDefault: Output
        get() = javaResource.isDefault().applyValue({ args0 -> args0 })

    /**
     * The number of pools that currently exist in this scope.
     */
    public val poolCount: Output
        get() = javaResource.poolCount().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 IpamScopeMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.ec2.IpamScope::class == javaResource::class

    override fun map(javaResource: Resource): IpamScope = IpamScope(
        javaResource as
            com.pulumi.awsnative.ec2.IpamScope,
    )
}

/**
 * @see [IpamScope].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [IpamScope].
 */
public suspend fun ipamScope(name: String, block: suspend IpamScopeResourceBuilder.() -> Unit): IpamScope {
    val builder = IpamScopeResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [IpamScope].
 * @param name The _unique_ name of the resulting resource.
 */
public fun ipamScope(name: String): IpamScope {
    val builder = IpamScopeResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy