// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS Relational Database Service */ export interface DbClusterSnapshotConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_cluster_snapshot.html#db_cluster_identifier DbClusterSnapshot#db_cluster_identifier} */ readonly dbClusterIdentifier: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_cluster_snapshot.html#db_cluster_snapshot_identifier DbClusterSnapshot#db_cluster_snapshot_identifier} */ readonly dbClusterSnapshotIdentifier: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_cluster_snapshot.html#tags DbClusterSnapshot#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_cluster_snapshot.html#tags_all DbClusterSnapshot#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_cluster_snapshot.html#timeouts DbClusterSnapshot#timeouts} */ readonly timeouts?: DbClusterSnapshotTimeouts; } export interface DbClusterSnapshotTimeouts { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_cluster_snapshot.html#create DbClusterSnapshot#create} */ readonly create?: string; } export function dbClusterSnapshotTimeoutsToTerraform(struct?: DbClusterSnapshotTimeoutsOutputReference | DbClusterSnapshotTimeouts): 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 { create: cdktf.stringToTerraform(struct!.create), } } export class DbClusterSnapshotTimeoutsOutputReference 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(): DbClusterSnapshotTimeouts | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._create !== undefined) { hasAnyValues = true; internalValueResult.create = this._create; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: DbClusterSnapshotTimeouts | undefined) { if (value === undefined) { this.isEmptyObject = false; this._create = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._create = value.create; } } // create - computed: false, optional: true, required: false private _create?: string; public get create() { return this.getStringAttribute('create'); } public set create(value: string) { this._create = value; } public resetCreate() { this._create = undefined; } // Temporarily expose input value. Use with caution. public get createInput() { return this._create; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/db_cluster_snapshot.html aws_db_cluster_snapshot} */ export class DbClusterSnapshot extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_db_cluster_snapshot"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/db_cluster_snapshot.html aws_db_cluster_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 DbClusterSnapshotConfig */ public constructor(scope: Construct, id: string, config: DbClusterSnapshotConfig) { super(scope, id, { terraformResourceType: 'aws_db_cluster_snapshot', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._dbClusterIdentifier = config.dbClusterIdentifier; this._dbClusterSnapshotIdentifier = config.dbClusterSnapshotIdentifier; 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_zones - computed: true, optional: false, required: false public get availabilityZones() { return this.getListAttribute('availability_zones'); } // db_cluster_identifier - computed: false, optional: false, required: true private _dbClusterIdentifier?: string; public get dbClusterIdentifier() { return this.getStringAttribute('db_cluster_identifier'); } public set dbClusterIdentifier(value: string) { this._dbClusterIdentifier = value; } // Temporarily expose input value. Use with caution. public get dbClusterIdentifierInput() { return this._dbClusterIdentifier; } // db_cluster_snapshot_arn - computed: true, optional: false, required: false public get dbClusterSnapshotArn() { return this.getStringAttribute('db_cluster_snapshot_arn'); } // db_cluster_snapshot_identifier - computed: false, optional: false, required: true private _dbClusterSnapshotIdentifier?: string; public get dbClusterSnapshotIdentifier() { return this.getStringAttribute('db_cluster_snapshot_identifier'); } public set dbClusterSnapshotIdentifier(value: string) { this._dbClusterSnapshotIdentifier = value; } // Temporarily expose input value. Use with caution. public get dbClusterSnapshotIdentifierInput() { return this._dbClusterSnapshotIdentifier; } // 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'); } // 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'); } // 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_cluster_snapshot_arn - computed: true, optional: false, required: false public get sourceDbClusterSnapshotArn() { return this.getStringAttribute('source_db_cluster_snapshot_arn'); } // status - computed: true, optional: false, required: false public get status() { return this.getStringAttribute('status'); } // storage_encrypted - computed: true, optional: false, required: false public get storageEncrypted() { return this.getBooleanAttribute('storage_encrypted') as any; } // 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 DbClusterSnapshotTimeoutsOutputReference(this as any, "timeouts", true); public get timeouts() { return this._timeouts; } public putTimeouts(value: DbClusterSnapshotTimeouts) { 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_cluster_identifier: cdktf.stringToTerraform(this._dbClusterIdentifier), db_cluster_snapshot_identifier: cdktf.stringToTerraform(this._dbClusterSnapshotIdentifier), tags: cdktf.hashMapper(cdktf.anyToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.anyToTerraform)(this._tagsAll), timeouts: dbClusterSnapshotTimeoutsToTerraform(this._timeouts.internalValue), }; } }