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

fix(python/rds): update to new API #320

Merged
merged 1 commit into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ def __init__(self, scope: core.Construct, id: str, props, **kwargs) -> None:
my_sql = rds.DatabaseInstance(
self, "RDS",
master_username="test",
engine_version="8.0.16",
engine=rds.DatabaseInstanceEngine.MYSQL,
engine=rds.DatabaseInstanceEngine.mysql(
version=rds.MysqlEngineVersion.VER_8_0_16
),
vpc=props['vpc'],
port=3306,
instance_type=ec2.InstanceType.of(
Expand Down
10 changes: 6 additions & 4 deletions python/new-vpc-alb-asg-mysql/cdk_vpc_ec2/cdk_rds_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ def __init__(self, scope: core.Construct, id: str, vpc, asg_security_groups, **k
# Secrets Manager auto generate and keep the password, don't put password in cdk code directly
# db_Aurora_cluster = rds.DatabaseCluster(self, "MyAurora",
# default_database_name="MyAurora",
# engine=rds.DatabaseClusterEngine.AURORA_MYSQL,
# engine_version="5.7.12",
# engine=rds.DatabaseClusterEngine.arora_mysql(
# version=rds.AuroraMysqlEngineVersion.VER_5_7_12
# )
# master_user=rds.Login(username="admin"),
# instance_props=rds.InstanceProps(
# vpc=vpc,
Expand All @@ -31,8 +32,9 @@ def __init__(self, scope: core.Construct, id: str, vpc, asg_security_groups, **k

# Alternatively, create MySQL RDS with CDK High Level API
db_mysql_easy = rds.DatabaseInstance(self, "MySQL_DB_easy",
engine=rds.DatabaseInstanceEngine.MYSQL,
engine_version="5.7.22",
engine=rds.DatabaseInstanceEngine.mysql(
version=rds.MysqlEngineVersion.VER_5_7_30
),
instance_type=ec2.InstanceType.of(
ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL),
master_username="admin",
Expand Down
5 changes: 3 additions & 2 deletions python/rds/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ def __init__(self, app: core.App, id: str, **kwargs) -> None:
master_username="master",
master_user_password=core.SecretValue.plain_text("password"),
database_name="db1",
engine_version="8.0.16",
engine=rds.DatabaseInstanceEngine.MYSQL,
engine=rds.DatabaseInstanceEngine.mysql(
version=rds.MysqlEngineVersion.VER_8_0_16
),
vpc=vpc,
port=3306,
instance_type= ec2.InstanceType.of(
Expand Down