com.pulumi.gcp.endpoints.kotlin.ConsumersIamPolicyArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.endpoints.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.endpoints.ConsumersIamPolicyArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Three different resources help you manage your IAM policy for Cloud Endpoints ServiceConsumers. Each of these resources serves a different use case:
* * `gcp.endpoints.ConsumersIamPolicy`: Authoritative. Sets the IAM policy for the serviceconsumers and replaces any existing policy already attached.
* * `gcp.endpoints.ConsumersIamBinding`: Authoritative for a given role. Updates the IAM policy to grant a role to a list of members. Other roles within the IAM policy for the serviceconsumers are preserved.
* * `gcp.endpoints.ConsumersIamMember`: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the serviceconsumers are preserved.
* A data source can be used to retrieve policy data in advent you do not need creation
* * `gcp.endpoints.ConsumersIamPolicy`: Retrieves the IAM policy for the serviceconsumers
* > **Note:** `gcp.endpoints.ConsumersIamPolicy` **cannot** be used in conjunction with `gcp.endpoints.ConsumersIamBinding` and `gcp.endpoints.ConsumersIamMember` or they will fight over what your policy should be.
* > **Note:** `gcp.endpoints.ConsumersIamBinding` resources **can be** used in conjunction with `gcp.endpoints.ConsumersIamMember` resources **only if** they do not grant privilege to the same role.
* ## Import
* For all import syntaxes, the "resource in question" can take any of the following forms:
* * services/{{service_name}}/consumers/{{consumer_project}}
* * {{service_name}}/{{consumer_project}}
* * {{consumer_project}}
* Any variables not passed in the import command will be taken from the provider configuration.
* Cloud Endpoints serviceconsumers IAM resources can be imported using the resource identifiers, role, and member.
* IAM member imports use space-delimited identifiers: the resource in question, the role, and the member identity, e.g.
* ```sh
* $ pulumi import gcp:endpoints/consumersIamPolicy:ConsumersIamPolicy editor "services/{{service_name}}/consumers/{{consumer_project}} roles/servicemanagement.serviceController user:[email protected]"
* ```
* IAM binding imports use space-delimited identifiers: the resource in question and the role, e.g.
* ```sh
* $ pulumi import gcp:endpoints/consumersIamPolicy:ConsumersIamPolicy editor "services/{{service_name}}/consumers/{{consumer_project}} roles/servicemanagement.serviceController"
* ```
* IAM policy imports use the identifier of the resource in question, e.g.
* ```sh
* $ pulumi import gcp:endpoints/consumersIamPolicy:ConsumersIamPolicy editor services/{{service_name}}/consumers/{{consumer_project}}
* ```
* -> **Custom Roles**: If you're importing a IAM resource with a custom role, make sure to use the
* full name of the custom role, e.g. `[projects/my-project|organizations/my-org]/roles/my-custom-role`.
* @property consumerProject
* @property policyData The policy data generated by
* a `gcp.organizations.getIAMPolicy` data source.
* @property serviceName
*/
public data class ConsumersIamPolicyArgs(
public val consumerProject: Output? = null,
public val policyData: Output? = null,
public val serviceName: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.endpoints.ConsumersIamPolicyArgs =
com.pulumi.gcp.endpoints.ConsumersIamPolicyArgs.builder()
.consumerProject(consumerProject?.applyValue({ args0 -> args0 }))
.policyData(policyData?.applyValue({ args0 -> args0 }))
.serviceName(serviceName?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [ConsumersIamPolicyArgs].
*/
@PulumiTagMarker
public class ConsumersIamPolicyArgsBuilder internal constructor() {
private var consumerProject: Output? = null
private var policyData: Output? = null
private var serviceName: Output? = null
/**
* @param value
*/
@JvmName("glrpbmlevfbkrvxv")
public suspend fun consumerProject(`value`: Output) {
this.consumerProject = value
}
/**
* @param value The policy data generated by
* a `gcp.organizations.getIAMPolicy` data source.
*/
@JvmName("xtmsyovqxasrvygt")
public suspend fun policyData(`value`: Output) {
this.policyData = value
}
/**
* @param value
*/
@JvmName("lvfbvwagcbooivdk")
public suspend fun serviceName(`value`: Output) {
this.serviceName = value
}
/**
* @param value
*/
@JvmName("ubussdvegcupkkdm")
public suspend fun consumerProject(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.consumerProject = mapped
}
/**
* @param value The policy data generated by
* a `gcp.organizations.getIAMPolicy` data source.
*/
@JvmName("qmkwtsjywjbsdpcc")
public suspend fun policyData(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.policyData = mapped
}
/**
* @param value
*/
@JvmName("wumcliovgxiiatwv")
public suspend fun serviceName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.serviceName = mapped
}
internal fun build(): ConsumersIamPolicyArgs = ConsumersIamPolicyArgs(
consumerProject = consumerProject,
policyData = policyData,
serviceName = serviceName,
)
}