This message was deleted.
# general
s
This message was deleted.
b
hey! You'll need to define a specific type of RDS database. Only Aurora Serverless databases will be scalable. You can define the options using this: https://www.pulumi.com/docs/reference/pkg/aws/rds/cluster/#clusterscalingconfiguration
l
aurora serverless
minSize 1 maxSize 2, auto pause after 5 minutes
b
do you have any code currently? or just getting started from scratch?
l
const db = new aws.rds.Cluster("db", { engine: "aurora", engineMode: "serverless", engineVersion: "5.6.10a", dbSubnetGroupName: dbsubnet.name, masterUsername: "pulumi", masterPassword: dbpassword.result, scalingConfiguration: new aws.rds.ClusterScalingConfiguration( (autoPause = true), (maxCapacity = 1), (minCapacity = 0), (secondsUntilAutoPause = 60), (timeoutAction = ForceApplyCapacityChange) ), });
just starting with this program
Copy code
const pulumi = require("@pulumi/pulumi");
const aws = require("@pulumi/aws");
const awsx = require("@pulumi/awsx");

// Construct a VPC
const vpc = awsx.ec2.Vpc.getDefault();

// Create an Aurora Serverless MySQL database
const dbsubnet = new aws.rds.SubnetGroup("dbsubnet", {
  subnetIds: vpc.privateSubnetIds,
});

const dbpassword = "xxxxxxx";

const db = new aws.rds.Cluster("db", {
  engine: "aurora",
  engineMode: "serverless",
  engineVersion: "5.6.10a",
  dbSubnetGroupName: dbsubnet.name,
  masterUsername: "pulumi",
  masterPassword: dbpassword,
  scalingConfiguration: new ClusterScalingConfiguration({
    autoPause: true,
    maxCapacity: 1,
    minCapacity: 0,
    secondsUntilAutoPause: 60,
  }),
});
b
I believe
scalingConfiguration
is an object, try this:
Copy code
const db = new aws.rds.Cluster("db", {
    engine: "aurora",
    engineMode: "serverless",
    engineVersion: "5.6.10a",
    dbSubnetGroupName: dbsubnet.name,
    masterUsername: "pulumi",
    masterPassword: dbpassword,
    scalingConfiguration: {
        autoPause: true,
        maxCapacity: 1,
        minCapacity: 0,
        secondsUntilAutoPause: 60,
    },
});
l
thanks, now im getting a weird error - db subnet 'dbsubnet' does not exist
awsrdsSubnetGroup (dbsubnet): error: Error creating DB Subnet Group: InvalidSubnet: Subnet IDs are required. status code: 400, request id: 855eca6d-b6cc-4047-b059-48818ebd9ac3v
thanks so much. I believe its working.
it did
b
@limited-solstice-34584 I'm assuming you figured it out, but the issue is that the default VPC doesn't have any private subnets, so you need to use the public ones
l
yes
well no
i entered the subnetIds in an array
for the private subnets
on my vpc
const dbsubnet = new aws.rds.SubnetGroup("dbsubnet", {
subnetIds: ["subnet-xxx", "subnet-xxxxx"], });
b
👍👍