This is (https://zeit.co)[zeit.now] integration for (https://aws.amazon.com/rds/aurora/)[AWS Aurora] Data Http API. Create Serverless SQL in minutes
- Add AWS Aurora - Serverless SQL integration.
- Setup with your AWS Account
- Add new cluster
- Link the cluster to the project
After that new env variables are added to your zeit project
AURORA_SECRET_ACCESS_KEY
AURORA_ACCESS_KEY_ID
AURORA_SECRET_ARN
AURORA_CLUSTER_NAME
AURORA_CLUSTER_ARN
AURORA_REGION
import micro from "micro";
import AWS from "aws-sdk";
export default micro(async (req, res) => {
const rdsDataService = new AWS.RDSDataService({
accessKeyId: process.env.AURORA_ACCESS_KEY_ID,
region: process.env.AURORA_REGION,
secretAccessKey: process.env.AURORA_SECRET_ACCESS_KEY
});
const params = {
secretArn: process.env.AURORA_SECRET_ARN!,
resourceArn: process.env.AURORA_CLUSTER_ARN!,
sql: `CREATE DATABASE cats`
};
// const params = {
// secretArn: process.env.AURORA_SECRET_ARN!,
// resourceArn: process.env.AURORA_CLUSTER_ARN!,
// sql: `SELECT * from cats where id=:id`,
// parameters: [
// {
// name: "id",
// value: {
// longValue: 1
// }
// }
// ]
// };
let data = await rdsDataService.executeStatement(params).promise();
return "done";
});
You can run this sample code in your zeit instance
- Setup with AWS keys
- Add Aurora Cluster
- Remove Aurora Cluster
- Connect Aurora Cluster to project
- Autogenerate cluster name
- Provide more examples
- Disconnect clusters from project
- Provide cluster with name and description
- Implement separate IAM Accounts for project runners