import * as core from "@terrascript/core"; export interface S3ImportArgs extends core.SchemaArgs { bucketName: string | core.StringOut; bucketPrefix?: string | core.StringOut; ingestionRole: string | core.StringOut; sourceEngine: string | core.StringOut; sourceEngineVersion: string | core.StringOut; } export class S3Import extends core.Schema { @core.attr(String) public bucketName!: string | core.StringOut; @core.attr(String) public bucketPrefix?: string | core.StringOut; @core.attr(String) public ingestionRole!: string | core.StringOut; @core.attr(String) public sourceEngine!: string | core.StringOut; @core.attr(String) public sourceEngineVersion!: string | core.StringOut; } export interface RestoreToPointInTimeArgs extends core.SchemaArgs { restoreTime?: string | core.StringOut; sourceDbInstanceAutomatedBackupsArn?: string | core.StringOut; sourceDbInstanceIdentifier?: string | core.StringOut; sourceDbiResourceId?: string | core.StringOut; useLatestRestorableTime?: boolean | core.BooleanOut; } export class RestoreToPointInTime extends core.Schema { @core.attr(String) public restoreTime?: string | core.StringOut; @core.attr(String) public sourceDbInstanceAutomatedBackupsArn?: string | core.StringOut; @core.attr(String) public sourceDbInstanceIdentifier?: string | core.StringOut; @core.attr(String) public sourceDbiResourceId?: string | core.StringOut; @core.attr(Boolean) public useLatestRestorableTime?: boolean | core.BooleanOut; } export interface DbInstanceArgs extends core.ResourceArgs { /** * (Required unless a `snapshot_identifier` or `replicate_source_db` is provided) The allocated storage * in gibibytes. If `max_allocated_storage` is configured, this argument represents the initial storag * e allocation and differences from the configuration will be ignored automatically when Storage Autos * caling occurs. If `replicate_source_db` is set, the value is ignored during the creation of the inst * ance. */ allocatedStorage?: number | core.NumberOut; /** * (Optional) Indicates that major version */ allowMajorVersionUpgrade?: boolean | core.BooleanOut; /** * (Optional) Specifies whether any database modifications */ applyImmediately?: boolean | core.BooleanOut; /** * (Optional) Indicates that minor engine upgrades */ autoMinorVersionUpgrade?: boolean | core.BooleanOut; /** * (Optional) The AZ for the RDS instance. */ availabilityZone?: string | core.StringOut; /** * (Optional) The days to retain backups for. Must be */ backupRetentionPeriod?: number | core.NumberOut; /** * (Optional) The daily time range (in UTC) during which */ backupWindow?: string | core.StringOut; /** * (Optional) The identifier of the CA certificate for the DB instance. */ caCertIdentifier?: string | core.StringOut; /** * (Optional) The character set name to use for DB */ characterSetName?: string | core.StringOut; copyTagsToSnapshot?: boolean | core.BooleanOut; /** * (Optional) Indicates whether to enable a customer-owned IP address (CoIP) for an RDS on Outposts DB * instance. See [CoIP for RDS on Outposts](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds- * on-outposts.html#rds-on-outposts.coip) for more information. */ customerOwnedIpEnabled?: boolean | core.BooleanOut; /** * (Optional) The name of the database to create when the DB instance is created. If this parameter is * not specified, no database is created in the DB instance. Note that this does not apply for Oracle o * r SQL Server engines. See the [AWS documentation](https://awscli.amazonaws.com/v2/documentation/api/ * latest/reference/rds/create-db-instance.html) for more details on what applies for those engines. If * you are providing an Oracle db name, it needs to be in all upper case. Cannot be specified for a re * plica. */ dbName?: string | core.StringOut; /** * (Optional) Name of [DB subnet group](/docs/providers/aws/r/db_subnet_group.html). DB instance will */ dbSubnetGroupName?: string | core.StringOut; /** * (Optional) Specifies whether to remove automated backups immediately after the DB instance is delete * d. Default is `true`. */ deleteAutomatedBackups?: boolean | core.BooleanOut; /** * (Optional) If the DB instance should have deletion protection enabled. The database can't be deleted * when this value is set to `true`. The default is `false`. */ deletionProtection?: boolean | core.BooleanOut; /** * (Optional) The ID of the Directory Service Active Directory domain to create the instance in. */ domain?: string | core.StringOut; /** * (Optional, but required if domain is provided) The name of the IAM role to be used when making API c * alls to the Directory Service. */ domainIamRoleName?: string | core.StringOut; /** * (Optional) Set of log types to enable for exporting to CloudWatch logs. If omitted, no logs will be * exported. Valid values (depending on `engine`). MySQL and MariaDB: `audit`, `error`, `general`, `slo * wquery`. PostgreSQL: `postgresql`, `upgrade`. MSSQL: `agent` , `error`. Oracle: `alert`, `audit`, `l * istener`, `trace`. */ enabledCloudwatchLogsExports?: | core.Array | core.ArrayOut; /** * (Required unless a `snapshot_identifier` or `replicate_source_db` */ engine?: string | core.StringOut; /** * (Optional) The engine version to use. If `auto_minor_version_upgrade` */ engineVersion?: string | core.StringOut; /** * (Optional) The name of your final DB snapshot */ finalSnapshotIdentifier?: string | core.StringOut; /** * (Optional) Specifies whether or */ iamDatabaseAuthenticationEnabled?: boolean | core.BooleanOut; /** * (Optional, Forces new resource) The name of the RDS instance, */ identifier?: string | core.StringOut; /** * (Optional, Forces new resource) Creates a unique */ identifierPrefix?: string | core.StringOut; /** * (Required) The instance type of the RDS instance. */ instanceClass: string | core.StringOut; /** * (Optional) The amount of provisioned IOPS. Setting this implies a */ iops?: number | core.NumberOut; /** * (Optional) The ARN for the KMS encryption key. If creating an */ kmsKeyId?: string | core.StringOut; /** * (Optional, but required for some DB engines, i.e., Oracle */ licenseModel?: string | core.StringOut; /** * (Optional) The window to perform maintenance in. */ maintenanceWindow?: string | core.StringOut; /** * (Optional) When configured, the upper limit to which Amazon RDS can automatically scale the storage * of the DB instance. Configuring this will automatically ignore differences to `allocated_storage`. M * ust be greater than or equal to `allocated_storage` or `0` to disable Storage Autoscaling. */ maxAllocatedStorage?: number | core.NumberOut; /** * (Optional) The interval, in seconds, between points */ monitoringInterval?: number | core.NumberOut; /** * (Optional) The ARN for the IAM role that permits RDS */ monitoringRoleArn?: string | core.StringOut; /** * (Optional) Specifies if the RDS instance is multi-AZ */ multiAz?: boolean | core.BooleanOut; /** * (Optional, **Deprecated** use `db_name` instead) The name of the database to create when the DB inst * ance is created. If this parameter is not specified, no database is created in the DB instance. Note * that this does not apply for Oracle or SQL Server engines. See the [AWS documentation](https://awsc * li.amazonaws.com/v2/documentation/api/latest/reference/rds/create-db-instance.html) for more details * on what applies for those engines. If you are providing an Oracle db name, it needs to be in all up * per case. Cannot be specified for a replica. */ name?: string | core.StringOut; /** * (Optional, Forces new resource) The national character set is used in the NCHAR, NVARCHAR2, and NCLO * B data types for Oracle instances. This can't be changed. See [Oracle Character Sets */ ncharCharacterSetName?: string | core.StringOut; /** * (Optional) The network type of the DB instance. Valid values: `IPV4`, `DUAL`. */ networkType?: string | core.StringOut; /** * (Optional) Name of the DB option group to associate. */ optionGroupName?: string | core.StringOut; /** * (Optional) Name of the DB parameter group to */ parameterGroupName?: string | core.StringOut; /** * (Required unless a `snapshot_identifier` or `replicate_source_db` */ password?: string | core.StringOut; /** * (Optional) Specifies whether Performance Insights are enabled. Defaults to false. */ performanceInsightsEnabled?: boolean | core.BooleanOut; /** * (Optional) The ARN for the KMS key to encrypt Performance Insights data. When specifying `performanc * e_insights_kms_key_id`, `performance_insights_enabled` needs to be set to true. Once KMS key is set, * it can never be changed. */ performanceInsightsKmsKeyId?: string | core.StringOut; /** * (Optional) The amount of time in days to retain Performance Insights data. Either 7 (7 days) or 731 * (2 years). When specifying `performance_insights_retention_period`, `performance_insights_enabled` n * eeds to be set to true. Defaults to '7'. */ performanceInsightsRetentionPeriod?: number | core.NumberOut; /** * (Optional) The port on which the DB accepts connections. */ port?: number | core.NumberOut; /** * (Optional) Bool to control if instance is publicly */ publiclyAccessible?: boolean | core.BooleanOut; /** * (Optional) Specifies whether the replica is in either `mounted` or `open-read-only` mode. This attri * bute */ replicaMode?: string | core.StringOut; /** * (Optional) Specifies that this resource is a Replicate */ replicateSourceDb?: string | core.StringOut; /** * (Optional, Forces new resource) A configuration block for restoring a DB instance to an arbitrary po * int in time. Requires the `identifier` argument to be set with the name of the new DB instance to be * created. See [Restore To Point In Time](#restore-to-point-in-time) below for details. */ restoreToPointInTime?: RestoreToPointInTime; /** * (Optional) Restore from a Percona Xtrabackup in S3. See [Importing Data into an Amazon RDS MySQL DB * Instance](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Importing.html) */ s3Import?: S3Import; /** * (Optional/Deprecated) List of DB Security Groups to */ securityGroupNames?: core.Array | core.ArrayOut; /** * (Optional) Determines whether a final DB snapshot is */ skipFinalSnapshot?: boolean | core.BooleanOut; /** * (Optional) Specifies whether or not to create this */ snapshotIdentifier?: string | core.StringOut; /** * (Optional) Specifies whether the DB instance is */ storageEncrypted?: boolean | core.BooleanOut; /** * (Optional) One of "standard" (magnetic), "gp2" (general */ storageType?: string | core.StringOut; /** * (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` co * nfiguration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-co * nfiguration-block) present, tags with matching keys will overwrite those defined at the provider-lev * el. */ tags?: core.Map | core.MapOut; /** * A map of tags assigned to the resource, including those inherited from the provider [`default_tags` * configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags- * configuration-block). */ tagsAll?: core.Map | core.MapOut; /** * (Optional) Time zone of the DB instance. `timezone` is currently */ timezone?: string | core.StringOut; /** * (Required unless a `snapshot_identifier` or `replicate_source_db` */ username?: string | core.StringOut; /** * (Optional) List of VPC security groups to */ vpcSecurityGroupIds?: core.Array | core.ArrayOut; } export class DbInstance extends core.Resource { /** * The hostname of the RDS instance. See also `endpoint` and `port`. */ @core.attr(String, { computed: true }) public address!: string | core.StringOut; /** * (Required unless a `snapshot_identifier` or `replicate_source_db` is provided) The allocated storage * in gibibytes. If `max_allocated_storage` is configured, this argument represents the initial storag * e allocation and differences from the configuration will be ignored automatically when Storage Autos * caling occurs. If `replicate_source_db` is set, the value is ignored during the creation of the inst * ance. */ @core.attr(Number, { computed: true }) public allocatedStorage?: number | core.NumberOut; /** * (Optional) Indicates that major version */ @core.attr(Boolean) public allowMajorVersionUpgrade?: boolean | core.BooleanOut; /** * (Optional) Specifies whether any database modifications */ @core.attr(Boolean, { computed: true }) public applyImmediately?: boolean | core.BooleanOut; /** * The ARN of the RDS instance. */ @core.attr(String, { computed: true }) public arn!: string | core.StringOut; /** * (Optional) Indicates that minor engine upgrades */ @core.attr(Boolean) public autoMinorVersionUpgrade?: boolean | core.BooleanOut; /** * (Optional) The AZ for the RDS instance. */ @core.attr(String, { computed: true }) public availabilityZone?: string | core.StringOut; /** * (Optional) The days to retain backups for. Must be */ @core.attr(Number, { computed: true }) public backupRetentionPeriod?: number | core.NumberOut; /** * (Optional) The daily time range (in UTC) during which */ @core.attr(String, { computed: true }) public backupWindow?: string | core.StringOut; /** * (Optional) The identifier of the CA certificate for the DB instance. */ @core.attr(String, { computed: true }) public caCertIdentifier?: string | core.StringOut; /** * (Optional) The character set name to use for DB */ @core.attr(String, { computed: true }) public characterSetName?: string | core.StringOut; @core.attr(Boolean) public copyTagsToSnapshot?: boolean | core.BooleanOut; /** * (Optional) Indicates whether to enable a customer-owned IP address (CoIP) for an RDS on Outposts DB * instance. See [CoIP for RDS on Outposts](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds- * on-outposts.html#rds-on-outposts.coip) for more information. */ @core.attr(Boolean) public customerOwnedIpEnabled?: boolean | core.BooleanOut; /** * (Optional) The name of the database to create when the DB instance is created. If this parameter is * not specified, no database is created in the DB instance. Note that this does not apply for Oracle o * r SQL Server engines. See the [AWS documentation](https://awscli.amazonaws.com/v2/documentation/api/ * latest/reference/rds/create-db-instance.html) for more details on what applies for those engines. If * you are providing an Oracle db name, it needs to be in all upper case. Cannot be specified for a re * plica. */ @core.attr(String, { computed: true }) public dbName?: string | core.StringOut; /** * (Optional) Name of [DB subnet group](/docs/providers/aws/r/db_subnet_group.html). DB instance will */ @core.attr(String, { computed: true }) public dbSubnetGroupName?: string | core.StringOut; /** * (Optional) Specifies whether to remove automated backups immediately after the DB instance is delete * d. Default is `true`. */ @core.attr(Boolean) public deleteAutomatedBackups?: boolean | core.BooleanOut; /** * (Optional) If the DB instance should have deletion protection enabled. The database can't be deleted * when this value is set to `true`. The default is `false`. */ @core.attr(Boolean) public deletionProtection?: boolean | core.BooleanOut; /** * (Optional) The ID of the Directory Service Active Directory domain to create the instance in. */ @core.attr(String) public domain?: string | core.StringOut; /** * (Optional, but required if domain is provided) The name of the IAM role to be used when making API c * alls to the Directory Service. */ @core.attr(String) public domainIamRoleName?: string | core.StringOut; /** * (Optional) Set of log types to enable for exporting to CloudWatch logs. If omitted, no logs will be * exported. Valid values (depending on `engine`). MySQL and MariaDB: `audit`, `error`, `general`, `slo * wquery`. PostgreSQL: `postgresql`, `upgrade`. MSSQL: `agent` , `error`. Oracle: `alert`, `audit`, `l * istener`, `trace`. */ @core.attr(String, { kind: "array" }) public enabledCloudwatchLogsExports?: | core.Array | core.ArrayOut; /** * The connection endpoint in `address:port` format. */ @core.attr(String, { computed: true }) public endpoint!: string | core.StringOut; /** * (Required unless a `snapshot_identifier` or `replicate_source_db` */ @core.attr(String, { computed: true }) public engine?: string | core.StringOut; /** * (Optional) The engine version to use. If `auto_minor_version_upgrade` */ @core.attr(String, { computed: true }) public engineVersion?: string | core.StringOut; /** * The running version of the database. */ @core.attr(String, { computed: true }) public engineVersionActual!: string | core.StringOut; /** * (Optional) The name of your final DB snapshot */ @core.attr(String) public finalSnapshotIdentifier?: string | core.StringOut; /** * The canonical hosted zone ID of the DB instance (to be used */ @core.attr(String, { computed: true }) public hostedZoneId!: string | core.StringOut; /** * (Optional) Specifies whether or */ @core.attr(Boolean) public iamDatabaseAuthenticationEnabled?: boolean | core.BooleanOut; /** * The RDS instance ID. */ @core.attr(String, { computed: true }) public id!: string | core.StringOut; /** * (Optional, Forces new resource) The name of the RDS instance, */ @core.attr(String, { computed: true }) public identifier?: string | core.StringOut; /** * (Optional, Forces new resource) Creates a unique */ @core.attr(String, { computed: true }) public identifierPrefix?: string | core.StringOut; /** * (Required) The instance type of the RDS instance. */ @core.attr(String) public instanceClass!: string | core.StringOut; /** * (Optional) The amount of provisioned IOPS. Setting this implies a */ @core.attr(Number) public iops?: number | core.NumberOut; /** * (Optional) The ARN for the KMS encryption key. If creating an */ @core.attr(String, { computed: true }) public kmsKeyId?: string | core.StringOut; /** * The latest time, in UTC [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8), to which * a database can be restored with point-in-time restore. */ @core.attr(String, { computed: true }) public latestRestorableTime!: string | core.StringOut; /** * (Optional, but required for some DB engines, i.e., Oracle */ @core.attr(String, { computed: true }) public licenseModel?: string | core.StringOut; /** * (Optional) The window to perform maintenance in. */ @core.attr(String, { computed: true }) public maintenanceWindow?: string | core.StringOut; /** * (Optional) When configured, the upper limit to which Amazon RDS can automatically scale the storage * of the DB instance. Configuring this will automatically ignore differences to `allocated_storage`. M * ust be greater than or equal to `allocated_storage` or `0` to disable Storage Autoscaling. */ @core.attr(Number) public maxAllocatedStorage?: number | core.NumberOut; /** * (Optional) The interval, in seconds, between points */ @core.attr(Number) public monitoringInterval?: number | core.NumberOut; /** * (Optional) The ARN for the IAM role that permits RDS */ @core.attr(String, { computed: true }) public monitoringRoleArn?: string | core.StringOut; /** * (Optional) Specifies if the RDS instance is multi-AZ */ @core.attr(Boolean, { computed: true }) public multiAz?: boolean | core.BooleanOut; /** * (Optional, **Deprecated** use `db_name` instead) The name of the database to create when the DB inst * ance is created. If this parameter is not specified, no database is created in the DB instance. Note * that this does not apply for Oracle or SQL Server engines. See the [AWS documentation](https://awsc * li.amazonaws.com/v2/documentation/api/latest/reference/rds/create-db-instance.html) for more details * on what applies for those engines. If you are providing an Oracle db name, it needs to be in all up * per case. Cannot be specified for a replica. */ @core.attr(String, { computed: true }) public name?: string | core.StringOut; /** * (Optional, Forces new resource) The national character set is used in the NCHAR, NVARCHAR2, and NCLO * B data types for Oracle instances. This can't be changed. See [Oracle Character Sets */ @core.attr(String, { computed: true }) public ncharCharacterSetName?: string | core.StringOut; /** * (Optional) The network type of the DB instance. Valid values: `IPV4`, `DUAL`. */ @core.attr(String, { computed: true }) public networkType?: string | core.StringOut; /** * (Optional) Name of the DB option group to associate. */ @core.attr(String, { computed: true }) public optionGroupName?: string | core.StringOut; /** * (Optional) Name of the DB parameter group to */ @core.attr(String, { computed: true }) public parameterGroupName?: string | core.StringOut; /** * (Required unless a `snapshot_identifier` or `replicate_source_db` */ @core.attr(String) public password?: string | core.StringOut; /** * (Optional) Specifies whether Performance Insights are enabled. Defaults to false. */ @core.attr(Boolean) public performanceInsightsEnabled?: boolean | core.BooleanOut; /** * (Optional) The ARN for the KMS key to encrypt Performance Insights data. When specifying `performanc * e_insights_kms_key_id`, `performance_insights_enabled` needs to be set to true. Once KMS key is set, * it can never be changed. */ @core.attr(String, { computed: true }) public performanceInsightsKmsKeyId?: string | core.StringOut; /** * (Optional) The amount of time in days to retain Performance Insights data. Either 7 (7 days) or 731 * (2 years). When specifying `performance_insights_retention_period`, `performance_insights_enabled` n * eeds to be set to true. Defaults to '7'. */ @core.attr(Number, { computed: true }) public performanceInsightsRetentionPeriod?: number | core.NumberOut; /** * (Optional) The port on which the DB accepts connections. */ @core.attr(Number, { computed: true }) public port?: number | core.NumberOut; /** * (Optional) Bool to control if instance is publicly */ @core.attr(Boolean) public publiclyAccessible?: boolean | core.BooleanOut; /** * (Optional) Specifies whether the replica is in either `mounted` or `open-read-only` mode. This attri * bute */ @core.attr(String, { computed: true }) public replicaMode?: string | core.StringOut; @core.attr(String, { computed: true, kind: "array" }) public replicas!: core.Array | core.ArrayOut; /** * (Optional) Specifies that this resource is a Replicate */ @core.attr(String) public replicateSourceDb?: string | core.StringOut; /** * The RDS Resource ID of this instance. */ @core.attr(String, { computed: true }) public resourceId!: string | core.StringOut; /** * (Optional, Forces new resource) A configuration block for restoring a DB instance to an arbitrary po * int in time. Requires the `identifier` argument to be set with the name of the new DB instance to be * created. See [Restore To Point In Time](#restore-to-point-in-time) below for details. */ @core.attr(RestoreToPointInTime) public restoreToPointInTime?: RestoreToPointInTime; /** * (Optional) Restore from a Percona Xtrabackup in S3. See [Importing Data into an Amazon RDS MySQL DB * Instance](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Importing.html) */ @core.attr(S3Import) public s3Import?: S3Import; /** * (Optional/Deprecated) List of DB Security Groups to */ @core.attr(String, { kind: "array" }) public securityGroupNames?: | core.Array | core.ArrayOut; /** * (Optional) Determines whether a final DB snapshot is */ @core.attr(Boolean) public skipFinalSnapshot?: boolean | core.BooleanOut; /** * (Optional) Specifies whether or not to create this */ @core.attr(String, { computed: true }) public snapshotIdentifier?: string | core.StringOut; /** * The RDS instance status. */ @core.attr(String, { computed: true }) public status!: string | core.StringOut; /** * (Optional) Specifies whether the DB instance is */ @core.attr(Boolean) public storageEncrypted?: boolean | core.BooleanOut; /** * (Optional) One of "standard" (magnetic), "gp2" (general */ @core.attr(String, { computed: true }) public storageType?: string | core.StringOut; /** * (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` co * nfiguration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-co * nfiguration-block) present, tags with matching keys will overwrite those defined at the provider-lev * el. */ @core.attr(String, { kind: "map" }) public tags?: core.Map | core.MapOut; /** * A map of tags assigned to the resource, including those inherited from the provider [`default_tags` * configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags- * configuration-block). */ @core.attr(String, { computed: true, kind: "map" }) public tagsAll?: core.Map | core.MapOut; /** * (Optional) Time zone of the DB instance. `timezone` is currently */ @core.attr(String, { computed: true }) public timezone?: string | core.StringOut; /** * (Required unless a `snapshot_identifier` or `replicate_source_db` */ @core.attr(String, { computed: true }) public username?: string | core.StringOut; /** * (Optional) List of VPC security groups to */ @core.attr(String, { computed: true, kind: "array" }) public vpcSecurityGroupIds?: | core.Array | core.ArrayOut; constructor(name: string, args?: DbInstanceArgs) { super(name, "aws_db_instance", args); } public override getNamespace(): string { return "aws_rds"; } }