// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS EC2 */ export interface KeyPairConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/key_pair.html#key_name KeyPair#key_name} */ readonly keyName?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/key_pair.html#key_name_prefix KeyPair#key_name_prefix} */ readonly keyNamePrefix?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/key_pair.html#public_key KeyPair#public_key} */ readonly publicKey: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/key_pair.html#tags KeyPair#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/key_pair.html#tags_all KeyPair#tags_all} */ readonly tagsAll?: { [key: string]: string } | cdktf.IResolvable; } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/key_pair.html aws_key_pair} */ export class KeyPair extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_key_pair"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/key_pair.html aws_key_pair} 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 KeyPairConfig */ public constructor(scope: Construct, id: string, config: KeyPairConfig) { super(scope, id, { terraformResourceType: 'aws_key_pair', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._keyName = config.keyName; this._keyNamePrefix = config.keyNamePrefix; this._publicKey = config.publicKey; this._tags = config.tags; this._tagsAll = config.tagsAll; } // ========== // ATTRIBUTES // ========== // arn - computed: true, optional: false, required: false public get arn() { return this.getStringAttribute('arn'); } // fingerprint - computed: true, optional: false, required: false public get fingerprint() { return this.getStringAttribute('fingerprint'); } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // key_name - computed: true, optional: true, required: false private _keyName?: string; public get keyName() { return this.getStringAttribute('key_name'); } public set keyName(value: string) { this._keyName = value; } public resetKeyName() { this._keyName = undefined; } // Temporarily expose input value. Use with caution. public get keyNameInput() { return this._keyName; } // key_name_prefix - computed: true, optional: true, required: false private _keyNamePrefix?: string; public get keyNamePrefix() { return this.getStringAttribute('key_name_prefix'); } public set keyNamePrefix(value: string) { this._keyNamePrefix = value; } public resetKeyNamePrefix() { this._keyNamePrefix = undefined; } // Temporarily expose input value. Use with caution. public get keyNamePrefixInput() { return this._keyNamePrefix; } // key_pair_id - computed: true, optional: false, required: false public get keyPairId() { return this.getStringAttribute('key_pair_id'); } // public_key - computed: false, optional: false, required: true private _publicKey?: string; public get publicKey() { return this.getStringAttribute('public_key'); } public set publicKey(value: string) { this._publicKey = value; } // Temporarily expose input value. Use with caution. public get publicKeyInput() { return this._publicKey; } // 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 { key_name: cdktf.stringToTerraform(this._keyName), key_name_prefix: cdktf.stringToTerraform(this._keyNamePrefix), public_key: cdktf.stringToTerraform(this._publicKey), tags: cdktf.hashMapper(cdktf.anyToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.anyToTerraform)(this._tagsAll), }; } }