Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.kms.kotlin
import com.pulumi.aws.kms.GrantArgs.builder
import com.pulumi.aws.kms.kotlin.inputs.GrantConstraintArgs
import com.pulumi.aws.kms.kotlin.inputs.GrantConstraintArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Provides a resource-based access control mechanism for a KMS customer master key.
* > **Note:** All arguments including the grant token will be stored in the raw state as plain-text.
* ## Import
* Using `pulumi import`, import KMS Grants using the Key ID and Grant ID separated by a colon (`:`). For example:
* ```sh
* $ pulumi import aws:kms/grant:Grant test 1234abcd-12ab-34cd-56ef-1234567890ab:abcde1237f76e4ba7987489ac329fbfba6ad343d6f7075dbd1ef191f0120514
* ```
* @property constraints A structure that you can use to allow certain operations in the grant only when the desired encryption context is present. For more information about encryption context, see [Encryption Context](http://docs.aws.amazon.com/kms/latest/developerguide/encryption-context.html).
* @property grantCreationTokens A list of grant tokens to be used when creating the grant. See [Grant Tokens](http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) for more information about grant tokens.
* @property granteePrincipal The principal that is given permission to perform the operations that the grant permits in ARN format. Note that due to eventual consistency issues around IAM principals, the providers's state may not always be refreshed to reflect what is true in AWS.
* @property keyId The unique identifier for the customer master key (CMK) that the grant applies to. Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN.
* @property name A friendly name for identifying the grant.
* @property operations A list of operations that the grant permits. The permitted values are: `Decrypt`, `Encrypt`, `GenerateDataKey`, `GenerateDataKeyWithoutPlaintext`, `ReEncryptFrom`, `ReEncryptTo`, `Sign`, `Verify`, `GetPublicKey`, `CreateGrant`, `RetireGrant`, `DescribeKey`, `GenerateDataKeyPair`, or `GenerateDataKeyPairWithoutPlaintext`.
* @property retireOnDelete If set to false (the default) the grants will be revoked upon deletion, and if set to true the grants will try to be retired upon deletion. Note that retiring grants requires special permissions, hence why we default to revoking grants.
* See [RetireGrant](https://docs.aws.amazon.com/kms/latest/APIReference/API_RetireGrant.html) for more information.
* @property retiringPrincipal The principal that is given permission to retire the grant by using RetireGrant operation in ARN format. Note that due to eventual consistency issues around IAM principals, the providers's state may not always be refreshed to reflect what is true in AWS.
*/
public data class GrantArgs(
public val constraints: Output>? = null,
public val grantCreationTokens: Output>? = null,
public val granteePrincipal: Output? = null,
public val keyId: Output? = null,
public val name: Output? = null,
public val operations: Output>? = null,
public val retireOnDelete: Output? = null,
public val retiringPrincipal: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.aws.kms.GrantArgs = com.pulumi.aws.kms.GrantArgs.builder()
.constraints(
constraints?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.grantCreationTokens(grantCreationTokens?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.granteePrincipal(granteePrincipal?.applyValue({ args0 -> args0 }))
.keyId(keyId?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.operations(operations?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.retireOnDelete(retireOnDelete?.applyValue({ args0 -> args0 }))
.retiringPrincipal(retiringPrincipal?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [GrantArgs].
*/
@PulumiTagMarker
public class GrantArgsBuilder internal constructor() {
private var constraints: Output>? = null
private var grantCreationTokens: Output>? = null
private var granteePrincipal: Output? = null
private var keyId: Output? = null
private var name: Output? = null
private var operations: Output>? = null
private var retireOnDelete: Output? = null
private var retiringPrincipal: Output? = null
/**
* @param value A structure that you can use to allow certain operations in the grant only when the desired encryption context is present. For more information about encryption context, see [Encryption Context](http://docs.aws.amazon.com/kms/latest/developerguide/encryption-context.html).
*/
@JvmName("mdaqwluefpmcumiv")
public suspend fun constraints(`value`: Output>) {
this.constraints = value
}
@JvmName("lnclvurwauldmdfx")
public suspend fun constraints(vararg values: Output) {
this.constraints = Output.all(values.asList())
}
/**
* @param values A structure that you can use to allow certain operations in the grant only when the desired encryption context is present. For more information about encryption context, see [Encryption Context](http://docs.aws.amazon.com/kms/latest/developerguide/encryption-context.html).
*/
@JvmName("oubopybryatovygt")
public suspend fun constraints(values: List