Skip to content

Commit

Permalink
fix(python/rds): update to new API (aws-samples#320)
Browse files Browse the repository at this point in the history
Upgrades to the engine version specification from the RDS package.
  • Loading branch information
njlynch authored Jul 29, 2020
1 parent e8acc44 commit d1ae185
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
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

0 comments on commit d1ae185

Please sign in to comment.