// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS Relational Database Service */ export interface DbEventSubscriptionConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_event_subscription.html#enabled DbEventSubscription#enabled} */ readonly enabled?: boolean | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_event_subscription.html#event_categories DbEventSubscription#event_categories} */ readonly eventCategories?: string[]; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_event_subscription.html#name DbEventSubscription#name} */ readonly name?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_event_subscription.html#name_prefix DbEventSubscription#name_prefix} */ readonly namePrefix?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_event_subscription.html#sns_topic DbEventSubscription#sns_topic} */ readonly snsTopic: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_event_subscription.html#source_ids DbEventSubscription#source_ids} */ readonly sourceIds?: string[]; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_event_subscription.html#source_type DbEventSubscription#source_type} */ readonly sourceType?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_event_subscription.html#tags DbEventSubscription#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_event_subscription.html#tags_all DbEventSubscription#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_event_subscription.html#timeouts DbEventSubscription#timeouts} */ readonly timeouts?: DbEventSubscriptionTimeouts; } export interface DbEventSubscriptionTimeouts { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_event_subscription.html#create DbEventSubscription#create} */ readonly create?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_event_subscription.html#delete DbEventSubscription#delete} */ readonly delete?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/db_event_subscription.html#update DbEventSubscription#update} */ readonly update?: string; } export function dbEventSubscriptionTimeoutsToTerraform(struct?: DbEventSubscriptionTimeoutsOutputReference | DbEventSubscriptionTimeouts): 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), delete: cdktf.stringToTerraform(struct!.delete), update: cdktf.stringToTerraform(struct!.update), } } export class DbEventSubscriptionTimeoutsOutputReference 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(): DbEventSubscriptionTimeouts | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._create !== undefined) { hasAnyValues = true; internalValueResult.create = this._create; } if (this._delete !== undefined) { hasAnyValues = true; internalValueResult.delete = this._delete; } if (this._update !== undefined) { hasAnyValues = true; internalValueResult.update = this._update; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: DbEventSubscriptionTimeouts | undefined) { if (value === undefined) { this.isEmptyObject = false; this._create = undefined; this._delete = undefined; this._update = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._create = value.create; this._delete = value.delete; this._update = value.update; } } // 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; } // delete - computed: false, optional: true, required: false private _delete?: string; public get delete() { return this.getStringAttribute('delete'); } public set delete(value: string) { this._delete = value; } public resetDelete() { this._delete = undefined; } // Temporarily expose input value. Use with caution. public get deleteInput() { return this._delete; } // update - computed: false, optional: true, required: false private _update?: string; public get update() { return this.getStringAttribute('update'); } public set update(value: string) { this._update = value; } public resetUpdate() { this._update = undefined; } // Temporarily expose input value. Use with caution. public get updateInput() { return this._update; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/db_event_subscription.html aws_db_event_subscription} */ export class DbEventSubscription extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_db_event_subscription"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/db_event_subscription.html aws_db_event_subscription} 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 DbEventSubscriptionConfig */ public constructor(scope: Construct, id: string, config: DbEventSubscriptionConfig) { super(scope, id, { terraformResourceType: 'aws_db_event_subscription', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._enabled = config.enabled; this._eventCategories = config.eventCategories; this._name = config.name; this._namePrefix = config.namePrefix; this._snsTopic = config.snsTopic; this._sourceIds = config.sourceIds; this._sourceType = config.sourceType; this._tags = config.tags; this._tagsAll = config.tagsAll; this._timeouts.internalValue = config.timeouts; } // ========== // ATTRIBUTES // ========== // arn - computed: true, optional: false, required: false public get arn() { return this.getStringAttribute('arn'); } // customer_aws_id - computed: true, optional: false, required: false public get customerAwsId() { return this.getStringAttribute('customer_aws_id'); } // enabled - computed: false, optional: true, required: false private _enabled?: boolean | cdktf.IResolvable; public get enabled() { return this.getBooleanAttribute('enabled') as any; } public set enabled(value: boolean | cdktf.IResolvable) { this._enabled = value; } public resetEnabled() { this._enabled = undefined; } // Temporarily expose input value. Use with caution. public get enabledInput() { return this._enabled; } // event_categories - computed: false, optional: true, required: false private _eventCategories?: string[]; public get eventCategories() { return this.getListAttribute('event_categories'); } public set eventCategories(value: string[]) { this._eventCategories = value; } public resetEventCategories() { this._eventCategories = undefined; } // Temporarily expose input value. Use with caution. public get eventCategoriesInput() { return this._eventCategories; } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // name - computed: true, 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; } // name_prefix - computed: true, optional: true, required: false private _namePrefix?: string; public get namePrefix() { return this.getStringAttribute('name_prefix'); } public set namePrefix(value: string) { this._namePrefix = value; } public resetNamePrefix() { this._namePrefix = undefined; } // Temporarily expose input value. Use with caution. public get namePrefixInput() { return this._namePrefix; } // sns_topic - computed: false, optional: false, required: true private _snsTopic?: string; public get snsTopic() { return this.getStringAttribute('sns_topic'); } public set snsTopic(value: string) { this._snsTopic = value; } // Temporarily expose input value. Use with caution. public get snsTopicInput() { return this._snsTopic; } // source_ids - computed: false, optional: true, required: false private _sourceIds?: string[]; public get sourceIds() { return this.getListAttribute('source_ids'); } public set sourceIds(value: string[]) { this._sourceIds = value; } public resetSourceIds() { this._sourceIds = undefined; } // Temporarily expose input value. Use with caution. public get sourceIdsInput() { return this._sourceIds; } // source_type - computed: false, optional: true, required: false private _sourceType?: string; public get sourceType() { return this.getStringAttribute('source_type'); } public set sourceType(value: string) { this._sourceType = value; } public resetSourceType() { this._sourceType = undefined; } // Temporarily expose input value. Use with caution. public get sourceTypeInput() { return this._sourceType; } // 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; } // timeouts - computed: false, optional: true, required: false private _timeouts = new DbEventSubscriptionTimeoutsOutputReference(this as any, "timeouts", true); public get timeouts() { return this._timeouts; } public putTimeouts(value: DbEventSubscriptionTimeouts) { 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 { enabled: cdktf.booleanToTerraform(this._enabled), event_categories: cdktf.listMapper(cdktf.stringToTerraform)(this._eventCategories), name: cdktf.stringToTerraform(this._name), name_prefix: cdktf.stringToTerraform(this._namePrefix), sns_topic: cdktf.stringToTerraform(this._snsTopic), source_ids: cdktf.listMapper(cdktf.stringToTerraform)(this._sourceIds), source_type: cdktf.stringToTerraform(this._sourceType), tags: cdktf.hashMapper(cdktf.anyToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.anyToTerraform)(this._tagsAll), timeouts: dbEventSubscriptionTimeoutsToTerraform(this._timeouts.internalValue), }; } }