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

com.pulumi.gcp.projects.kotlin.IamMemberRemove.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.

There is a newer version: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.projects.kotlin

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

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

    public var args: IamMemberRemoveArgs = IamMemberRemoveArgs()

    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 IamMemberRemoveArgsBuilder.() -> Unit) {
        val builder = IamMemberRemoveArgsBuilder()
        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(): IamMemberRemove {
        val builtJavaResource = com.pulumi.gcp.projects.IamMemberRemove(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return IamMemberRemove(builtJavaResource)
    }
}

/**
 * Ensures that a member:role pairing does not exist in a project's IAM policy.
 * On create, this resource will modify the policy to remove the `member` from the
 * `role`. If the membership is ever re-added, the next refresh will clear this
 * resource from state, proposing re-adding it to correct the membership. Import is
 * not supported- this resource will acquire the current policy and modify it as
 * part of creating the resource.
 * This resource will conflict with `gcp.projects.IAMPolicy` and
 * `gcp.projects.IAMBinding` resources that share a role, as well as
 * `gcp.projects.IAMMember` resources that target the same membership. When
 * multiple resources conflict the final state is not guaranteed to include or omit
 * the membership. Subsequent `pulumi up` calls will always show a diff
 * until the configuration is corrected.
 * For more information see
 * [the official documentation](https://cloud.google.com/iam/docs/granting-changing-revoking-access)
 * and
 * [API reference](https://cloud.google.com/resource-manager/reference/rest/v1/projects/setIamPolicy).
 */
public class IamMemberRemove internal constructor(
    override val javaResource: com.pulumi.gcp.projects.IamMemberRemove,
) : KotlinCustomResource(javaResource, IamMemberRemoveMapper) {
    /**
     * The IAM principal that should not have the target role.
     * Each entry can have one of the following values:
     * * **user:{emailid}**: An email address that represents a specific Google account. For example, [email protected] or [email protected].
     * * **serviceAccount:{emailid}**: An email address that represents a service account. For example, [email protected].
     * * **group:{emailid}**: An email address that represents a Google group. For example, [email protected].
     * * **domain:{domain}**: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
     */
    public val member: Output
        get() = javaResource.member().applyValue({ args0 -> args0 })

    /**
     * The project id of the target project.
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * The target role that should be removed.
     */
    public val role: Output
        get() = javaResource.role().applyValue({ args0 -> args0 })
}

public object IamMemberRemoveMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.projects.IamMemberRemove::class == javaResource::class

    override fun map(javaResource: Resource): IamMemberRemove = IamMemberRemove(
        javaResource as
            com.pulumi.gcp.projects.IamMemberRemove,
    )
}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy