Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add RDS Sample #158

Merged
merged 7 commits into from
Nov 26, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions python/rds/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env python3

from aws_cdk import (
aws_ec2 as ec2,
aws_rds as rds,
core
wingkwong marked this conversation as resolved.
Show resolved Hide resolved
)


class RDSStack(core.Stack):
def __init__(self, app: core.App, id: str, **kwargs) -> None:
super().__init__(app, id, **kwargs)

vpc = ec2.Vpc(self, "VPC")

rds.DatabaseInstance(
self, "RDS",
master_username="master",
master_user_password=core.SecretValue("password"),
wingkwong marked this conversation as resolved.
Show resolved Hide resolved
database_name="db1",
engine_version="8.0.16",
engine=rds.DatabaseInstanceEngine.MYSQL,
vpc=vpc,
port=3306,
instance_class=ec2.InstanceType.of(
ec2.InstanceClass.MEMORY4,
ec2.InstanceSize.LARGE
wingkwong marked this conversation as resolved.
Show resolved Hide resolved
),
removal_policy=core.RemovalPolicy.DESTROY,
wingkwong marked this conversation as resolved.
Show resolved Hide resolved
wingkwong marked this conversation as resolved.
Show resolved Hide resolved
),
wingkwong marked this conversation as resolved.
Show resolved Hide resolved


app = core.App()
RDSStack(app, "RDSStack")
app.synth()
3 changes: 3 additions & 0 deletions python/rds/cdk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"app": "python3 app.py"
}
3 changes: 3 additions & 0 deletions python/rds/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
aws-cdk.core
aws-cdk.aws-ec2
aws-cdk.aws-rds