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

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

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

The newest version!
@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.NetworkEndpointGroupAppEngineResponse
import com.pulumi.googlenative.compute.v1.kotlin.outputs.NetworkEndpointGroupCloudFunctionResponse
import com.pulumi.googlenative.compute.v1.kotlin.outputs.NetworkEndpointGroupCloudRunResponse
import com.pulumi.googlenative.compute.v1.kotlin.outputs.NetworkEndpointGroupPscDataResponse
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.Map
import com.pulumi.googlenative.compute.v1.kotlin.outputs.NetworkEndpointGroupAppEngineResponse.Companion.toKotlin as networkEndpointGroupAppEngineResponseToKotlin
import com.pulumi.googlenative.compute.v1.kotlin.outputs.NetworkEndpointGroupCloudFunctionResponse.Companion.toKotlin as networkEndpointGroupCloudFunctionResponseToKotlin
import com.pulumi.googlenative.compute.v1.kotlin.outputs.NetworkEndpointGroupCloudRunResponse.Companion.toKotlin as networkEndpointGroupCloudRunResponseToKotlin
import com.pulumi.googlenative.compute.v1.kotlin.outputs.NetworkEndpointGroupPscDataResponse.Companion.toKotlin as networkEndpointGroupPscDataResponseToKotlin

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

    public var args: RegionNetworkEndpointGroupArgs = RegionNetworkEndpointGroupArgs()

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

/**
 * Creates a network endpoint group in the specified project using the parameters that are included in the request.
 */
public class RegionNetworkEndpointGroup internal constructor(
    override val javaResource: com.pulumi.googlenative.compute.v1.RegionNetworkEndpointGroup,
) : KotlinCustomResource(javaResource, RegionNetworkEndpointGroupMapper) {
    /**
     * Metadata defined as annotations on the network endpoint group.
     */
    public val annotations: Output>
        get() = javaResource.annotations().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * Only valid when networkEndpointType is "SERVERLESS". Only one of cloudRun, appEngine or cloudFunction may be set.
     */
    public val appEngine: Output
        get() = javaResource.appEngine().applyValue({ args0 ->
            args0.let({ args0 ->
                networkEndpointGroupAppEngineResponseToKotlin(args0)
            })
        })

    /**
     * Only valid when networkEndpointType is "SERVERLESS". Only one of cloudRun, appEngine or cloudFunction may be set.
     */
    public val cloudFunction: Output
        get() = javaResource.cloudFunction().applyValue({ args0 ->
            args0.let({ args0 ->
                networkEndpointGroupCloudFunctionResponseToKotlin(args0)
            })
        })

    /**
     * Only valid when networkEndpointType is "SERVERLESS". Only one of cloudRun, appEngine or cloudFunction may be set.
     */
    public val cloudRun: Output
        get() = javaResource.cloudRun().applyValue({ args0 ->
            args0.let({ args0 ->
                networkEndpointGroupCloudRunResponseToKotlin(args0)
            })
        })

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

    /**
     * The default port used if the port number is not specified in the network endpoint.
     */
    public val defaultPort: Output
        get() = javaResource.defaultPort().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 })

    /**
     * Type of the resource. Always compute#networkEndpointGroup for network endpoint group.
     */
    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 })

    /**
     * The URL of the network to which all network endpoints in the NEG belong. Uses "default" project network if unspecified.
     */
    public val network: Output
        get() = javaResource.network().applyValue({ args0 -> args0 })

    /**
     * Type of network endpoints in this network endpoint group. Can be one of GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_FQDN_PORT, INTERNET_IP_PORT, SERVERLESS, PRIVATE_SERVICE_CONNECT.
     */
    public val networkEndpointType: Output
        get() = javaResource.networkEndpointType().applyValue({ args0 -> args0 })

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

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

    /**
     * The target service url used to set up private service connection to a Google API or a PSC Producer Service Attachment. An example value is: "asia-northeast3-cloudkms.googleapis.com"
     */
    public val pscTargetService: Output
        get() = javaResource.pscTargetService().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 })

    /**
     * [Output only] Number of network endpoints in the network endpoint group.
     */
    public val size: Output
        get() = javaResource.size().applyValue({ args0 -> args0 })

    /**
     * Optional URL of the subnetwork to which all network endpoints in the NEG belong.
     */
    public val subnetwork: Output
        get() = javaResource.subnetwork().applyValue({ args0 -> args0 })

    /**
     * The URL of the zone where the network endpoint group is located.
     */
    public val zone: Output
        get() = javaResource.zone().applyValue({ args0 -> args0 })
}

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy