// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS Key Management Service */ export interface KmsGrantConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_grant.html#grant_creation_tokens KmsGrant#grant_creation_tokens} */ readonly grantCreationTokens?: string[]; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_grant.html#grantee_principal KmsGrant#grantee_principal} */ readonly granteePrincipal: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_grant.html#key_id KmsGrant#key_id} */ readonly keyId: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_grant.html#name KmsGrant#name} */ readonly name?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_grant.html#operations KmsGrant#operations} */ readonly operations: string[]; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_grant.html#retire_on_delete KmsGrant#retire_on_delete} */ readonly retireOnDelete?: boolean | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_grant.html#retiring_principal KmsGrant#retiring_principal} */ readonly retiringPrincipal?: string; /** * constraints block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_grant.html#constraints KmsGrant#constraints} */ readonly constraints?: KmsGrantConstraints[]; } export interface KmsGrantConstraints { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_grant.html#encryption_context_equals KmsGrant#encryption_context_equals} */ readonly encryptionContextEquals?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_grant.html#encryption_context_subset KmsGrant#encryption_context_subset} */ readonly encryptionContextSubset?: { [key: string]: string } | cdktf.IResolvable; } export function kmsGrantConstraintsToTerraform(struct?: KmsGrantConstraints): any { if (!cdktf.canInspect(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } return { encryption_context_equals: cdktf.hashMapper(cdktf.anyToTerraform)(struct!.encryptionContextEquals), encryption_context_subset: cdktf.hashMapper(cdktf.anyToTerraform)(struct!.encryptionContextSubset), } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/kms_grant.html aws_kms_grant} */ export class KmsGrant extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_kms_grant"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/kms_grant.html aws_kms_grant} Resource * * @param scope The scope in which to define this construct * @param id The scoped construct ID. Must be unique amongst siblings in the same scope * @param options KmsGrantConfig */ public constructor(scope: Construct, id: string, config: KmsGrantConfig) { super(scope, id, { terraformResourceType: 'aws_kms_grant', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._grantCreationTokens = config.grantCreationTokens; this._granteePrincipal = config.granteePrincipal; this._keyId = config.keyId; this._name = config.name; this._operations = config.operations; this._retireOnDelete = config.retireOnDelete; this._retiringPrincipal = config.retiringPrincipal; this._constraints = config.constraints; } // ========== // ATTRIBUTES // ========== // grant_creation_tokens - computed: false, optional: true, required: false private _grantCreationTokens?: string[]; public get grantCreationTokens() { return this.getListAttribute('grant_creation_tokens'); } public set grantCreationTokens(value: string[]) { this._grantCreationTokens = value; } public resetGrantCreationTokens() { this._grantCreationTokens = undefined; } // Temporarily expose input value. Use with caution. public get grantCreationTokensInput() { return this._grantCreationTokens; } // grant_id - computed: true, optional: false, required: false public get grantId() { return this.getStringAttribute('grant_id'); } // grant_token - computed: true, optional: false, required: false public get grantToken() { return this.getStringAttribute('grant_token'); } // grantee_principal - computed: false, optional: false, required: true private _granteePrincipal?: string; public get granteePrincipal() { return this.getStringAttribute('grantee_principal'); } public set granteePrincipal(value: string) { this._granteePrincipal = value; } // Temporarily expose input value. Use with caution. public get granteePrincipalInput() { return this._granteePrincipal; } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // key_id - computed: false, optional: false, required: true private _keyId?: string; public get keyId() { return this.getStringAttribute('key_id'); } public set keyId(value: string) { this._keyId = value; } // Temporarily expose input value. Use with caution. public get keyIdInput() { return this._keyId; } // name - computed: false, optional: true, required: false private _name?: string; public get name() { return this.getStringAttribute('name'); } public set name(value: string) { this._name = value; } public resetName() { this._name = undefined; } // Temporarily expose input value. Use with caution. public get nameInput() { return this._name; } // operations - computed: false, optional: false, required: true private _operations?: string[]; public get operations() { return this.getListAttribute('operations'); } public set operations(value: string[]) { this._operations = value; } // Temporarily expose input value. Use with caution. public get operationsInput() { return this._operations; } // retire_on_delete - computed: false, optional: true, required: false private _retireOnDelete?: boolean | cdktf.IResolvable; public get retireOnDelete() { return this.getBooleanAttribute('retire_on_delete') as any; } public set retireOnDelete(value: boolean | cdktf.IResolvable) { this._retireOnDelete = value; } public resetRetireOnDelete() { this._retireOnDelete = undefined; } // Temporarily expose input value. Use with caution. public get retireOnDeleteInput() { return this._retireOnDelete; } // retiring_principal - computed: false, optional: true, required: false private _retiringPrincipal?: string; public get retiringPrincipal() { return this.getStringAttribute('retiring_principal'); } public set retiringPrincipal(value: string) { this._retiringPrincipal = value; } public resetRetiringPrincipal() { this._retiringPrincipal = undefined; } // Temporarily expose input value. Use with caution. public get retiringPrincipalInput() { return this._retiringPrincipal; } // constraints - computed: false, optional: true, required: false private _constraints?: KmsGrantConstraints[]; public get constraints() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('constraints') as any; } public set constraints(value: KmsGrantConstraints[]) { this._constraints = value; } public resetConstraints() { this._constraints = undefined; } // Temporarily expose input value. Use with caution. public get constraintsInput() { return this._constraints; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { grant_creation_tokens: cdktf.listMapper(cdktf.stringToTerraform)(this._grantCreationTokens), grantee_principal: cdktf.stringToTerraform(this._granteePrincipal), key_id: cdktf.stringToTerraform(this._keyId), name: cdktf.stringToTerraform(this._name), operations: cdktf.listMapper(cdktf.stringToTerraform)(this._operations), retire_on_delete: cdktf.booleanToTerraform(this._retireOnDelete), retiring_principal: cdktf.stringToTerraform(this._retiringPrincipal), constraints: cdktf.listMapper(kmsGrantConstraintsToTerraform)(this._constraints), }; } }