// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS Key Management Service */ export interface KmsKeyConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_key.html#bypass_policy_lockout_safety_check KmsKey#bypass_policy_lockout_safety_check} */ readonly bypassPolicyLockoutSafetyCheck?: boolean | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_key.html#customer_master_key_spec KmsKey#customer_master_key_spec} */ readonly customerMasterKeySpec?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_key.html#deletion_window_in_days KmsKey#deletion_window_in_days} */ readonly deletionWindowInDays?: number; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_key.html#description KmsKey#description} */ readonly description?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_key.html#enable_key_rotation KmsKey#enable_key_rotation} */ readonly enableKeyRotation?: boolean | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_key.html#is_enabled KmsKey#is_enabled} */ readonly isEnabled?: boolean | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_key.html#key_usage KmsKey#key_usage} */ readonly keyUsage?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_key.html#multi_region KmsKey#multi_region} */ readonly multiRegion?: boolean | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_key.html#policy KmsKey#policy} */ readonly policy?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_key.html#tags KmsKey#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/kms_key.html#tags_all KmsKey#tags_all} */ readonly tagsAll?: { [key: string]: string } | cdktf.IResolvable; } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/kms_key.html aws_kms_key} */ export class KmsKey extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_kms_key"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/kms_key.html aws_kms_key} 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 KmsKeyConfig = {} */ public constructor(scope: Construct, id: string, config: KmsKeyConfig = {}) { super(scope, id, { terraformResourceType: 'aws_kms_key', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._bypassPolicyLockoutSafetyCheck = config.bypassPolicyLockoutSafetyCheck; this._customerMasterKeySpec = config.customerMasterKeySpec; this._deletionWindowInDays = config.deletionWindowInDays; this._description = config.description; this._enableKeyRotation = config.enableKeyRotation; this._isEnabled = config.isEnabled; this._keyUsage = config.keyUsage; this._multiRegion = config.multiRegion; this._policy = config.policy; this._tags = config.tags; this._tagsAll = config.tagsAll; } // ========== // ATTRIBUTES // ========== // arn - computed: true, optional: false, required: false public get arn() { return this.getStringAttribute('arn'); } // bypass_policy_lockout_safety_check - computed: false, optional: true, required: false private _bypassPolicyLockoutSafetyCheck?: boolean | cdktf.IResolvable; public get bypassPolicyLockoutSafetyCheck() { return this.getBooleanAttribute('bypass_policy_lockout_safety_check') as any; } public set bypassPolicyLockoutSafetyCheck(value: boolean | cdktf.IResolvable) { this._bypassPolicyLockoutSafetyCheck = value; } public resetBypassPolicyLockoutSafetyCheck() { this._bypassPolicyLockoutSafetyCheck = undefined; } // Temporarily expose input value. Use with caution. public get bypassPolicyLockoutSafetyCheckInput() { return this._bypassPolicyLockoutSafetyCheck; } // customer_master_key_spec - computed: false, optional: true, required: false private _customerMasterKeySpec?: string; public get customerMasterKeySpec() { return this.getStringAttribute('customer_master_key_spec'); } public set customerMasterKeySpec(value: string) { this._customerMasterKeySpec = value; } public resetCustomerMasterKeySpec() { this._customerMasterKeySpec = undefined; } // Temporarily expose input value. Use with caution. public get customerMasterKeySpecInput() { return this._customerMasterKeySpec; } // deletion_window_in_days - computed: false, optional: true, required: false private _deletionWindowInDays?: number; public get deletionWindowInDays() { return this.getNumberAttribute('deletion_window_in_days'); } public set deletionWindowInDays(value: number) { this._deletionWindowInDays = value; } public resetDeletionWindowInDays() { this._deletionWindowInDays = undefined; } // Temporarily expose input value. Use with caution. public get deletionWindowInDaysInput() { return this._deletionWindowInDays; } // description - computed: true, optional: true, required: false private _description?: string; public get description() { return this.getStringAttribute('description'); } public set description(value: string) { this._description = value; } public resetDescription() { this._description = undefined; } // Temporarily expose input value. Use with caution. public get descriptionInput() { return this._description; } // enable_key_rotation - computed: false, optional: true, required: false private _enableKeyRotation?: boolean | cdktf.IResolvable; public get enableKeyRotation() { return this.getBooleanAttribute('enable_key_rotation') as any; } public set enableKeyRotation(value: boolean | cdktf.IResolvable) { this._enableKeyRotation = value; } public resetEnableKeyRotation() { this._enableKeyRotation = undefined; } // Temporarily expose input value. Use with caution. public get enableKeyRotationInput() { return this._enableKeyRotation; } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // is_enabled - computed: false, optional: true, required: false private _isEnabled?: boolean | cdktf.IResolvable; public get isEnabled() { return this.getBooleanAttribute('is_enabled') as any; } public set isEnabled(value: boolean | cdktf.IResolvable) { this._isEnabled = value; } public resetIsEnabled() { this._isEnabled = undefined; } // Temporarily expose input value. Use with caution. public get isEnabledInput() { return this._isEnabled; } // key_id - computed: true, optional: false, required: false public get keyId() { return this.getStringAttribute('key_id'); } // key_usage - computed: false, optional: true, required: false private _keyUsage?: string; public get keyUsage() { return this.getStringAttribute('key_usage'); } public set keyUsage(value: string) { this._keyUsage = value; } public resetKeyUsage() { this._keyUsage = undefined; } // Temporarily expose input value. Use with caution. public get keyUsageInput() { return this._keyUsage; } // multi_region - computed: true, optional: true, required: false private _multiRegion?: boolean | cdktf.IResolvable; public get multiRegion() { return this.getBooleanAttribute('multi_region') as any; } public set multiRegion(value: boolean | cdktf.IResolvable) { this._multiRegion = value; } public resetMultiRegion() { this._multiRegion = undefined; } // Temporarily expose input value. Use with caution. public get multiRegionInput() { return this._multiRegion; } // policy - computed: true, optional: true, required: false private _policy?: string; public get policy() { return this.getStringAttribute('policy'); } public set policy(value: string) { this._policy = value; } public resetPolicy() { this._policy = undefined; } // Temporarily expose input value. Use with caution. public get policyInput() { return this._policy; } // tags - computed: false, optional: true, required: false private _tags?: { [key: string]: string } | cdktf.IResolvable; public get tags() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('tags') as any; } public set tags(value: { [key: string]: string } | cdktf.IResolvable) { this._tags = value; } public resetTags() { this._tags = undefined; } // Temporarily expose input value. Use with caution. public get tagsInput() { return this._tags; } // tags_all - computed: true, optional: true, required: false private _tagsAll?: { [key: string]: string } | cdktf.IResolvable; public get tagsAll() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('tags_all') as any; } public set tagsAll(value: { [key: string]: string } | cdktf.IResolvable) { this._tagsAll = value; } public resetTagsAll() { this._tagsAll = undefined; } // Temporarily expose input value. Use with caution. public get tagsAllInput() { return this._tagsAll; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { bypass_policy_lockout_safety_check: cdktf.booleanToTerraform(this._bypassPolicyLockoutSafetyCheck), customer_master_key_spec: cdktf.stringToTerraform(this._customerMasterKeySpec), deletion_window_in_days: cdktf.numberToTerraform(this._deletionWindowInDays), description: cdktf.stringToTerraform(this._description), enable_key_rotation: cdktf.booleanToTerraform(this._enableKeyRotation), is_enabled: cdktf.booleanToTerraform(this._isEnabled), key_usage: cdktf.stringToTerraform(this._keyUsage), multi_region: cdktf.booleanToTerraform(this._multiRegion), policy: cdktf.stringToTerraform(this._policy), tags: cdktf.hashMapper(cdktf.anyToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.anyToTerraform)(this._tagsAll), }; } }