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

com.pulumi.googlenative.compute.v1.kotlin.ServiceAttachment.kt Maven / Gradle / Ivy

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

package com.pulumi.googlenative.compute.v1.kotlin

import com.pulumi.core.Output
import com.pulumi.googlenative.compute.v1.kotlin.outputs.ServiceAttachmentConnectedEndpointResponse
import com.pulumi.googlenative.compute.v1.kotlin.outputs.ServiceAttachmentConsumerProjectLimitResponse
import com.pulumi.googlenative.compute.v1.kotlin.outputs.Uint128Response
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.googlenative.compute.v1.kotlin.outputs.ServiceAttachmentConnectedEndpointResponse.Companion.toKotlin as serviceAttachmentConnectedEndpointResponseToKotlin
import com.pulumi.googlenative.compute.v1.kotlin.outputs.ServiceAttachmentConsumerProjectLimitResponse.Companion.toKotlin as serviceAttachmentConsumerProjectLimitResponseToKotlin
import com.pulumi.googlenative.compute.v1.kotlin.outputs.Uint128Response.Companion.toKotlin as uint128ResponseToKotlin

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

    public var args: ServiceAttachmentArgs = ServiceAttachmentArgs()

    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 ServiceAttachmentArgsBuilder.() -> Unit) {
        val builder = ServiceAttachmentArgsBuilder()
        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(): ServiceAttachment {
        val builtJavaResource =
            com.pulumi.googlenative.compute.v1.ServiceAttachment(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return ServiceAttachment(builtJavaResource)
    }
}

/**
 * Creates a ServiceAttachment in the specified project in the given scope using the parameters that are included in the request.
 */
public class ServiceAttachment internal constructor(
    override val javaResource: com.pulumi.googlenative.compute.v1.ServiceAttachment,
) : KotlinCustomResource(javaResource, ServiceAttachmentMapper) {
    /**
     * An array of connections for all the consumers connected to this service attachment.
     */
    public val connectedEndpoints: Output>
        get() = javaResource.connectedEndpoints().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> serviceAttachmentConnectedEndpointResponseToKotlin(args0) })
            })
        })

    /**
     * The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules.
     */
    public val connectionPreference: Output
        get() = javaResource.connectionPreference().applyValue({ args0 -> args0 })

    /**
     * Projects that are allowed to connect to this service attachment.
     */
    public val consumerAcceptLists: Output>
        get() = javaResource.consumerAcceptLists().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> serviceAttachmentConsumerProjectLimitResponseToKotlin(args0) })
            })
        })

    /**
     * Projects that are not allowed to connect to this service attachment. The project can be specified using its id or number.
     */
    public val consumerRejectLists: Output>
        get() = javaResource.consumerRejectLists().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * Creation timestamp in RFC3339 text format.
     */
    public val creationTimestamp: Output
        get() = javaResource.creationTimestamp().applyValue({ args0 -> args0 })

    /**
     * An optional description of this resource. Provide this property when you create the resource.
     */
    public val description: Output
        get() = javaResource.description().applyValue({ args0 -> args0 })

    /**
     * If specified, the domain name will be used during the integration between the PSC connected endpoints and the Cloud DNS. For example, this is a valid domain name: "p.mycompany.com.". Current max number of domain names supported is 1.
     */
    public val domainNames: Output>
        get() = javaResource.domainNames().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * If true, enable the proxy protocol which is for supplying client TCP/IP address data in TCP connections that traverse proxies on their way to destination servers.
     */
    public val enableProxyProtocol: Output
        get() = javaResource.enableProxyProtocol().applyValue({ args0 -> args0 })

    /**
     * Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a ServiceAttachment. An up-to-date fingerprint must be provided in order to patch/update the ServiceAttachment; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the ServiceAttachment.
     */
    public val fingerprint: Output
        get() = javaResource.fingerprint().applyValue({ args0 -> args0 })

    /**
     * Type of the resource. Always compute#serviceAttachment for service attachments.
     */
    public val kind: Output
        get() = javaResource.kind().applyValue({ args0 -> args0 })

    /**
     * Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * An array of URLs where each entry is the URL of a subnet provided by the service producer to use for NAT in this service attachment.
     */
    public val natSubnets: Output>
        get() = javaResource.natSubnets().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * The URL of a forwarding rule with loadBalancingScheme INTERNAL* that is serving the endpoint identified by this service attachment.
     */
    public val producerForwardingRule: Output
        get() = javaResource.producerForwardingRule().applyValue({ args0 -> args0 })

    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * An 128-bit global unique ID of the PSC service attachment.
     */
    public val pscServiceAttachmentId: Output
        get() = javaResource.pscServiceAttachmentId().applyValue({ args0 ->
            args0.let({ args0 ->
                uint128ResponseToKotlin(args0)
            })
        })

    /**
     * This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints. - If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified . - If true, update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project is added to the reject list. For newly created service attachment, this boolean defaults to true.
     */
    public val reconcileConnections: Output
        get() = javaResource.reconcileConnections().applyValue({ args0 -> args0 })

    public val region: Output
        get() = javaResource.region().applyValue({ args0 -> args0 })

    /**
     * An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
     */
    public val requestId: Output?
        get() = javaResource.requestId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Server-defined URL for the resource.
     */
    public val selfLink: Output
        get() = javaResource.selfLink().applyValue({ args0 -> args0 })

    /**
     * The URL of a service serving the endpoint identified by this service attachment.
     */
    public val targetService: Output
        get() = javaResource.targetService().applyValue({ args0 -> args0 })
}

public object ServiceAttachmentMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.compute.v1.ServiceAttachment::class == javaResource::class

    override fun map(javaResource: Resource): ServiceAttachment = ServiceAttachment(
        javaResource as
            com.pulumi.googlenative.compute.v1.ServiceAttachment,
    )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy