Fugue.AWS.RDS.DBInstance.AuroraPostgreSQL

Table of Contents

Module Members

new

(Function)

Create a new AuroraPostgreSQL 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,
}

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

dbCluster: RDS.DBCluster.AuroraPostgreSQL.new {
  dbClusterIdentifier: "myCluster",
  dbSubnetGroup: dbSubnetGroup,
  masterUsername: "master",
  masterUserPassword: Vars.PlainText {password: "12345678"},
  vpcSecurityGroups: [dbSecurityGroup],
}

dbInstance: RDS.DBInstance.AuroraPostgreSQL.new {
  dbCluster: dbCluster.cluster,
  dbInstanceIdentifier: "myDB",
  dbInstanceClass: RDS.DB_R4_LARGE,
  dbSubnetGroup: dbSubnetGroup,
}

Type Signature

 fun { dbInstanceIdentifier: String,
       dbInstanceClass: DBInstanceClass,
       availabilityZone: Optional<AvailabilityZone>,
       dbSubnetGroup: DBSubnetGroup,
       tags: Optional<List<Tag>>,
       optionGroup: Optional<OptionGroup>,
       preferredMaintenanceWindow: Optional<String>,
       publiclyAccessible: Optional<Bool>,
       caCertificateIdentifier: Optional<String>,
       monitoringInterval: Optional<Int>,
       promotionTier: Optional<Int>,
       dbCluster: Optional<DBCluster>,
       dbParameterGroup: Optional<DBParameterGroup>,
       monitoringRole: Optional<Role>,
       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: availabilityZone

The AZ to deploy the instance in.

Type: Optional<AvailabilityZone>

Argument: dbSubnetGroup

The DBSubnetGroup to deploy the instance in.

Type: DBSubnetGroup

Argument: tags

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

Type: Optional<List<Tag>>

Argument: optionGroup

Associate the DBInstance with the provided Fugue.AWS.RDS.OptionGroup. Mutable.

Type: Optional<OptionGroup>

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: publiclyAccessible

If True the DBInstance has a public IP and DNS name. If False the DBInstance will only be accessible from within your VPC. Defaults to False. Mutable.

Type: Optional<Bool>

Argument: caCertificateIdentifier

Mutable.

Type: Optional<String>

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.

Type: Optional<Int>

Argument: promotionTier

Aurora only. Specifies the order in which a replica is promoted to primary after a primary failure. Must be between 0 and 15. Defaults to 1. Mutable.

Type: Optional<Int>

Argument: dbCluster

The DBCluster that this DBInstance is a member of.

Type: Optional<DBCluster>

Argument: dbParameterGroup

The DBParameterGroup to associate with this DBInstance. Mutable.

Type: Optional<DBParameterGroup>

Argument: monitoringRole

The Fugue.AWS.IAM.Role to use when sending enhanced metrics to CloudWatch Logs. Required if enhanced metrics are enabled (monitoringInterval is non-zero). Mutable.

Type: Optional<Role>

Argument: dbSnapshotIdentifier
Type: Optional<String>
Returns:

The DBInstance.

Type: DBInstance