Skip to content

Instantly share code, notes, and snippets.

@BerndWessels
Created May 22, 2019 01:35
Show Gist options
  • Save BerndWessels/91c1baff6f4b1ab9132d840d2c817baf to your computer and use it in GitHub Desktop.
Save BerndWessels/91c1baff6f4b1ab9132d840d2c817baf to your computer and use it in GitHub Desktop.
BFF pulumi aurora serverless
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Aurora Serverless
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const dbCluster = new aws.rds.Cluster("dbCluster", {
applyImmediately: true,
clusterIdentifier: "mycluster",
engineMode: "serverless",
iamDatabaseAuthenticationEnabled: false,
port: 3306,
masterPassword: "PASSWORD",
masterUsername: "USERNAME",
scalingConfiguration: {
autoPause: true,
maxCapacity: 1,
minCapacity: 1,
secondsUntilAutoPause: 600,
},
skipFinalSnapshot: true,
});
// TODO Automatically enable Data API once it becomes available in pulumi.
exports.dbClusterEndpoint = dbCluster.endpoint;
const dbClusterSecret = new aws.secretsmanager.Secret("dbClusterSecret", {});
const dbClusterSecretVersion = new aws.secretsmanager.SecretVersion("dbClusterSecretVersion", {
secretId: dbClusterSecret.id,
secretString: JSON.stringify({
username: 'USERNAME',
password: 'PASSWORD',
}),
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment