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

com.pulumi.googlenative.gkehub.v1.kotlin.Membership.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.gkehub.v1.kotlin

import com.pulumi.core.Output
import com.pulumi.googlenative.gkehub.v1.kotlin.outputs.AuthorityResponse
import com.pulumi.googlenative.gkehub.v1.kotlin.outputs.MembershipEndpointResponse
import com.pulumi.googlenative.gkehub.v1.kotlin.outputs.MembershipStateResponse
import com.pulumi.googlenative.gkehub.v1.kotlin.outputs.MonitoringConfigResponse
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.Map
import com.pulumi.googlenative.gkehub.v1.kotlin.outputs.AuthorityResponse.Companion.toKotlin as authorityResponseToKotlin
import com.pulumi.googlenative.gkehub.v1.kotlin.outputs.MembershipEndpointResponse.Companion.toKotlin as membershipEndpointResponseToKotlin
import com.pulumi.googlenative.gkehub.v1.kotlin.outputs.MembershipStateResponse.Companion.toKotlin as membershipStateResponseToKotlin
import com.pulumi.googlenative.gkehub.v1.kotlin.outputs.MonitoringConfigResponse.Companion.toKotlin as monitoringConfigResponseToKotlin

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

    public var args: MembershipArgs = MembershipArgs()

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

/**
 * Creates a new Membership. **This is currently only supported for GKE clusters on Google Cloud**. To register other clusters, follow the instructions at https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster.
 * Auto-naming is currently not supported for this resource.
 */
public class Membership internal constructor(
    override val javaResource: com.pulumi.googlenative.gkehub.v1.Membership,
) : KotlinCustomResource(javaResource, MembershipMapper) {
    /**
     * Optional. How to identify workloads from this Membership. See the documentation on Workload Identity for more details: https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
     */
    public val authority: Output
        get() = javaResource.authority().applyValue({ args0 ->
            args0.let({ args0 ->
                authorityResponseToKotlin(args0)
            })
        })

    /**
     * When the Membership was created.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * When the Membership was deleted.
     */
    public val deleteTime: Output
        get() = javaResource.deleteTime().applyValue({ args0 -> args0 })

    /**
     * Description of this membership, limited to 63 characters. Must match the regex: `a-zA-Z0-9*` This field is present for legacy purposes.
     */
    public val description: Output
        get() = javaResource.description().applyValue({ args0 -> args0 })

    /**
     * Optional. Endpoint information to reach this member.
     */
    public val endpoint: Output
        get() = javaResource.endpoint().applyValue({ args0 ->
            args0.let({ args0 ->
                membershipEndpointResponseToKotlin(args0)
            })
        })

    /**
     * Optional. An externally-generated and managed ID for this Membership. This ID may be modified after creation, but this is not recommended. The ID must match the regex: `a-zA-Z0-9*` If this Membership represents a Kubernetes cluster, this value should be set to the UID of the `kube-system` namespace object.
     */
    public val externalId: Output
        get() = javaResource.externalId().applyValue({ args0 -> args0 })

    /**
     * Optional. Labels for this membership.
     */
    public val labels: Output>
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * For clusters using Connect, the timestamp of the most recent connection established with Google Cloud. This time is updated every several minutes, not continuously. For clusters that do not use GKE Connect, or that have never connected successfully, this field will be unset.
     */
    public val lastConnectionTime: Output
        get() = javaResource.lastConnectionTime().applyValue({ args0 -> args0 })

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

    /**
     * Required. Client chosen ID for the membership. `membership_id` must be a valid RFC 1123 compliant DNS label: 1. At most 63 characters in length 2. It must consist of lower case alphanumeric characters or `-` 3. It must start and end with an alphanumeric character Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, with a maximum length of 63 characters.
     */
    public val membershipId: Output
        get() = javaResource.membershipId().applyValue({ args0 -> args0 })

    /**
     * Optional. The monitoring config information for this membership.
     */
    public val monitoringConfig: Output
        get() = javaResource.monitoringConfig().applyValue({ args0 ->
            args0.let({ args0 ->
                monitoringConfigResponseToKotlin(args0)
            })
        })

    /**
     * The full, unique name of this Membership resource in the format `projects/*/locations/*/memberships/{membership_id}`, set during creation. `membership_id` must be a valid RFC 1123 compliant DNS label: 1. At most 63 characters in length 2. It must consist of lower case alphanumeric characters or `-` 3. It must start and end with an alphanumeric character Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, with a maximum length of 63 characters.
     * */*/
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

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

    /**
     * Optional. A 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. The server will guarantee that for at least 60 minutes after the first request. 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) })

    /**
     * State of the Membership resource.
     */
    public val state: Output
        get() = javaResource.state().applyValue({ args0 ->
            args0.let({ args0 ->
                membershipStateResponseToKotlin(args0)
            })
        })

    /**
     * Google-generated UUID for this resource. This is unique across all Membership resources. If a Membership resource is deleted and another resource with the same name is created, it gets a different unique_id.
     */
    public val uniqueId: Output
        get() = javaResource.uniqueId().applyValue({ args0 -> args0 })

    /**
     * When the Membership was last updated.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object MembershipMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.gkehub.v1.Membership::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy