Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit b0fca07

Browse files
committed
feat: add rds control panel
1 parent 69acd98 commit b0fca07

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { extend, extract } from '../../../src/index.js'
2+
3+
export default [extend('presets/base/typescript-cdk'), extract()]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<p align="center">
2+
<a href="https://buttonize.io">
3+
<img width="350" alt="Buttonize.io" src="https://user-images.githubusercontent.com/6282843/212024942-9fd50774-ea26-48ba-b2cf-ca2584498c9a.png">
4+
</a>
5+
</p>
6+
7+
---
8+
9+
## RDS Instance Control Panel
10+
11+
[![RDS Instance Control Panel](https://github.com/buttonize/create-buttonize/assets/6282843/2b47ee3d-d4c6-442a-a366-acfc35765ab9)](https://buttonize.io/library/rds-instance-control-panel)
12+
13+
Learn more about RDS Instance Control Panel Construct [here](https://buttonize.io/library/rds-instance-control-panel).
14+
15+
## CDK
16+
17+
The `cdk.json` file tells the CDK Toolkit how to execute your app.
18+
19+
### Useful commands
20+
21+
* `npm run build` compile typescript to js
22+
* `npm run watch` watch for changes and compile
23+
* `npx cdk deploy` deploy this stack to your default AWS account/region
24+
* `npx cdk diff` compare deployed stack with current state
25+
* `npx cdk synth` emits the synthesized CloudFormation template
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import * as cdk from 'aws-cdk-lib'
2+
import {
3+
InstanceClass,
4+
InstanceSize,
5+
InstanceType,
6+
SubnetType,
7+
Vpc
8+
} from 'aws-cdk-lib/aws-ec2'
9+
import { DatabaseInstance, DatabaseInstanceEngine } from 'aws-cdk-lib/aws-rds'
10+
import { Buttonize } from 'buttonize/cdk'
11+
import { RDSInstanceControlPanel } from 'buttonize/library'
12+
import { Construct } from 'constructs'
13+
14+
export class ExampleStack extends cdk.Stack {
15+
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
16+
super(scope, id, props)
17+
18+
Buttonize.init(this, {
19+
apiKey: '@@apiKey'
20+
})
21+
22+
const defaultVpc = Vpc.fromLookup(this, 'VPC', { isDefault: true })
23+
24+
const instance = new DatabaseInstance(this, 'RdsInstance', {
25+
engine: DatabaseInstanceEngine.POSTGRES,
26+
vpc: defaultVpc,
27+
instanceType: InstanceType.of(InstanceClass.T4G, InstanceSize.MICRO),
28+
removalPolicy: cdk.RemovalPolicy.DESTROY,
29+
instanceIdentifier: 'my-little-test-buttonize-db',
30+
vpcSubnets: {
31+
subnetType: SubnetType.PUBLIC // Publicly accessible instance
32+
}
33+
})
34+
35+
new RDSInstanceControlPanel(this, 'ControlPanel', {
36+
instance
37+
})
38+
}
39+
}

0 commit comments

Comments
 (0)