RDS Instance Control Panel

RDS
RDS

“Have you tried turning it off and on again?” That’s usually the quickest and the most efficient advice you can tell someone debugging a problem. Sometimes there are things between heaven an earth that can’t be explained but can be solved by restarting a server.

For these cases Buttonize brings RDSInstanceControlPanel construct. Let your L1 support or even non-technical colleagues handle the basic operations around RDS database instances.

Features

  • CPU Utilization chart for the past hour
  • Status information
    • Instance name
    • Instance status
    • Instance class
    • Engine version
    • Endpoint
    • Port
    • Publicly accessible
  • Actions
    • Start - calls StartDBInstance RDS API to start the instance if it’s stopped
    • Stop - calls StopDBInstance RDS API to stop the instance if it’s running
    • Reboot - calls RebootDBInstance RDS API to reboot the instance if it’s running

Preview

RDS Instance Control Panel App preview

Usage

In case you create RDS DB instance in CDK

lib/example-stack.ts
import * as cdk from 'aws-cdk-lib'
import { InstanceClass, InstanceSize, InstanceType, SubnetType, Vpc } from 'aws-cdk-lib/aws-ec2'
import { DatabaseInstance, DatabaseInstanceEngine } from 'aws-cdk-lib/aws-rds'
import { Buttonize } from 'buttonize/cdk'
import { RDSInstanceControlPanel } from 'buttonize/library'
import { Construct } from 'constructs'
export class CdkStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props)
Buttonize.init(this, { apiKey: 'YOUR_API_KEY' })
const defaultVpc = Vpc.fromLookup(this, 'VPC', { isDefault: true })
const instance = new DatabaseInstance(this, 'RdsInstance', {
engine: DatabaseInstanceEngine.POSTGRES,
vpc: defaultVpc,
instanceType: InstanceType.of(InstanceClass.T4G, InstanceSize.MICRO),
instanceIdentifier: 'my-little-test-buttonize-db',
vpcSubnets: {
subnetType: SubnetType.PUBLIC
}
})
new RDSInstanceControlPanel(this, 'ControlPanel', {
instance
})
}
}

In case you create RDS outside of the CDK scope and know only database instance’s ARN

lib/example-stack.ts
import * as cdk from 'aws-cdk-lib'
import { Buttonize } from 'buttonize/cdk'
import { RDSInstanceControlPanel } from 'buttonize/library'
import { Construct } from 'constructs'
export class CdkStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props)
Buttonize.init(this, { apiKey: 'YOUR_API_KEY' })
new RDSInstanceControlPanel(this, 'ControlPanel', {
instanceArn: 'arn:aws:rds:<region>:<account-number>:db:<instance-name>'
})
}
}
Setup
New repository
npx create-buttonize --template library/rds-instance-control-panel --api-key=YOUR_API_KEY
Existing repository
import { Buttonize } from 'buttonize/cdk'
import { RDSInstanceControlPanel } from 'buttonize/library'
Buttonize.init(this, { apiKey: 'YOUR_API_KEY' })
new RDSInstanceControlPanel(this, 'ControlPanel', {
instance: yourRdsDbInstance
})
Deploy
npx cdk deploy
Delete
npx cdk destroy
Package
npm buttonize
Source
github RDSInstanceControlPanel.ts
Additional resources

Buttonize X.com profile Buttonize GitHub profile

© 2024 Buttonize OÜ

With ❤️ made in 🇨🇿

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.