cdk-rds-sql 8.1.5__tar.gz → 8.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cdk-rds-sql
3
- Version: 8.1.5
3
+ Version: 8.2.0
4
4
  Summary: A CDK construct that allows creating roles or users and databases on Aurora Serverless PostgreSQL or MySQL/MariaDB clusters, as well as AWS DSQL clusters.
5
5
  Home-page: https://github.com/berenddeboer/cdk-rds-sql.git
6
6
  Author: Berend de Boer<berend@pobox.com>
@@ -172,6 +172,31 @@ has been created.
172
172
  If you want to make the role the owner of a new database, just specify
173
173
  the `databaseName` here, and create the database later.
174
174
 
175
+ ### Connection limit (MySQL/MariaDB)
176
+
177
+ Cap how many connections a MySQL or MariaDB user may open:
178
+
179
+ ```python
180
+ const role = new Role(this, "Role", {
181
+ provider: provider,
182
+ roleName: "myrole",
183
+ databaseName: "mydb",
184
+ maxUserConnections: 5,
185
+ })
186
+ ```
187
+
188
+ Create and update then run:
189
+
190
+ ```sql
191
+ ALTER USER 'myrole'@'%' WITH MAX_USER_CONNECTIONS 5
192
+ ```
193
+
194
+ Omit `maxUserConnections` to leave the user unlimited, which is the
195
+ existing behaviour. Omitting it does not clear a limit that was already
196
+ applied; set `0` to restore the server default (unlimited unless the
197
+ global `max_user_connections` is set). PostgreSQL and DSQL throw if
198
+ this property is set.
199
+
175
200
  ### IAM Authentication
176
201
 
177
202
  Instead of password-based authentication, you can create roles that
@@ -145,6 +145,31 @@ has been created.
145
145
  If you want to make the role the owner of a new database, just specify
146
146
  the `databaseName` here, and create the database later.
147
147
 
148
+ ### Connection limit (MySQL/MariaDB)
149
+
150
+ Cap how many connections a MySQL or MariaDB user may open:
151
+
152
+ ```python
153
+ const role = new Role(this, "Role", {
154
+ provider: provider,
155
+ roleName: "myrole",
156
+ databaseName: "mydb",
157
+ maxUserConnections: 5,
158
+ })
159
+ ```
160
+
161
+ Create and update then run:
162
+
163
+ ```sql
164
+ ALTER USER 'myrole'@'%' WITH MAX_USER_CONNECTIONS 5
165
+ ```
166
+
167
+ Omit `maxUserConnections` to leave the user unlimited, which is the
168
+ existing behaviour. Omitting it does not clear a limit that was already
169
+ applied; set `0` to restore the server default (unlimited unless the
170
+ global `max_user_connections` is set). PostgreSQL and DSQL throw if
171
+ this property is set.
172
+
148
173
  ### IAM Authentication
149
174
 
150
175
  Instead of password-based authentication, you can create roles that
@@ -5,7 +5,7 @@ kwargs = json.loads(
5
5
  """
6
6
  {
7
7
  "name": "cdk-rds-sql",
8
- "version": "8.1.5",
8
+ "version": "8.2.0",
9
9
  "description": "A CDK construct that allows creating roles or users and databases on Aurora Serverless PostgreSQL or MySQL/MariaDB clusters, as well as AWS DSQL clusters.",
10
10
  "license": "Apache-2.0",
11
11
  "url": "https://github.com/berenddeboer/cdk-rds-sql.git",
@@ -26,7 +26,7 @@ kwargs = json.loads(
26
26
  ],
27
27
  "package_data": {
28
28
  "cdk_rds_sql._jsii": [
29
- "cdk-rds-sql@8.1.5.jsii.tgz"
29
+ "cdk-rds-sql@8.2.0.jsii.tgz"
30
30
  ],
31
31
  "cdk_rds_sql": [
32
32
  "py.typed"
@@ -146,6 +146,31 @@ has been created.
146
146
  If you want to make the role the owner of a new database, just specify
147
147
  the `databaseName` here, and create the database later.
148
148
 
149
+ ### Connection limit (MySQL/MariaDB)
150
+
151
+ Cap how many connections a MySQL or MariaDB user may open:
152
+
153
+ ```python
154
+ const role = new Role(this, "Role", {
155
+ provider: provider,
156
+ roleName: "myrole",
157
+ databaseName: "mydb",
158
+ maxUserConnections: 5,
159
+ })
160
+ ```
161
+
162
+ Create and update then run:
163
+
164
+ ```sql
165
+ ALTER USER 'myrole'@'%' WITH MAX_USER_CONNECTIONS 5
166
+ ```
167
+
168
+ Omit `maxUserConnections` to leave the user unlimited, which is the
169
+ existing behaviour. Omitting it does not clear a limit that was already
170
+ applied; set `0` to restore the server default (unlimited unless the
171
+ global `max_user_connections` is set). PostgreSQL and DSQL throw if
172
+ this property is set.
173
+
149
174
  ### IAM Authentication
150
175
 
151
176
  Instead of password-based authentication, you can create roles that
@@ -1314,6 +1339,7 @@ class Role(
1314
1339
  database_name: typing.Optional[builtins.str] = None,
1315
1340
  enable_iam_auth: typing.Optional[builtins.bool] = None,
1316
1341
  encryption_key: typing.Optional["_aws_cdk_aws_kms_ceddda9d.IKey"] = None,
1342
+ max_user_connections: typing.Optional[jsii.Number] = None,
1317
1343
  parameter_prefix: typing.Optional[builtins.str] = None,
1318
1344
  secret_name: typing.Optional[builtins.str] = None,
1319
1345
  ) -> None:
@@ -1326,6 +1352,7 @@ class Role(
1326
1352
  :param database_name: Optional database name this user is expected to use. If the database exists, connect privileges are granted. Specify one of ``database`` or ``databaseName``. This is the name that will be stored in the role's secret as the database name to use.
1327
1353
  :param enable_iam_auth: Enable IAM authentication for this role. When enabled, the role will be created without a password and configured for AWS IAM database authentication. No secret will be created for this role. Note: For DSQL clusters, this property is ignored as DSQL always uses IAM authentication. Default: false - use password authentication
1328
1354
  :param encryption_key: A new secret is created for this user. Optionally encrypt it with the given key.
1355
+ :param max_user_connections: Maximum simultaneous connections for this MySQL/MariaDB user. When set, create and update run ``ALTER USER '<roleName>'@'%' WITH MAX_USER_CONNECTIONS <n>``. A later change, including a smaller number, is applied on update. ``0`` restores the server default (unlimited unless the global ``max_user_connections`` is set). Omit the property to leave the user unlimited. Omitting it does not clear a limit that was already applied; set ``0`` to do that. PostgreSQL and DSQL do not support this property and throw if it is set. Default: undefined - no connection limit is applied
1329
1356
  :param parameter_prefix: Prefix for SSM parameters to store credentials in Parameter Store. When defined, credentials will also be stored as parameters. The parameter names such as "password" is simply appended to ``parameterPrefix``, so make sure the prefix ends with a slash if you have your parameter names slash separated. The password parameter is refreshed when CloudFormation updates the generated secret resource. Default: - credentials are only stored in Secrets Manager
1330
1357
  :param secret_name: A new secret is created for this user. Optionally add secret name to the secret.
1331
1358
  '''
@@ -1340,6 +1367,7 @@ class Role(
1340
1367
  database_name=database_name,
1341
1368
  enable_iam_auth=enable_iam_auth,
1342
1369
  encryption_key=encryption_key,
1370
+ max_user_connections=max_user_connections,
1343
1371
  parameter_prefix=parameter_prefix,
1344
1372
  secret_name=secret_name,
1345
1373
  )
@@ -1378,6 +1406,7 @@ class Role(
1378
1406
  "database_name": "databaseName",
1379
1407
  "enable_iam_auth": "enableIamAuth",
1380
1408
  "encryption_key": "encryptionKey",
1409
+ "max_user_connections": "maxUserConnections",
1381
1410
  "parameter_prefix": "parameterPrefix",
1382
1411
  "secret_name": "secretName",
1383
1412
  },
@@ -1392,6 +1421,7 @@ class RoleProps:
1392
1421
  database_name: typing.Optional[builtins.str] = None,
1393
1422
  enable_iam_auth: typing.Optional[builtins.bool] = None,
1394
1423
  encryption_key: typing.Optional["_aws_cdk_aws_kms_ceddda9d.IKey"] = None,
1424
+ max_user_connections: typing.Optional[jsii.Number] = None,
1395
1425
  parameter_prefix: typing.Optional[builtins.str] = None,
1396
1426
  secret_name: typing.Optional[builtins.str] = None,
1397
1427
  ) -> None:
@@ -1402,6 +1432,7 @@ class RoleProps:
1402
1432
  :param database_name: Optional database name this user is expected to use. If the database exists, connect privileges are granted. Specify one of ``database`` or ``databaseName``. This is the name that will be stored in the role's secret as the database name to use.
1403
1433
  :param enable_iam_auth: Enable IAM authentication for this role. When enabled, the role will be created without a password and configured for AWS IAM database authentication. No secret will be created for this role. Note: For DSQL clusters, this property is ignored as DSQL always uses IAM authentication. Default: false - use password authentication
1404
1434
  :param encryption_key: A new secret is created for this user. Optionally encrypt it with the given key.
1435
+ :param max_user_connections: Maximum simultaneous connections for this MySQL/MariaDB user. When set, create and update run ``ALTER USER '<roleName>'@'%' WITH MAX_USER_CONNECTIONS <n>``. A later change, including a smaller number, is applied on update. ``0`` restores the server default (unlimited unless the global ``max_user_connections`` is set). Omit the property to leave the user unlimited. Omitting it does not clear a limit that was already applied; set ``0`` to do that. PostgreSQL and DSQL do not support this property and throw if it is set. Default: undefined - no connection limit is applied
1405
1436
  :param parameter_prefix: Prefix for SSM parameters to store credentials in Parameter Store. When defined, credentials will also be stored as parameters. The parameter names such as "password" is simply appended to ``parameterPrefix``, so make sure the prefix ends with a slash if you have your parameter names slash separated. The password parameter is refreshed when CloudFormation updates the generated secret resource. Default: - credentials are only stored in Secrets Manager
1406
1437
  :param secret_name: A new secret is created for this user. Optionally add secret name to the secret.
1407
1438
  '''
@@ -1413,6 +1444,7 @@ class RoleProps:
1413
1444
  check_type(argname="argument database_name", value=database_name, expected_type=type_hints["database_name"])
1414
1445
  check_type(argname="argument enable_iam_auth", value=enable_iam_auth, expected_type=type_hints["enable_iam_auth"])
1415
1446
  check_type(argname="argument encryption_key", value=encryption_key, expected_type=type_hints["encryption_key"])
1447
+ check_type(argname="argument max_user_connections", value=max_user_connections, expected_type=type_hints["max_user_connections"])
1416
1448
  check_type(argname="argument parameter_prefix", value=parameter_prefix, expected_type=type_hints["parameter_prefix"])
1417
1449
  check_type(argname="argument secret_name", value=secret_name, expected_type=type_hints["secret_name"])
1418
1450
  self._values: typing.Dict[builtins.str, typing.Any] = {
@@ -1427,6 +1459,8 @@ class RoleProps:
1427
1459
  self._values["enable_iam_auth"] = enable_iam_auth
1428
1460
  if encryption_key is not None:
1429
1461
  self._values["encryption_key"] = encryption_key
1462
+ if max_user_connections is not None:
1463
+ self._values["max_user_connections"] = max_user_connections
1430
1464
  if parameter_prefix is not None:
1431
1465
  self._values["parameter_prefix"] = parameter_prefix
1432
1466
  if secret_name is not None:
@@ -1497,6 +1531,26 @@ class RoleProps:
1497
1531
  result = self._values.get("encryption_key")
1498
1532
  return typing.cast(typing.Optional["_aws_cdk_aws_kms_ceddda9d.IKey"], result)
1499
1533
 
1534
+ @builtins.property
1535
+ def max_user_connections(self) -> typing.Optional[jsii.Number]:
1536
+ '''Maximum simultaneous connections for this MySQL/MariaDB user.
1537
+
1538
+ When set, create and update run
1539
+ ``ALTER USER '<roleName>'@'%' WITH MAX_USER_CONNECTIONS <n>``.
1540
+ A later change, including a smaller number, is applied on update.
1541
+ ``0`` restores the server default (unlimited unless the global
1542
+ ``max_user_connections`` is set).
1543
+
1544
+ Omit the property to leave the user unlimited. Omitting it does not
1545
+ clear a limit that was already applied; set ``0`` to do that.
1546
+
1547
+ PostgreSQL and DSQL do not support this property and throw if it is set.
1548
+
1549
+ :default: undefined - no connection limit is applied
1550
+ '''
1551
+ result = self._values.get("max_user_connections")
1552
+ return typing.cast(typing.Optional[jsii.Number], result)
1553
+
1500
1554
  @builtins.property
1501
1555
  def parameter_prefix(self) -> typing.Optional[builtins.str]:
1502
1556
  '''Prefix for SSM parameters to store credentials in Parameter Store. When defined, credentials will also be stored as parameters.
@@ -1966,6 +2020,7 @@ def _typecheckingstub__062afab8717d46f6fc2a31188b28d9e663190b2080174cc7f1ddd691f
1966
2020
  database_name: typing.Optional[builtins.str] = None,
1967
2021
  enable_iam_auth: typing.Optional[builtins.bool] = None,
1968
2022
  encryption_key: typing.Optional[_aws_cdk_aws_kms_ceddda9d.IKey] = None,
2023
+ max_user_connections: typing.Optional[jsii.Number] = None,
1969
2024
  parameter_prefix: typing.Optional[builtins.str] = None,
1970
2025
  secret_name: typing.Optional[builtins.str] = None,
1971
2026
  ) -> None:
@@ -1980,6 +2035,7 @@ def _typecheckingstub__a7ed79cdb7903207b3240698f6bcb0582905979c1519e2b49d66fa6fb
1980
2035
  database_name: typing.Optional[builtins.str] = None,
1981
2036
  enable_iam_auth: typing.Optional[builtins.bool] = None,
1982
2037
  encryption_key: typing.Optional[_aws_cdk_aws_kms_ceddda9d.IKey] = None,
2038
+ max_user_connections: typing.Optional[jsii.Number] = None,
1983
2039
  parameter_prefix: typing.Optional[builtins.str] = None,
1984
2040
  secret_name: typing.Optional[builtins.str] = None,
1985
2041
  ) -> None:
@@ -32,7 +32,7 @@ import aws_cdk._jsii
32
32
  import constructs._jsii
33
33
 
34
34
  __jsii_assembly__ = jsii.JSIIAssembly.load(
35
- "cdk-rds-sql", "8.1.5", __name__[0:-6], "cdk-rds-sql@8.1.5.jsii.tgz"
35
+ "cdk-rds-sql", "8.2.0", __name__[0:-6], "cdk-rds-sql@8.2.0.jsii.tgz"
36
36
  )
37
37
 
38
38
  __all__ = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cdk-rds-sql
3
- Version: 8.1.5
3
+ Version: 8.2.0
4
4
  Summary: A CDK construct that allows creating roles or users and databases on Aurora Serverless PostgreSQL or MySQL/MariaDB clusters, as well as AWS DSQL clusters.
5
5
  Home-page: https://github.com/berenddeboer/cdk-rds-sql.git
6
6
  Author: Berend de Boer<berend@pobox.com>
@@ -172,6 +172,31 @@ has been created.
172
172
  If you want to make the role the owner of a new database, just specify
173
173
  the `databaseName` here, and create the database later.
174
174
 
175
+ ### Connection limit (MySQL/MariaDB)
176
+
177
+ Cap how many connections a MySQL or MariaDB user may open:
178
+
179
+ ```python
180
+ const role = new Role(this, "Role", {
181
+ provider: provider,
182
+ roleName: "myrole",
183
+ databaseName: "mydb",
184
+ maxUserConnections: 5,
185
+ })
186
+ ```
187
+
188
+ Create and update then run:
189
+
190
+ ```sql
191
+ ALTER USER 'myrole'@'%' WITH MAX_USER_CONNECTIONS 5
192
+ ```
193
+
194
+ Omit `maxUserConnections` to leave the user unlimited, which is the
195
+ existing behaviour. Omitting it does not clear a limit that was already
196
+ applied; set `0` to restore the server default (unlimited unless the
197
+ global `max_user_connections` is set). PostgreSQL and DSQL throw if
198
+ this property is set.
199
+
175
200
  ### IAM Authentication
176
201
 
177
202
  Instead of password-based authentication, you can create roles that
@@ -11,4 +11,4 @@ src/cdk_rds_sql.egg-info/dependency_links.txt
11
11
  src/cdk_rds_sql.egg-info/requires.txt
12
12
  src/cdk_rds_sql.egg-info/top_level.txt
13
13
  src/cdk_rds_sql/_jsii/__init__.py
14
- src/cdk_rds_sql/_jsii/cdk-rds-sql@8.1.5.jsii.tgz
14
+ src/cdk_rds_sql/_jsii/cdk-rds-sql@8.2.0.jsii.tgz
File without changes
File without changes
File without changes
File without changes