Module Members



Create a reference to an externally managed DBCluster.

Example usage:

cluster: RDS.DBCluster.external("cluster-IYF324NWDUG4FZAXCWXYJOIBXQ1", AWS.Us-east-1)

Type Signature

 fun (String, Region) -> DBCluster
Argument: name

The name of the target DBCluster.

Type: String

Argument: region

The Region containing the target DBCluster.

Type: Region


A reference to the specified DBCluster.

Type: DBCluster



Create a new DBCluster.

This is a generic constructor for all engine types. It is recommended to use the constructor for the specific engine in the DBCluster module.

  • Fugue.AWS.RDS.DBCluster.Aurora.new
  • Fugue.AWS.RDS.DBCluster.AuroraMySQL.new
  • Fugue.AWS.RDS.DBCluster.AuroraPostgreSQL.new


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: "",
  region: AWS.Us-east-1,
  publicSubnets: [
    (AWS.B, ""),
    (AWS.C, "")
  privateSubnets: [
    (AWS.B, ""),
    (AWS.C, "")

dbSubnetGroup: RDS.DBSubnetGroup.new {
  name: "private",
  description: "private subnets",
  subnets: net.privateSubnets,

dbSecurityGroup: EC2.SecurityGroup.new {
  description: "My Database",
  ipPermissions: [
    # add rules here...
  ipPermissionsEgress: None,
  vpc: net.vpc,

dbCluster: RDS.DBCluster.new {
  dbClusterIdentifier: "myCluster",
  dbSubnetGroup: dbSubnetGroup,
  engine: RDS.Aurora,
  masterUsername: "master",
  masterUserPassword: Vars.PlainText {password: "12345678"},
  port: 3306,
  securityGroups: [dbSecurityGroup],

Type Signature

 fun { backupRetentionPeriod: Optional<Int>,
       databaseName: Optional<String>,
       dbClusterIdentifier: String,
       dbClusterParameterGroup: Optional<DBClusterParameterGroup>,
       dbSubnetGroup: DBSubnetGroup,
       engine: Engine,
       engineVersion: Optional<String>,
       port: Int,
       masterUsername: String,
       preferredBackupWindow: Optional<String>,
       preferredMaintenanceWindow: Optional<String>,
       vpcSecurityGroups: List<SecurityGroup>,
       storageEncrypted: Optional<Bool>,
       enableIAMDatabaseAuthorization: Optional<Bool>,
       kmsKey: Optional<Key>,
       masterUserPassword: Password,
       roles: Optional<List<Role>>,
       tags: Optional<List<Tag>>,
       snapshotIdentifier: Optional<String>,
       finalSnapshotIdentifier: Optional<String>,
       resourceId: Optional<String> } -> DBCluster
Argument: backupRetentionPeriod

The number of days for which automated backups are retained. You must specify a minimum value of 1. Default 1. Must be a value from 1 to 35. Mutable.

Type: Optional<Int>

Argument: databaseName

The name for your database, composed of up to 64 alpha-numeric characters. If you do not provide a name, Amazon RDS will not create a database in the DB cluster you are creating.

Type: Optional<String>

Argument: dbClusterIdentifier

The DB cluster identifier. This parameter is stored as a lowercase string. Must contain from 1 to 63 letters, numbers, or hyphens. First character must be a letter. Cannot end with a hyphen or contain two consecutive hyphens. Mutable.

Type: String

Argument: dbClusterParameterGroup

The DB cluster parameter group to associate with this DB cluster. Mutable.

Type: Optional<DBClusterParameterGroup>

Argument: dbSubnetGroup

The DBSubnetGroup to deploy the cluster in.

Type: DBSubnetGroup

Argument: engine

The DB engine to run.

Type: Engine

Argument: engineVersion

The version number of the database engine to use.

Type: Optional<String>

Argument: port

The port number on which the instances in the DB cluster accept connections. Mutable.

Type: Int

Argument: masterUsername

The name of the master user for the DB cluster. Must be 1 to 16 letters or numbers. First character must be a letter. Cannot be a reserved word for the chosen database engine.

Type: String

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.

Type: Optional<String>

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.

Type: Optional<String>

Argument: vpcSecurityGroups
Type: List<SecurityGroup>
Argument: storageEncrypted

If True the DBInstance‘s will use encrypted storage. Defaults to False.

Type: Optional<Bool>

Argument: enableIAMDatabaseAuthorization

True to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts, and otherwise false. Only valid for Aurora and AuroraMySQL engines. Mutable.

Type: Optional<Bool>

Argument: kmsKey

The KMS key to use when encrypting DBInstance storage. Defaults to the default KMS key for your account.

Type: Optional<Key>

Argument: masterUserPassword

The password for the master database user. Mutable.

Type: Password

Argument: roles

Associated Identity and Access Management (IAM) roles from an Aurora DB cluster to access other AWS services on your behalf. Mutable.

Type: Optional<List<Role>>

Argument: tags

An optional list of tags to attach to the DB instance. Mutable.

Type: Optional<List<Tag>>

Argument: snapshotIdentifier

The snapshot to provision the DBCluster from.

Type: Optional<String>

Argument: finalSnapshotIdentifier

The name of the final snapshot to create when Fugue deletes the DBCluster. Mutable.

Type: Optional<String>

Argument: resourceId

Resource ID of the resource to import with Fugue Import. This field is only honored on fugue run. The resource ID is the AWS ID. Mutable. Example: cluster-IYF324NWDUG4FZAXCWXYJOIBXQ1

Type: Optional<String>


The DBCluster.

Type: DBCluster



Retrieve the region from an cluster value.

Works for clusters defined in the composition as well external values.

Type Signature

 fun (DBCluster) -> Region
Argument: dbCluster

The instance from which to get the region.

Type: DBCluster


The region containing the cluster.

Type: Region