Skip to content

Commit 908fa86

Browse files
author
Edward Keeble
committed
Allow passing a subnet selection instead of a subnet type to the create_database_server function
1 parent 84dca4f commit 908fa86

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

.vscode/settings.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
2-
"python.analysis.diagnosticMode": "workspace",
3-
"python.analysis.typeCheckingMode": "basic",
4-
"python.formatting.provider": "black",
5-
"python.testing.pytestEnabled": true,
6-
"editor.formatOnSave": true
7-
}
2+
"python.analysis.diagnosticMode": "workspace",
3+
"python.analysis.typeCheckingMode": "basic",
4+
"python.formatting.provider": "black",
5+
"python.testing.pytestEnabled": true,
6+
"editor.formatOnSave": true,
7+
"[python]": {
8+
"editor.defaultFormatter": "ms-python.black-formatter"
9+
}
10+
}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.0
1+
2.0.0

cdk_bootstrapped_db/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def create_database_server(
99
scope: Construct,
1010
id: str,
1111
vpc: ec2.IVpc,
12-
subnet_type: ec2.SubnetType,
12+
subnet_selection: ec2.SubnetSelection,
1313
deletion_protect: bool,
1414
db_name: Optional[str] = None,
1515
db_snapshot_arn: Optional[str] = None,
@@ -38,7 +38,7 @@ def create_database_server(
3838
"instance_identifier": "-".join(
3939
[v for v in [Stack.of(scope).stack_name, identifier] if v]
4040
),
41-
"vpc_subnets": {"subnet_type": subnet_type},
41+
"vpc_subnets": subnet_selection,
4242
"deletion_protection": deletion_protect,
4343
"removal_policy": (
4444
RemovalPolicy.SNAPSHOT if deletion_protect else RemovalPolicy.DESTROY

0 commit comments

Comments
 (0)