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

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

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

package com.pulumi.awsnative.ec2.kotlin

import com.pulumi.awsnative.ec2.kotlin.enums.PrefixListAddressFamily
import com.pulumi.awsnative.ec2.kotlin.outputs.PrefixListEntry
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.PrefixListAddressFamily.Companion.toKotlin as prefixListAddressFamilyToKotlin
import com.pulumi.awsnative.ec2.kotlin.outputs.PrefixListEntry.Companion.toKotlin as prefixListEntryToKotlin
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin

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

    public var args: PrefixListArgs = PrefixListArgs()

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

/**
 * Resource schema of AWS::EC2::PrefixList Type
 * ## Example Usage
 * ### Example
 * No Java example available.
 * ### Example
 * No Java example available.
 */
public class PrefixList internal constructor(
    override val javaResource: com.pulumi.awsnative.ec2.PrefixList,
) : KotlinCustomResource(javaResource, PrefixListMapper) {
    /**
     * Ip Version of Prefix List.
     */
    public val addressFamily: Output
        get() = javaResource.addressFamily().applyValue({ args0 ->
            args0.let({ args0 ->
                prefixListAddressFamilyToKotlin(args0)
            })
        })

    /**
     * The Amazon Resource Name (ARN) of the Prefix List.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * Entries of Prefix List.
     */
    public val entries: Output>?
        get() = javaResource.entries().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> prefixListEntryToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * Max Entries of Prefix List.
     */
    public val maxEntries: Output?
        get() = javaResource.maxEntries().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Owner Id of Prefix List.
     */
    public val ownerId: Output
        get() = javaResource.ownerId().applyValue({ args0 -> args0 })

    /**
     * Id of Prefix List.
     */
    public val prefixListId: Output
        get() = javaResource.prefixListId().applyValue({ args0 -> args0 })

    /**
     * Name of Prefix List.
     */
    public val prefixListName: Output
        get() = javaResource.prefixListName().applyValue({ args0 -> args0 })

    /**
     * Tags for Prefix List
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * Version of Prefix List.
     */
    public val version: Output
        get() = javaResource.version().applyValue({ args0 -> args0 })
}

public object PrefixListMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.ec2.PrefixList::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy