// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS Relational Database Service */ export interface DbSnapshotConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_snapshot.html#db_instance_identifier DbSnapshot#db_instance_identifier} */ readonly dbInstanceIdentifier: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_snapshot.html#db_snapshot_identifier DbSnapshot#db_snapshot_identifier} */ readonly dbSnapshotIdentifier: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_snapshot.html#tags DbSnapshot#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_snapshot.html#tags_all DbSnapshot#tags_all} */ readonly tagsAll?: { [key: string]: string } | cdktf.IResolvable; /** * timeouts block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_snapshot.html#timeouts DbSnapshot#timeouts} */ readonly timeouts?: DbSnapshotTimeouts; } export interface DbSnapshotTimeouts { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_snapshot.html#read DbSnapshot#read} */ readonly read?: string; } export function dbSnapshotTimeoutsToTerraform(struct?: DbSnapshotTimeoutsOutputReference | DbSnapshotTimeouts): 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 { read: cdktf.stringToTerraform(struct!.read), } } export class DbSnapshotTimeoutsOutputReference extends cdktf.ComplexObject { private isEmptyObject = false; /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param isSingleItem True if this is a block, false if it's a list */ public constructor(terraformResource: cdktf.ITerraformResource, terraformAttribute: string, isSingleItem: boolean) { super(terraformResource, terraformAttribute, isSingleItem); } public get internalValue(): DbSnapshotTimeouts | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._read !== undefined) { hasAnyValues = true; internalValueResult.read = this._read; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: DbSnapshotTimeouts | undefined) { if (value === undefined) { this.isEmptyObject = false; this._read = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._read = value.read; } } // read - computed: false, optional: true, required: false private _read?: string; public get read() { return this.getStringAttribute('read'); } public set read(value: string) { this._read = value; } public resetRead() { this._read = undefined; } // Temporarily expose input value. Use with caution. public get readInput() { return this._read; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/db_snapshot.html aws_db_snapshot} */ export class DbSnapshot extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_db_snapshot"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/db_snapshot.html aws_db_snapshot} 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 DbSnapshotConfig */ public constructor(scope: Construct, id: string, config: DbSnapshotConfig) { super(scope, id, { terraformResourceType: 'aws_db_snapshot', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._dbInstanceIdentifier = config.dbInstanceIdentifier; this._dbSnapshotIdentifier = config.dbSnapshotIdentifier; this._tags = config.tags; this._tagsAll = config.tagsAll; this._timeouts.internalValue = config.timeouts; } // ========== // ATTRIBUTES // ========== // allocated_storage - computed: true, optional: false, required: false public get allocatedStorage() { return this.getNumberAttribute('allocated_storage'); } // availability_zone - computed: true, optional: false, required: false public get availabilityZone() { return this.getStringAttribute('availability_zone'); } // db_instance_identifier - computed: false, optional: false, required: true private _dbInstanceIdentifier?: string; public get dbInstanceIdentifier() { return this.getStringAttribute('db_instance_identifier'); } public set dbInstanceIdentifier(value: string) { this._dbInstanceIdentifier = value; } // Temporarily expose input value. Use with caution. public get dbInstanceIdentifierInput() { return this._dbInstanceIdentifier; } // db_snapshot_arn - computed: true, optional: false, required: false public get dbSnapshotArn() { return this.getStringAttribute('db_snapshot_arn'); } // db_snapshot_identifier - computed: false, optional: false, required: true private _dbSnapshotIdentifier?: string; public get dbSnapshotIdentifier() { return this.getStringAttribute('db_snapshot_identifier'); } public set dbSnapshotIdentifier(value: string) { this._dbSnapshotIdentifier = value; } // Temporarily expose input value. Use with caution. public get dbSnapshotIdentifierInput() { return this._dbSnapshotIdentifier; } // encrypted - computed: true, optional: false, required: false public get encrypted() { return this.getBooleanAttribute('encrypted') as any; } // engine - computed: true, optional: false, required: false public get engine() { return this.getStringAttribute('engine'); } // engine_version - computed: true, optional: false, required: false public get engineVersion() { return this.getStringAttribute('engine_version'); } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // iops - computed: true, optional: false, required: false public get iops() { return this.getNumberAttribute('iops'); } // kms_key_id - computed: true, optional: false, required: false public get kmsKeyId() { return this.getStringAttribute('kms_key_id'); } // license_model - computed: true, optional: false, required: false public get licenseModel() { return this.getStringAttribute('license_model'); } // option_group_name - computed: true, optional: false, required: false public get optionGroupName() { return this.getStringAttribute('option_group_name'); } // port - computed: true, optional: false, required: false public get port() { return this.getNumberAttribute('port'); } // snapshot_type - computed: true, optional: false, required: false public get snapshotType() { return this.getStringAttribute('snapshot_type'); } // source_db_snapshot_identifier - computed: true, optional: false, required: false public get sourceDbSnapshotIdentifier() { return this.getStringAttribute('source_db_snapshot_identifier'); } // source_region - computed: true, optional: false, required: false public get sourceRegion() { return this.getStringAttribute('source_region'); } // status - computed: true, optional: false, required: false public get status() { return this.getStringAttribute('status'); } // storage_type - computed: true, optional: false, required: false public get storageType() { return this.getStringAttribute('storage_type'); } // 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; } // vpc_id - computed: true, optional: false, required: false public get vpcId() { return this.getStringAttribute('vpc_id'); } // timeouts - computed: false, optional: true, required: false private _timeouts = new DbSnapshotTimeoutsOutputReference(this as any, "timeouts", true); public get timeouts() { return this._timeouts; } public putTimeouts(value: DbSnapshotTimeouts) { this._timeouts.internalValue = value; } public resetTimeouts() { this._timeouts.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get timeoutsInput() { return this._timeouts.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { db_instance_identifier: cdktf.stringToTerraform(this._dbInstanceIdentifier), db_snapshot_identifier: cdktf.stringToTerraform(this._dbSnapshotIdentifier), tags: cdktf.hashMapper(cdktf.anyToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.anyToTerraform)(this._tagsAll), timeouts: dbSnapshotTimeoutsToTerraform(this._timeouts.internalValue), }; } }