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

com.pulumi.awsnative.apprunner.kotlin.VpcConnector.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.apprunner.kotlin

import com.pulumi.awsnative.kotlin.outputs.CreateOnlyTag
import com.pulumi.awsnative.kotlin.outputs.CreateOnlyTag.Companion.toKotlin
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

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

    public var args: VpcConnectorArgs = VpcConnectorArgs()

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

/**
 * The AWS::AppRunner::VpcConnector resource specifies an App Runner VpcConnector.
 */
public class VpcConnector internal constructor(
    override val javaResource: com.pulumi.awsnative.apprunner.VpcConnector,
) : KotlinCustomResource(javaResource, VpcConnectorMapper) {
    /**
     * A list of IDs of security groups that App Runner should use for access to AWS resources under the specified subnets. If not specified, App Runner uses the default security group of the Amazon VPC. The default security group allows all outbound traffic.
     */
    public val securityGroups: Output>?
        get() = javaResource.securityGroups().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * A list of IDs of subnets that App Runner should use when it associates your service with a custom Amazon VPC. Specify IDs of subnets of a single Amazon VPC. App Runner determines the Amazon VPC from the subnets you specify.
     */
    public val subnets: Output>
        get() = javaResource.subnets().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * A list of metadata items that you can associate with your VPC connector resource. A tag is a key-value pair.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> toKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * The Amazon Resource Name (ARN) of this VPC connector.
     */
    public val vpcConnectorArn: Output
        get() = javaResource.vpcConnectorArn().applyValue({ args0 -> args0 })

    /**
     * A name for the VPC connector. If you don't specify a name, AWS CloudFormation generates a name for your VPC connector.
     */
    public val vpcConnectorName: Output?
        get() = javaResource.vpcConnectorName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The revision of this VPC connector. It's unique among all the active connectors ("Status": "ACTIVE") that share the same Name.
     */
    public val vpcConnectorRevision: Output
        get() = javaResource.vpcConnectorRevision().applyValue({ args0 -> args0 })
}

public object VpcConnectorMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.apprunner.VpcConnector::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy