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

com.pulumi.awsnative.vpclattice.kotlin.ServiceNetworkVpcAssociation.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.vpclattice.kotlin

import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.vpclattice.kotlin.enums.ServiceNetworkVpcAssociationStatus
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
import com.pulumi.awsnative.vpclattice.kotlin.enums.ServiceNetworkVpcAssociationStatus.Companion.toKotlin as serviceNetworkVpcAssociationStatusToKotlin

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

    public var args: ServiceNetworkVpcAssociationArgs = ServiceNetworkVpcAssociationArgs()

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

/**
 * Associates a VPC with a service network.
 */
public class ServiceNetworkVpcAssociation internal constructor(
    override val javaResource: com.pulumi.awsnative.vpclattice.ServiceNetworkVpcAssociation,
) : KotlinCustomResource(javaResource, ServiceNetworkVpcAssociationMapper) {
    /**
     * The Amazon Resource Name (ARN) of the association between the service network and the VPC.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * The ID of the specified association between the service network and the VPC.
     */
    public val awsId: Output
        get() = javaResource.awsId().applyValue({ args0 -> args0 })

    /**
     * The date and time that the association was created, specified in ISO-8601 format.
     */
    public val createdAt: Output
        get() = javaResource.createdAt().applyValue({ args0 -> args0 })

    /**
     * The IDs of the security groups. Security groups aren't added by default. You can add a security group to apply network level controls to control which resources in a VPC are allowed to access the service network and its services. For more information, see [Control traffic to resources using security groups](https://docs.aws.amazon.com//vpc/latest/userguide/VPC_SecurityGroups.html) in the *Amazon VPC User Guide* .
     */
    public val securityGroupIds: Output>?
        get() = javaResource.securityGroupIds().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

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

    /**
     * The ID of the service network.
     */
    public val serviceNetworkId: Output
        get() = javaResource.serviceNetworkId().applyValue({ args0 -> args0 })

    /**
     * The ID or Amazon Resource Name (ARN) of the service network. You must use the ARN when the resources specified in the operation are in different accounts.
     */
    public val serviceNetworkIdentifier: Output?
        get() = javaResource.serviceNetworkIdentifier().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name of the service network.
     */
    public val serviceNetworkName: Output
        get() = javaResource.serviceNetworkName().applyValue({ args0 -> args0 })

    /**
     * The status of the association.
     */
    public val status: Output
        get() = javaResource.status().applyValue({ args0 ->
            args0.let({ args0 ->
                serviceNetworkVpcAssociationStatusToKotlin(args0)
            })
        })

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

    /**
     * The ID of the VPC.
     */
    public val vpcId: Output
        get() = javaResource.vpcId().applyValue({ args0 -> args0 })

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

public object ServiceNetworkVpcAssociationMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.vpclattice.ServiceNetworkVpcAssociation::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy