Fugue.AWS.RDS.DBInstance.MariaDB¶
Table of Contents¶
Module Members¶
new¶
(Function)
Create a new MariaDB DBInstance.
To learn more about how to use this functionality take a look at our hands-on example at http://docs.fugue.co/fugue-by-example-encrypted-password.html
Note: RDS operations, such as starting a new RDS instance, occasionally exceed Fugue’s timeout period. This can result in an error, stating the “Database instance is not in available state”, temporarily reported by the Fugue CLI until the RDS Instance is in an appropriate state to continue. If the error persists indefinitely, further troubleshooting may be required.
Example:
import Fugue.AWS as AWS
import Fugue.AWS.EC2 as EC2
import Fugue.AWS.Pattern.Network as Network
import Fugue.AWS.RDS as RDS
import Fugue.Core.Vars as Vars
net: Network.new {
name: "EXAMPLE",
cidr: "10.42.0.0/16",
region: AWS.Us-east-1,
publicSubnets: [
(AWS.B, "10.42.12.0/24"),
(AWS.C, "10.42.13.0/24")
],
privateSubnets: [
(AWS.B, "10.42.22.0/24"),
(AWS.C, "10.42.23.0/24")
]
}
dbSubnetGroup: RDS.DBSubnetGroup.new {
name: "private",
description: "private subnets",
subnets: net.privateSubnets,
tags: None,
}
dbSecurityGroup: EC2.SecurityGroup.new {
description: "My Database",
ipPermissions: [
# add rules here...
],
ipPermissionsEgress: None,
vpc: net.vpc,
tags: None
}
dbInstance: RDS.DBInstance.MariaDB.new {
dbInstanceIdentifier: "myDB",
dbInstanceClass: RDS.DB_R4_LARGE,
masterUsername: "master",
allocatedStorage: 2048,
securityGroups: [dbSecurityGroup],
dbSubnetGroup: dbSubnetGroup,
storageType: EC2.Gp2,
masterUserPassword: Vars.PlainText {password: "12345678"},
}
Type Signature
fun { dbInstanceIdentifier: String, dbInstanceClass: DBInstanceClass, masterUsername: Optional<String>, dbName: Optional<String>, allocatedStorage: Optional<Int>, securityGroups: Optional<List<SecurityGroup>>, availabilityZone: Optional<AvailabilityZone>, dbSubnetGroup: DBSubnetGroup, multiAZ: Optional<Bool>, storageType: Optional<VolumeType>, port: Optional<Int>, masterUserPassword: Optional<Password>, tags: Optional<List<Tag>>, optionGroup: Optional<OptionGroup>, preferredBackupWindow: Optional<String>, backupRetentionPeriod: Optional<Int>, preferredMaintenanceWindow: Optional<String>, engineVersion: Optional<String>, autoMinorVersionUpgrade: Optional<Bool>, iops: Optional<Int>, characterSetName: Optional<String>, publiclyAccessible: Optional<Bool>, storageEncrypted: Optional<Bool>, caCertificateIdentifier: Optional<String>, copyTagsToSnapshot: Optional<Bool>, monitoringInterval: Optional<Int>, dbParameterGroup: Optional<DBParameterGroup>, monitoringRole: Optional<Role>, kmsKey: Optional<Key>, allowMajorVersionUpgrade: Optional<Bool>, dbSnapshotIdentifier: Optional<String> } -> DBInstance
- Argument:
dbInstanceIdentifier
Must be a lowercase string of alphanumeric characters and hyphens between 1 and 63 characters in length. Mutable.
Type: String
- Argument:
dbInstanceClass
The instance type to run the DB on. Mutable.
Type: DBInstanceClass
- Argument:
masterUsername
The name of the database master user.
- Argument:
dbName
The initial database to create. No database is created if
dbName
is not specified. Maximum length of 64 characters.- Argument:
allocatedStorage
The amount of storage to allocate in GB. See
Engine
Must be 5-6144. Mutable.- Argument:
securityGroups
The list of security groups to attach to the instance. This list must not be empty. Mutable.
Type: Optional<List<SecurityGroup>>
- Argument:
availabilityZone
The AZ to deploy the instance in. Must be
None
ifmultiAZ
isTrue
. Mutable.Type: Optional<AvailabilityZone>
- Argument:
dbSubnetGroup
The DBSubnetGroup to deploy the instance in. Mutable.
Type: DBSubnetGroup
- Argument:
multiAZ
Set to
True
for a Multi-AZ deployment.availabiltyZone
must beNone
if set toTrue
. Mutable.- Argument:
storageType
The type of storage to use. Mutable.
Type: Optional<VolumeType>
- Argument:
port
The port the DB listens on. Valid ports are between 1150 and 65535. Defaults to 3306. Mutable.
- Argument:
masterUserPassword
The password for the master database user. Mutable.
- Argument:
tags
An optional list of tags to attach to the DB instance. Mutable.
- Argument:
optionGroup
Associate the DBInstance with the provided
Fugue.AWS.RDS.OptionGroup
. Mutable.Type: Optional<OptionGroup>
- Argument:
preferredBackupWindow
The daily window where backups are performed. Window is specified in UTC using the following format: ‘hh24:mi-hh24:mi’. The provided window must be at least 30 minutes. Defaults to a randomly selected 30 minute window appropriate for the region. Mutable.
- Argument:
backupRetentionPeriod
The number of days that backups will be retained. Specifying 0 will disable backups. Defaults to 1. Mutable.
- Argument:
preferredMaintenanceWindow
The weekly window where maintenance can be performed by AWS. Window is specified in UTC using the following format: ‘ddd:hh24:mi-ddd:hh24:mi’. The provided window must be at least 30 minutes. Defaults to a randomly selected day and 30 minute window appropriate for the region. Mutable.
- Argument:
engineVersion
The version of the database engine to use. See RDS documentation for a list of supported versions. Mutable.
- Argument:
autoMinorVersionUpgrade
If
True
allows AWS to apply minor version upgrades to your database during the monthly maintenance window. Default toTrue
. Mutable.- Argument:
iops
Provisioned IOPS to allocate for the DBInstance. Must be 3-10 times the size of the allocated storage for your DBInstance, rounded up to the nearest 1000. Mutable.
- Argument:
characterSetName
The character set to associate with the DBInstance. Not supported by all engines.
- Argument:
publiclyAccessible
If
True
theDBInstance
has a public IP and DNS name. IfFalse
theDBInstance
will only be accessible from within your VPC. Defaults toFalse
. Mutable.- Argument:
storageEncrypted
If
True
theDBInstance
‘s will use encrypted storage. Defaults toFalse
.- Argument:
caCertificateIdentifier
Mutable.
- Argument:
copyTagsToSnapshot
If
True
allTag
s from theDBInstance
will be copied to any snapshots taken of the instance. Defaults toFalse
. Mutable.- Argument:
monitoringInterval
Interval in seconds that enhanced monitoring metrics are collected. Set to 0 to disable enhanced monitoring. Must be one of: 0, 1, 5, 10, 15, 30, or 60. Defaults to 0. Mutable.
- Argument:
dbParameterGroup
The DBParameterGroup to associate with this DBInstance. Mutable.
Type: Optional<DBParameterGroup>
- Argument:
monitoringRole
The Role to use when sending enhanced metrics to CloudWatch Logs. Required if enhanced metrics are enabled (
monitoringInterval
is non-zero). Mutable.- Argument:
kmsKey
The KMS key to use when encrypting DBInstance storage. Defaults to the default KMS key for your account.
- Argument:
allowMajorVersionUpgrade
Set to
True
to enable changes to the major version of the engine. IfFalse
attempts to change the engine version, it will result in a runtime error. Defaults toFalse
. Mutable.- Argument:
dbSnapshotIdentifier
The snapshot to provision the
DBInstance
from.- Returns:
The DBInstance.
Type: DBInstance