cdk-rds-sql 8.1.6__tar.gz → 9.0.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.
- {cdk_rds_sql-8.1.6 → cdk_rds_sql-9.0.0}/PKG-INFO +63 -14
- cdk_rds_sql-8.1.6/src/cdk_rds_sql.egg-info/PKG-INFO → cdk_rds_sql-9.0.0/README.md +55 -34
- {cdk_rds_sql-8.1.6 → cdk_rds_sql-9.0.0}/pyproject.toml +2 -2
- {cdk_rds_sql-8.1.6 → cdk_rds_sql-9.0.0}/setup.py +10 -9
- {cdk_rds_sql-8.1.6 → cdk_rds_sql-9.0.0}/src/cdk_rds_sql/__init__.py +136 -47
- cdk_rds_sql-9.0.0/src/cdk_rds_sql/_jsii/__init__.py +28 -0
- cdk_rds_sql-9.0.0/src/cdk_rds_sql/_jsii/cdk-rds-sql@9.0.0.jsii.tgz +0 -0
- cdk_rds_sql-8.1.6/README.md → cdk_rds_sql-9.0.0/src/cdk_rds_sql.egg-info/PKG-INFO +83 -7
- {cdk_rds_sql-8.1.6 → cdk_rds_sql-9.0.0}/src/cdk_rds_sql.egg-info/SOURCES.txt +1 -1
- cdk_rds_sql-9.0.0/src/cdk_rds_sql.egg-info/requires.txt +4 -0
- cdk_rds_sql-8.1.6/src/cdk_rds_sql/_jsii/__init__.py +0 -42
- cdk_rds_sql-8.1.6/src/cdk_rds_sql/_jsii/cdk-rds-sql@8.1.6.jsii.tgz +0 -0
- cdk_rds_sql-8.1.6/src/cdk_rds_sql.egg-info/requires.txt +0 -5
- {cdk_rds_sql-8.1.6 → cdk_rds_sql-9.0.0}/LICENSE +0 -0
- {cdk_rds_sql-8.1.6 → cdk_rds_sql-9.0.0}/MANIFEST.in +0 -0
- {cdk_rds_sql-8.1.6 → cdk_rds_sql-9.0.0}/setup.cfg +0 -0
- {cdk_rds_sql-8.1.6 → cdk_rds_sql-9.0.0}/src/cdk_rds_sql/py.typed +0 -0
- {cdk_rds_sql-8.1.6 → cdk_rds_sql-9.0.0}/src/cdk_rds_sql.egg-info/dependency_links.txt +0 -0
- {cdk_rds_sql-8.1.6 → cdk_rds_sql-9.0.0}/src/cdk_rds_sql.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cdk-rds-sql
|
|
3
|
-
Version:
|
|
3
|
+
Version: 9.0.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>
|
|
@@ -10,20 +10,21 @@ Classifier: Intended Audience :: Developers
|
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
11
|
Classifier: Programming Language :: JavaScript
|
|
12
12
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
18
|
Classifier: Typing :: Typed
|
|
17
19
|
Classifier: Development Status :: 5 - Production/Stable
|
|
18
20
|
Classifier: License :: OSI Approved
|
|
19
|
-
Requires-Python:
|
|
21
|
+
Requires-Python: >=3.10
|
|
20
22
|
Description-Content-Type: text/markdown
|
|
21
23
|
License-File: LICENSE
|
|
22
|
-
Requires-Dist: aws-cdk-lib<3.0.0,>=2.
|
|
23
|
-
Requires-Dist: constructs<11.0.0,>=10.
|
|
24
|
-
Requires-Dist: jsii<2.0.0,>=1.
|
|
24
|
+
Requires-Dist: aws-cdk-lib<3.0.0,>=2.273.0
|
|
25
|
+
Requires-Dist: constructs<11.0.0,>=10.5.0
|
|
26
|
+
Requires-Dist: jsii<2.0.0,>=1.141.0
|
|
25
27
|
Requires-Dist: publication>=0.0.3
|
|
26
|
-
Requires-Dist: typeguard==2.13.3
|
|
27
28
|
|
|
28
29
|
# About
|
|
29
30
|
|
|
@@ -43,6 +44,8 @@ environments, and works in isolated subnets.
|
|
|
43
44
|
# Requirements
|
|
44
45
|
|
|
45
46
|
* CDK v2.
|
|
47
|
+
* Node.js 22.14 or newer for consumers, as declared in `package.json`'s `engines`.
|
|
48
|
+
This is the library's supported minimum, independent of its development tools.
|
|
46
49
|
|
|
47
50
|
# Installation
|
|
48
51
|
|
|
@@ -172,6 +175,31 @@ has been created.
|
|
|
172
175
|
If you want to make the role the owner of a new database, just specify
|
|
173
176
|
the `databaseName` here, and create the database later.
|
|
174
177
|
|
|
178
|
+
### Connection limit (MySQL/MariaDB)
|
|
179
|
+
|
|
180
|
+
Cap how many connections a MySQL or MariaDB user may open:
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
const role = new Role(this, "Role", {
|
|
184
|
+
provider: provider,
|
|
185
|
+
roleName: "myrole",
|
|
186
|
+
databaseName: "mydb",
|
|
187
|
+
maxUserConnections: 5,
|
|
188
|
+
})
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Create and update then run:
|
|
192
|
+
|
|
193
|
+
```sql
|
|
194
|
+
ALTER USER 'myrole'@'%' WITH MAX_USER_CONNECTIONS 5
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Omit `maxUserConnections` to leave the user unlimited, which is the
|
|
198
|
+
existing behaviour. Omitting it does not clear a limit that was already
|
|
199
|
+
applied; set `0` to restore the server default (unlimited unless the
|
|
200
|
+
global `max_user_connections` is set). PostgreSQL and DSQL throw if
|
|
201
|
+
this property is set.
|
|
202
|
+
|
|
175
203
|
### IAM Authentication
|
|
176
204
|
|
|
177
205
|
Instead of password-based authentication, you can create roles that
|
|
@@ -546,17 +574,35 @@ const provider = new Provider(this, "Provider", {
|
|
|
546
574
|
|
|
547
575
|
# Working on this code
|
|
548
576
|
|
|
549
|
-
This code is managed by
|
|
550
|
-
[
|
|
551
|
-
|
|
577
|
+
This code is managed by [projen](https://github.com/projen/projen).
|
|
578
|
+
[mise](https://mise.jdx.dev/) installs Node 24, pnpm 12, and
|
|
579
|
+
[hk](https://hk.jdx.dev/) for Git hooks. Biome handles formatting and linting.
|
|
552
580
|
|
|
553
|
-
|
|
581
|
+
Development and CI use Node 24. Testcontainers is a development-only dependency;
|
|
582
|
+
its dependency tree requires newer APIs than the consumer minimum of Node 22.14.
|
|
554
583
|
|
|
584
|
+
After cloning:
|
|
585
|
+
|
|
586
|
+
```sh
|
|
587
|
+
mise trust
|
|
588
|
+
mise install
|
|
589
|
+
mise run setup
|
|
555
590
|
```
|
|
556
|
-
pre-commit install --install-hooks --hook-type commit-msg --hook-type pre-commit
|
|
557
|
-
```
|
|
558
591
|
|
|
559
|
-
|
|
592
|
+
When migrating an existing clone, replace the old pre-commit hooks with
|
|
593
|
+
`mise exec -- hk install --mise --force`.
|
|
594
|
+
|
|
595
|
+
Run all checks with `mise run check`, or format and lint with
|
|
596
|
+
`pnpm exec projen biome`. Tests require Docker. TypeScript stays on the
|
|
597
|
+
6.0 release line supported by jsii 6.0.
|
|
598
|
+
|
|
599
|
+
The pre-commit hook runs the full build, tests, and packaging, so Docker must
|
|
600
|
+
be running. When `VPC_ID` is set, changes under `src/` also run CDK synthesis
|
|
601
|
+
against that VPC; this requires AWS credentials. Unset `VPC_ID` to skip synthesis.
|
|
602
|
+
|
|
603
|
+
The development tsconfig uses `node16` module resolution, including package
|
|
604
|
+
exports. Jest tasks enable Node's VM module support for native dynamic imports
|
|
605
|
+
such as the MySQL driver import.
|
|
560
606
|
|
|
561
607
|
## Testing
|
|
562
608
|
|
|
@@ -566,6 +612,9 @@ Test code via projen with:
|
|
|
566
612
|
pnpm exec projen test
|
|
567
613
|
```
|
|
568
614
|
|
|
615
|
+
Tests do not update snapshots automatically. To intentionally refresh them, run
|
|
616
|
+
`pnpm exec projen test:update` and review the snapshot diff.
|
|
617
|
+
|
|
569
618
|
You can run the PostgreSQL sample stack with:
|
|
570
619
|
|
|
571
620
|
```
|
|
@@ -1,30 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: cdk-rds-sql
|
|
3
|
-
Version: 8.1.6
|
|
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
|
-
Home-page: https://github.com/berenddeboer/cdk-rds-sql.git
|
|
6
|
-
Author: Berend de Boer<berend@pobox.com>
|
|
7
|
-
License: Apache-2.0
|
|
8
|
-
Project-URL: Source, https://github.com/berenddeboer/cdk-rds-sql.git
|
|
9
|
-
Classifier: Intended Audience :: Developers
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Classifier: Programming Language :: JavaScript
|
|
12
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
-
Classifier: Typing :: Typed
|
|
17
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
18
|
-
Classifier: License :: OSI Approved
|
|
19
|
-
Requires-Python: ~=3.9
|
|
20
|
-
Description-Content-Type: text/markdown
|
|
21
|
-
License-File: LICENSE
|
|
22
|
-
Requires-Dist: aws-cdk-lib<3.0.0,>=2.214.0
|
|
23
|
-
Requires-Dist: constructs<11.0.0,>=10.4.2
|
|
24
|
-
Requires-Dist: jsii<2.0.0,>=1.129.0
|
|
25
|
-
Requires-Dist: publication>=0.0.3
|
|
26
|
-
Requires-Dist: typeguard==2.13.3
|
|
27
|
-
|
|
28
1
|
# About
|
|
29
2
|
|
|
30
3
|
This CDK construct library makes it possible to create databases,
|
|
@@ -43,6 +16,8 @@ environments, and works in isolated subnets.
|
|
|
43
16
|
# Requirements
|
|
44
17
|
|
|
45
18
|
* CDK v2.
|
|
19
|
+
* Node.js 22.14 or newer for consumers, as declared in `package.json`'s `engines`.
|
|
20
|
+
This is the library's supported minimum, independent of its development tools.
|
|
46
21
|
|
|
47
22
|
# Installation
|
|
48
23
|
|
|
@@ -172,6 +147,31 @@ has been created.
|
|
|
172
147
|
If you want to make the role the owner of a new database, just specify
|
|
173
148
|
the `databaseName` here, and create the database later.
|
|
174
149
|
|
|
150
|
+
### Connection limit (MySQL/MariaDB)
|
|
151
|
+
|
|
152
|
+
Cap how many connections a MySQL or MariaDB user may open:
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
const role = new Role(this, "Role", {
|
|
156
|
+
provider: provider,
|
|
157
|
+
roleName: "myrole",
|
|
158
|
+
databaseName: "mydb",
|
|
159
|
+
maxUserConnections: 5,
|
|
160
|
+
})
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Create and update then run:
|
|
164
|
+
|
|
165
|
+
```sql
|
|
166
|
+
ALTER USER 'myrole'@'%' WITH MAX_USER_CONNECTIONS 5
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Omit `maxUserConnections` to leave the user unlimited, which is the
|
|
170
|
+
existing behaviour. Omitting it does not clear a limit that was already
|
|
171
|
+
applied; set `0` to restore the server default (unlimited unless the
|
|
172
|
+
global `max_user_connections` is set). PostgreSQL and DSQL throw if
|
|
173
|
+
this property is set.
|
|
174
|
+
|
|
175
175
|
### IAM Authentication
|
|
176
176
|
|
|
177
177
|
Instead of password-based authentication, you can create roles that
|
|
@@ -546,17 +546,35 @@ const provider = new Provider(this, "Provider", {
|
|
|
546
546
|
|
|
547
547
|
# Working on this code
|
|
548
548
|
|
|
549
|
-
This code is managed by
|
|
550
|
-
[
|
|
551
|
-
|
|
549
|
+
This code is managed by [projen](https://github.com/projen/projen).
|
|
550
|
+
[mise](https://mise.jdx.dev/) installs Node 24, pnpm 12, and
|
|
551
|
+
[hk](https://hk.jdx.dev/) for Git hooks. Biome handles formatting and linting.
|
|
552
552
|
|
|
553
|
-
|
|
553
|
+
Development and CI use Node 24. Testcontainers is a development-only dependency;
|
|
554
|
+
its dependency tree requires newer APIs than the consumer minimum of Node 22.14.
|
|
554
555
|
|
|
556
|
+
After cloning:
|
|
557
|
+
|
|
558
|
+
```sh
|
|
559
|
+
mise trust
|
|
560
|
+
mise install
|
|
561
|
+
mise run setup
|
|
555
562
|
```
|
|
556
|
-
pre-commit install --install-hooks --hook-type commit-msg --hook-type pre-commit
|
|
557
|
-
```
|
|
558
563
|
|
|
559
|
-
|
|
564
|
+
When migrating an existing clone, replace the old pre-commit hooks with
|
|
565
|
+
`mise exec -- hk install --mise --force`.
|
|
566
|
+
|
|
567
|
+
Run all checks with `mise run check`, or format and lint with
|
|
568
|
+
`pnpm exec projen biome`. Tests require Docker. TypeScript stays on the
|
|
569
|
+
6.0 release line supported by jsii 6.0.
|
|
570
|
+
|
|
571
|
+
The pre-commit hook runs the full build, tests, and packaging, so Docker must
|
|
572
|
+
be running. When `VPC_ID` is set, changes under `src/` also run CDK synthesis
|
|
573
|
+
against that VPC; this requires AWS credentials. Unset `VPC_ID` to skip synthesis.
|
|
574
|
+
|
|
575
|
+
The development tsconfig uses `node16` module resolution, including package
|
|
576
|
+
exports. Jest tasks enable Node's VM module support for native dynamic imports
|
|
577
|
+
such as the MySQL driver import.
|
|
560
578
|
|
|
561
579
|
## Testing
|
|
562
580
|
|
|
@@ -566,6 +584,9 @@ Test code via projen with:
|
|
|
566
584
|
pnpm exec projen test
|
|
567
585
|
```
|
|
568
586
|
|
|
587
|
+
Tests do not update snapshots automatically. To intentionally refresh them, run
|
|
588
|
+
`pnpm exec projen test:update` and review the snapshot diff.
|
|
589
|
+
|
|
569
590
|
You can run the PostgreSQL sample stack with:
|
|
570
591
|
|
|
571
592
|
```
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools~=75.3.2", "build~=1.
|
|
2
|
+
requires = ["setuptools~=75.3.2", "build~=1.6.1"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[tool.pyright]
|
|
6
6
|
defineConstant = { DEBUG = true }
|
|
7
|
-
pythonVersion = "3.
|
|
7
|
+
pythonVersion = "3.10"
|
|
8
8
|
pythonPlatform = "All"
|
|
9
9
|
reportSelfClsParameterName = false
|
|
@@ -5,7 +5,7 @@ kwargs = json.loads(
|
|
|
5
5
|
"""
|
|
6
6
|
{
|
|
7
7
|
"name": "cdk-rds-sql",
|
|
8
|
-
"version": "
|
|
8
|
+
"version": "9.0.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,28 +26,29 @@ kwargs = json.loads(
|
|
|
26
26
|
],
|
|
27
27
|
"package_data": {
|
|
28
28
|
"cdk_rds_sql._jsii": [
|
|
29
|
-
"cdk-rds-sql@
|
|
29
|
+
"cdk-rds-sql@9.0.0.jsii.tgz"
|
|
30
30
|
],
|
|
31
31
|
"cdk_rds_sql": [
|
|
32
32
|
"py.typed"
|
|
33
33
|
]
|
|
34
34
|
},
|
|
35
|
-
"python_requires": "
|
|
35
|
+
"python_requires": ">=3.10",
|
|
36
36
|
"install_requires": [
|
|
37
|
-
"aws-cdk-lib>=2.
|
|
38
|
-
"constructs>=10.
|
|
39
|
-
"jsii>=1.
|
|
40
|
-
"publication>=0.0.3"
|
|
41
|
-
"typeguard==2.13.3"
|
|
37
|
+
"aws-cdk-lib>=2.273.0, <3.0.0",
|
|
38
|
+
"constructs>=10.5.0, <11.0.0",
|
|
39
|
+
"jsii>=1.141.0, <2.0.0",
|
|
40
|
+
"publication>=0.0.3"
|
|
42
41
|
],
|
|
43
42
|
"classifiers": [
|
|
44
43
|
"Intended Audience :: Developers",
|
|
45
44
|
"Operating System :: OS Independent",
|
|
46
45
|
"Programming Language :: JavaScript",
|
|
47
46
|
"Programming Language :: Python :: 3 :: Only",
|
|
48
|
-
"Programming Language :: Python :: 3.9",
|
|
49
47
|
"Programming Language :: Python :: 3.10",
|
|
50
48
|
"Programming Language :: Python :: 3.11",
|
|
49
|
+
"Programming Language :: Python :: 3.12",
|
|
50
|
+
"Programming Language :: Python :: 3.13",
|
|
51
|
+
"Programming Language :: Python :: 3.14",
|
|
51
52
|
"Typing :: Typed",
|
|
52
53
|
"Development Status :: 5 - Production/Stable",
|
|
53
54
|
"License :: OSI Approved"
|
|
@@ -17,6 +17,8 @@ environments, and works in isolated subnets.
|
|
|
17
17
|
# Requirements
|
|
18
18
|
|
|
19
19
|
* CDK v2.
|
|
20
|
+
* Node.js 22.14 or newer for consumers, as declared in `package.json`'s `engines`.
|
|
21
|
+
This is the library's supported minimum, independent of its development tools.
|
|
20
22
|
|
|
21
23
|
# Installation
|
|
22
24
|
|
|
@@ -146,6 +148,31 @@ has been created.
|
|
|
146
148
|
If you want to make the role the owner of a new database, just specify
|
|
147
149
|
the `databaseName` here, and create the database later.
|
|
148
150
|
|
|
151
|
+
### Connection limit (MySQL/MariaDB)
|
|
152
|
+
|
|
153
|
+
Cap how many connections a MySQL or MariaDB user may open:
|
|
154
|
+
|
|
155
|
+
```python
|
|
156
|
+
const role = new Role(this, "Role", {
|
|
157
|
+
provider: provider,
|
|
158
|
+
roleName: "myrole",
|
|
159
|
+
databaseName: "mydb",
|
|
160
|
+
maxUserConnections: 5,
|
|
161
|
+
})
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Create and update then run:
|
|
165
|
+
|
|
166
|
+
```sql
|
|
167
|
+
ALTER USER 'myrole'@'%' WITH MAX_USER_CONNECTIONS 5
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Omit `maxUserConnections` to leave the user unlimited, which is the
|
|
171
|
+
existing behaviour. Omitting it does not clear a limit that was already
|
|
172
|
+
applied; set `0` to restore the server default (unlimited unless the
|
|
173
|
+
global `max_user_connections` is set). PostgreSQL and DSQL throw if
|
|
174
|
+
this property is set.
|
|
175
|
+
|
|
149
176
|
### IAM Authentication
|
|
150
177
|
|
|
151
178
|
Instead of password-based authentication, you can create roles that
|
|
@@ -520,17 +547,35 @@ const provider = new Provider(this, "Provider", {
|
|
|
520
547
|
|
|
521
548
|
# Working on this code
|
|
522
549
|
|
|
523
|
-
This code is managed by
|
|
524
|
-
[
|
|
525
|
-
|
|
550
|
+
This code is managed by [projen](https://github.com/projen/projen).
|
|
551
|
+
[mise](https://mise.jdx.dev/) installs Node 24, pnpm 12, and
|
|
552
|
+
[hk](https://hk.jdx.dev/) for Git hooks. Biome handles formatting and linting.
|
|
526
553
|
|
|
527
|
-
|
|
554
|
+
Development and CI use Node 24. Testcontainers is a development-only dependency;
|
|
555
|
+
its dependency tree requires newer APIs than the consumer minimum of Node 22.14.
|
|
528
556
|
|
|
557
|
+
After cloning:
|
|
558
|
+
|
|
559
|
+
```sh
|
|
560
|
+
mise trust
|
|
561
|
+
mise install
|
|
562
|
+
mise run setup
|
|
529
563
|
```
|
|
530
|
-
pre-commit install --install-hooks --hook-type commit-msg --hook-type pre-commit
|
|
531
|
-
```
|
|
532
564
|
|
|
533
|
-
|
|
565
|
+
When migrating an existing clone, replace the old pre-commit hooks with
|
|
566
|
+
`mise exec -- hk install --mise --force`.
|
|
567
|
+
|
|
568
|
+
Run all checks with `mise run check`, or format and lint with
|
|
569
|
+
`pnpm exec projen biome`. Tests require Docker. TypeScript stays on the
|
|
570
|
+
6.0 release line supported by jsii 6.0.
|
|
571
|
+
|
|
572
|
+
The pre-commit hook runs the full build, tests, and packaging, so Docker must
|
|
573
|
+
be running. When `VPC_ID` is set, changes under `src/` also run CDK synthesis
|
|
574
|
+
against that VPC; this requires AWS credentials. Unset `VPC_ID` to skip synthesis.
|
|
575
|
+
|
|
576
|
+
The development tsconfig uses `node16` module resolution, including package
|
|
577
|
+
exports. Jest tasks enable Node's VM module support for native dynamic imports
|
|
578
|
+
such as the MySQL driver import.
|
|
534
579
|
|
|
535
580
|
## Testing
|
|
536
581
|
|
|
@@ -540,6 +585,9 @@ Test code via projen with:
|
|
|
540
585
|
pnpm exec projen test
|
|
541
586
|
```
|
|
542
587
|
|
|
588
|
+
Tests do not update snapshots automatically. To intentionally refresh them, run
|
|
589
|
+
`pnpm exec projen test:update` and review the snapshot diff.
|
|
590
|
+
|
|
543
591
|
You can run the PostgreSQL sample stack with:
|
|
544
592
|
|
|
545
593
|
```
|
|
@@ -562,6 +610,8 @@ pnpm exec projen integ:deploy:dsql
|
|
|
562
610
|
|
|
563
611
|
* Update role: will not revoke connect to previous database if database name has changed.
|
|
564
612
|
'''
|
|
613
|
+
from __future__ import annotations
|
|
614
|
+
|
|
565
615
|
from pkgutil import extend_path
|
|
566
616
|
__path__ = extend_path(__path__, __name__)
|
|
567
617
|
|
|
@@ -575,33 +625,41 @@ import jsii
|
|
|
575
625
|
import publication
|
|
576
626
|
import typing_extensions
|
|
577
627
|
|
|
578
|
-
import
|
|
579
|
-
|
|
580
|
-
TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])
|
|
581
|
-
|
|
582
|
-
def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any:
|
|
583
|
-
if TYPEGUARD_MAJOR_VERSION <= 2:
|
|
584
|
-
return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore
|
|
585
|
-
else:
|
|
586
|
-
if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue]
|
|
587
|
-
pass
|
|
588
|
-
else:
|
|
589
|
-
if TYPEGUARD_MAJOR_VERSION == 3:
|
|
590
|
-
typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore
|
|
591
|
-
typeguard.check_type(value=value, expected_type=expected_type) # type:ignore
|
|
592
|
-
else:
|
|
593
|
-
typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore
|
|
628
|
+
from jsii._type_checking import cached_type_hints, check_type
|
|
629
|
+
|
|
594
630
|
|
|
595
631
|
from ._jsii import *
|
|
596
632
|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
import
|
|
604
|
-
|
|
633
|
+
class _LazyImport:
|
|
634
|
+
def __init__(self, module_name: str) -> None:
|
|
635
|
+
self._module_name = module_name
|
|
636
|
+
self._module: typing.Any = None
|
|
637
|
+
def __getattr__(self, name: str) -> typing.Any:
|
|
638
|
+
if self._module is None:
|
|
639
|
+
import importlib
|
|
640
|
+
self._module = importlib.import_module(self._module_name)
|
|
641
|
+
return getattr(self._module, name)
|
|
642
|
+
|
|
643
|
+
if typing.TYPE_CHECKING:
|
|
644
|
+
|
|
645
|
+
import aws_cdk as _aws_cdk_ceddda9d
|
|
646
|
+
import aws_cdk.aws_dsql as _aws_cdk_aws_dsql_ceddda9d
|
|
647
|
+
import aws_cdk.aws_ec2 as _aws_cdk_aws_ec2_ceddda9d
|
|
648
|
+
import aws_cdk.aws_kms as _aws_cdk_aws_kms_ceddda9d
|
|
649
|
+
import aws_cdk.aws_lambda as _aws_cdk_aws_lambda_ceddda9d
|
|
650
|
+
import aws_cdk.aws_rds as _aws_cdk_aws_rds_ceddda9d
|
|
651
|
+
import aws_cdk.aws_secretsmanager as _aws_cdk_aws_secretsmanager_ceddda9d
|
|
652
|
+
import constructs as _constructs_77d1e7e8
|
|
653
|
+
else:
|
|
654
|
+
|
|
655
|
+
_aws_cdk_aws_dsql_ceddda9d = _LazyImport("aws_cdk.aws_dsql")
|
|
656
|
+
_aws_cdk_aws_ec2_ceddda9d = _LazyImport("aws_cdk.aws_ec2")
|
|
657
|
+
_aws_cdk_aws_kms_ceddda9d = _LazyImport("aws_cdk.aws_kms")
|
|
658
|
+
_aws_cdk_aws_lambda_ceddda9d = _LazyImport("aws_cdk.aws_lambda")
|
|
659
|
+
_aws_cdk_aws_rds_ceddda9d = _LazyImport("aws_cdk.aws_rds")
|
|
660
|
+
_aws_cdk_aws_secretsmanager_ceddda9d = _LazyImport("aws_cdk.aws_secretsmanager")
|
|
661
|
+
_aws_cdk_ceddda9d = _LazyImport("aws_cdk")
|
|
662
|
+
_constructs_77d1e7e8 = _LazyImport("constructs")
|
|
605
663
|
|
|
606
664
|
|
|
607
665
|
@jsii.enum(jsii_type="cdk-rds-sql.DatabaseEngine")
|
|
@@ -636,7 +694,7 @@ class DatabaseProps:
|
|
|
636
694
|
:param owner: Optional database owner.
|
|
637
695
|
'''
|
|
638
696
|
if __debug__:
|
|
639
|
-
type_hints =
|
|
697
|
+
type_hints = cached_type_hints(_typecheckingstub__d02a87af93e26ceaf647662fc78818b2f43fe154b349df3c4f5752d22b61ea34)
|
|
640
698
|
check_type(argname="argument database_name", value=database_name, expected_type=type_hints["database_name"])
|
|
641
699
|
check_type(argname="argument provider", value=provider, expected_type=type_hints["provider"])
|
|
642
700
|
check_type(argname="argument owner", value=owner, expected_type=type_hints["owner"])
|
|
@@ -785,7 +843,7 @@ class IamGrant(
|
|
|
785
843
|
:param role_name: Database role name to grant IAM access to.
|
|
786
844
|
'''
|
|
787
845
|
if __debug__:
|
|
788
|
-
type_hints =
|
|
846
|
+
type_hints = cached_type_hints(_typecheckingstub__ddc8001ac6195e8fb417d17f2106bdcd50800e6da2afb84794113f44cc6c18c9)
|
|
789
847
|
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
790
848
|
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
791
849
|
props = IamGrantProps(
|
|
@@ -818,7 +876,7 @@ class IamGrantProps:
|
|
|
818
876
|
:param role_name: Database role name to grant IAM access to.
|
|
819
877
|
'''
|
|
820
878
|
if __debug__:
|
|
821
|
-
type_hints =
|
|
879
|
+
type_hints = cached_type_hints(_typecheckingstub__4887252bb5c41c89521a26b729d32055341e5bee89b4f65947a38d7c0aaf5dec)
|
|
822
880
|
check_type(argname="argument provider", value=provider, expected_type=type_hints["provider"])
|
|
823
881
|
check_type(argname="argument resource_arn", value=resource_arn, expected_type=type_hints["resource_arn"])
|
|
824
882
|
check_type(argname="argument role_name", value=role_name, expected_type=type_hints["role_name"])
|
|
@@ -894,7 +952,7 @@ class Provider(
|
|
|
894
952
|
:param vpc_subnets: Where to place the network provider lambda within the VPC. Default: - the isolated subnet if not specified
|
|
895
953
|
'''
|
|
896
954
|
if __debug__:
|
|
897
|
-
type_hints =
|
|
955
|
+
type_hints = cached_type_hints(_typecheckingstub__f569409e68b7292df1965d915629ef8c34532a3dcd05bea0032c564041e409e4)
|
|
898
956
|
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
899
957
|
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
900
958
|
props = RdsSqlProps(
|
|
@@ -932,7 +990,7 @@ class Provider(
|
|
|
932
990
|
:param function_name:
|
|
933
991
|
'''
|
|
934
992
|
if __debug__:
|
|
935
|
-
type_hints =
|
|
993
|
+
type_hints = cached_type_hints(_typecheckingstub__6447e54f3866ee95542c4c6e6f57beb9f77e9508347c20f14c7bb52a36c8133c)
|
|
936
994
|
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
937
995
|
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
938
996
|
attrs = ProviderAttributes(
|
|
@@ -972,7 +1030,7 @@ class Provider(
|
|
|
972
1030
|
:param vpc_subnets: Where to place the network provider lambda within the VPC. Default: - the isolated subnet if not specified
|
|
973
1031
|
'''
|
|
974
1032
|
if __debug__:
|
|
975
|
-
type_hints =
|
|
1033
|
+
type_hints = cached_type_hints(_typecheckingstub__16aa0dc03b1ffdc1c49190bb39d545df3907972a07f344528a5a891c23d0f28c)
|
|
976
1034
|
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
977
1035
|
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
978
1036
|
props = RdsSqlProps(
|
|
@@ -1046,7 +1104,7 @@ class ProviderAttributes:
|
|
|
1046
1104
|
:param function_name:
|
|
1047
1105
|
'''
|
|
1048
1106
|
if __debug__:
|
|
1049
|
-
type_hints =
|
|
1107
|
+
type_hints = cached_type_hints(_typecheckingstub__38638fb01c5b5c1e90a480e969bec755370ee72cad8844940b704cff73c8057c)
|
|
1050
1108
|
check_type(argname="argument engine", value=engine, expected_type=type_hints["engine"])
|
|
1051
1109
|
check_type(argname="argument cluster", value=cluster, expected_type=type_hints["cluster"])
|
|
1052
1110
|
check_type(argname="argument function_arn", value=function_arn, expected_type=type_hints["function_arn"])
|
|
@@ -1153,7 +1211,7 @@ class RdsSqlProps:
|
|
|
1153
1211
|
if isinstance(vpc_subnets, dict):
|
|
1154
1212
|
vpc_subnets = _aws_cdk_aws_ec2_ceddda9d.SubnetSelection(**vpc_subnets)
|
|
1155
1213
|
if __debug__:
|
|
1156
|
-
type_hints =
|
|
1214
|
+
type_hints = cached_type_hints(_typecheckingstub__1562dfb28e0e71a0b95785ddbc26511738019b8ab5c6885e0ff1f2050e6d045b)
|
|
1157
1215
|
check_type(argname="argument cluster", value=cluster, expected_type=type_hints["cluster"])
|
|
1158
1216
|
check_type(argname="argument function_props", value=function_props, expected_type=type_hints["function_props"])
|
|
1159
1217
|
check_type(argname="argument logger", value=logger, expected_type=type_hints["logger"])
|
|
@@ -1314,6 +1372,7 @@ class Role(
|
|
|
1314
1372
|
database_name: typing.Optional[builtins.str] = None,
|
|
1315
1373
|
enable_iam_auth: typing.Optional[builtins.bool] = None,
|
|
1316
1374
|
encryption_key: typing.Optional["_aws_cdk_aws_kms_ceddda9d.IKey"] = None,
|
|
1375
|
+
max_user_connections: typing.Optional[jsii.Number] = None,
|
|
1317
1376
|
parameter_prefix: typing.Optional[builtins.str] = None,
|
|
1318
1377
|
secret_name: typing.Optional[builtins.str] = None,
|
|
1319
1378
|
) -> None:
|
|
@@ -1326,11 +1385,12 @@ class Role(
|
|
|
1326
1385
|
: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
1386
|
: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
1387
|
:param encryption_key: A new secret is created for this user. Optionally encrypt it with the given key.
|
|
1388
|
+
: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
1389
|
: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
1390
|
:param secret_name: A new secret is created for this user. Optionally add secret name to the secret.
|
|
1331
1391
|
'''
|
|
1332
1392
|
if __debug__:
|
|
1333
|
-
type_hints =
|
|
1393
|
+
type_hints = cached_type_hints(_typecheckingstub__062afab8717d46f6fc2a31188b28d9e663190b2080174cc7f1ddd691f699de7e)
|
|
1334
1394
|
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
1335
1395
|
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
1336
1396
|
props = RoleProps(
|
|
@@ -1340,6 +1400,7 @@ class Role(
|
|
|
1340
1400
|
database_name=database_name,
|
|
1341
1401
|
enable_iam_auth=enable_iam_auth,
|
|
1342
1402
|
encryption_key=encryption_key,
|
|
1403
|
+
max_user_connections=max_user_connections,
|
|
1343
1404
|
parameter_prefix=parameter_prefix,
|
|
1344
1405
|
secret_name=secret_name,
|
|
1345
1406
|
)
|
|
@@ -1378,6 +1439,7 @@ class Role(
|
|
|
1378
1439
|
"database_name": "databaseName",
|
|
1379
1440
|
"enable_iam_auth": "enableIamAuth",
|
|
1380
1441
|
"encryption_key": "encryptionKey",
|
|
1442
|
+
"max_user_connections": "maxUserConnections",
|
|
1381
1443
|
"parameter_prefix": "parameterPrefix",
|
|
1382
1444
|
"secret_name": "secretName",
|
|
1383
1445
|
},
|
|
@@ -1392,6 +1454,7 @@ class RoleProps:
|
|
|
1392
1454
|
database_name: typing.Optional[builtins.str] = None,
|
|
1393
1455
|
enable_iam_auth: typing.Optional[builtins.bool] = None,
|
|
1394
1456
|
encryption_key: typing.Optional["_aws_cdk_aws_kms_ceddda9d.IKey"] = None,
|
|
1457
|
+
max_user_connections: typing.Optional[jsii.Number] = None,
|
|
1395
1458
|
parameter_prefix: typing.Optional[builtins.str] = None,
|
|
1396
1459
|
secret_name: typing.Optional[builtins.str] = None,
|
|
1397
1460
|
) -> None:
|
|
@@ -1402,17 +1465,19 @@ class RoleProps:
|
|
|
1402
1465
|
: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
1466
|
: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
1467
|
:param encryption_key: A new secret is created for this user. Optionally encrypt it with the given key.
|
|
1468
|
+
: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
1469
|
: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
1470
|
:param secret_name: A new secret is created for this user. Optionally add secret name to the secret.
|
|
1407
1471
|
'''
|
|
1408
1472
|
if __debug__:
|
|
1409
|
-
type_hints =
|
|
1473
|
+
type_hints = cached_type_hints(_typecheckingstub__a7ed79cdb7903207b3240698f6bcb0582905979c1519e2b49d66fa6fbdac11ee)
|
|
1410
1474
|
check_type(argname="argument provider", value=provider, expected_type=type_hints["provider"])
|
|
1411
1475
|
check_type(argname="argument role_name", value=role_name, expected_type=type_hints["role_name"])
|
|
1412
1476
|
check_type(argname="argument database", value=database, expected_type=type_hints["database"])
|
|
1413
1477
|
check_type(argname="argument database_name", value=database_name, expected_type=type_hints["database_name"])
|
|
1414
1478
|
check_type(argname="argument enable_iam_auth", value=enable_iam_auth, expected_type=type_hints["enable_iam_auth"])
|
|
1415
1479
|
check_type(argname="argument encryption_key", value=encryption_key, expected_type=type_hints["encryption_key"])
|
|
1480
|
+
check_type(argname="argument max_user_connections", value=max_user_connections, expected_type=type_hints["max_user_connections"])
|
|
1416
1481
|
check_type(argname="argument parameter_prefix", value=parameter_prefix, expected_type=type_hints["parameter_prefix"])
|
|
1417
1482
|
check_type(argname="argument secret_name", value=secret_name, expected_type=type_hints["secret_name"])
|
|
1418
1483
|
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
@@ -1427,6 +1492,8 @@ class RoleProps:
|
|
|
1427
1492
|
self._values["enable_iam_auth"] = enable_iam_auth
|
|
1428
1493
|
if encryption_key is not None:
|
|
1429
1494
|
self._values["encryption_key"] = encryption_key
|
|
1495
|
+
if max_user_connections is not None:
|
|
1496
|
+
self._values["max_user_connections"] = max_user_connections
|
|
1430
1497
|
if parameter_prefix is not None:
|
|
1431
1498
|
self._values["parameter_prefix"] = parameter_prefix
|
|
1432
1499
|
if secret_name is not None:
|
|
@@ -1497,6 +1564,26 @@ class RoleProps:
|
|
|
1497
1564
|
result = self._values.get("encryption_key")
|
|
1498
1565
|
return typing.cast(typing.Optional["_aws_cdk_aws_kms_ceddda9d.IKey"], result)
|
|
1499
1566
|
|
|
1567
|
+
@builtins.property
|
|
1568
|
+
def max_user_connections(self) -> typing.Optional[jsii.Number]:
|
|
1569
|
+
'''Maximum simultaneous connections for this MySQL/MariaDB user.
|
|
1570
|
+
|
|
1571
|
+
When set, create and update run
|
|
1572
|
+
``ALTER USER '<roleName>'@'%' WITH MAX_USER_CONNECTIONS <n>``.
|
|
1573
|
+
A later change, including a smaller number, is applied on update.
|
|
1574
|
+
``0`` restores the server default (unlimited unless the global
|
|
1575
|
+
``max_user_connections`` is set).
|
|
1576
|
+
|
|
1577
|
+
Omit the property to leave the user unlimited. Omitting it does not
|
|
1578
|
+
clear a limit that was already applied; set ``0`` to do that.
|
|
1579
|
+
|
|
1580
|
+
PostgreSQL and DSQL do not support this property and throw if it is set.
|
|
1581
|
+
|
|
1582
|
+
:default: undefined - no connection limit is applied
|
|
1583
|
+
'''
|
|
1584
|
+
result = self._values.get("max_user_connections")
|
|
1585
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
1586
|
+
|
|
1500
1587
|
@builtins.property
|
|
1501
1588
|
def parameter_prefix(self) -> typing.Optional[builtins.str]:
|
|
1502
1589
|
'''Prefix for SSM parameters to store credentials in Parameter Store. When defined, credentials will also be stored as parameters.
|
|
@@ -1558,7 +1645,7 @@ class Schema(
|
|
|
1558
1645
|
:param role: Optional role which will be granted usage and create permissions to this schema. This way the role can read its own tables, but cannot see or access tables created by others.
|
|
1559
1646
|
'''
|
|
1560
1647
|
if __debug__:
|
|
1561
|
-
type_hints =
|
|
1648
|
+
type_hints = cached_type_hints(_typecheckingstub__23264d20ca42f56453469fb6eae1679bf4f901ace3ccab77b186aa28167779bf)
|
|
1562
1649
|
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
1563
1650
|
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
1564
1651
|
props = SchemaProps(
|
|
@@ -1599,7 +1686,7 @@ class SchemaProps:
|
|
|
1599
1686
|
:param role: Optional role which will be granted usage and create permissions to this schema. This way the role can read its own tables, but cannot see or access tables created by others.
|
|
1600
1687
|
'''
|
|
1601
1688
|
if __debug__:
|
|
1602
|
-
type_hints =
|
|
1689
|
+
type_hints = cached_type_hints(_typecheckingstub__3e5c9257731fa92bb3b0a3fd8f4556888ed99294fcba1b14ade48e8d8d57c6b0)
|
|
1603
1690
|
check_type(argname="argument provider", value=provider, expected_type=type_hints["provider"])
|
|
1604
1691
|
check_type(argname="argument schema_name", value=schema_name, expected_type=type_hints["schema_name"])
|
|
1605
1692
|
check_type(argname="argument database", value=database, expected_type=type_hints["database"])
|
|
@@ -1682,7 +1769,7 @@ class Sql(
|
|
|
1682
1769
|
:param statement: SQL.
|
|
1683
1770
|
'''
|
|
1684
1771
|
if __debug__:
|
|
1685
|
-
type_hints =
|
|
1772
|
+
type_hints = cached_type_hints(_typecheckingstub__a34aa094d1e87a65ca4be0fe7c3fad7c2a9f986cfd40a3f07de15d3d6b0d2139)
|
|
1686
1773
|
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
1687
1774
|
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
1688
1775
|
props = SqlProps(
|
|
@@ -1721,7 +1808,7 @@ class SqlProps:
|
|
|
1721
1808
|
:param statement: SQL.
|
|
1722
1809
|
'''
|
|
1723
1810
|
if __debug__:
|
|
1724
|
-
type_hints =
|
|
1811
|
+
type_hints = cached_type_hints(_typecheckingstub__fee81de7736c28ed1e24db0db96a0f7084eb4dad448f37b2efdc59960daf7f24)
|
|
1725
1812
|
check_type(argname="argument provider", value=provider, expected_type=type_hints["provider"])
|
|
1726
1813
|
check_type(argname="argument database", value=database, expected_type=type_hints["database"])
|
|
1727
1814
|
check_type(argname="argument rollback", value=rollback, expected_type=type_hints["rollback"])
|
|
@@ -1799,7 +1886,7 @@ class Database(
|
|
|
1799
1886
|
:param owner: Optional database owner.
|
|
1800
1887
|
'''
|
|
1801
1888
|
if __debug__:
|
|
1802
|
-
type_hints =
|
|
1889
|
+
type_hints = cached_type_hints(_typecheckingstub__9b0a129482abaf744a12ee5aabac9c0545bc3cdf8edcfb3dca83d0c1051326ed)
|
|
1803
1890
|
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
1804
1891
|
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
1805
1892
|
props = DatabaseProps(
|
|
@@ -1825,7 +1912,7 @@ class Database(
|
|
|
1825
1912
|
:param database_name: -
|
|
1826
1913
|
'''
|
|
1827
1914
|
if __debug__:
|
|
1828
|
-
type_hints =
|
|
1915
|
+
type_hints = cached_type_hints(_typecheckingstub__771fb1f62814ed88a15c2f9d4d948498f7416f30cd8e9d630b3ea09667333681)
|
|
1829
1916
|
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
1830
1917
|
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
1831
1918
|
check_type(argname="argument database_name", value=database_name, expected_type=type_hints["database_name"])
|
|
@@ -1966,6 +2053,7 @@ def _typecheckingstub__062afab8717d46f6fc2a31188b28d9e663190b2080174cc7f1ddd691f
|
|
|
1966
2053
|
database_name: typing.Optional[builtins.str] = None,
|
|
1967
2054
|
enable_iam_auth: typing.Optional[builtins.bool] = None,
|
|
1968
2055
|
encryption_key: typing.Optional[_aws_cdk_aws_kms_ceddda9d.IKey] = None,
|
|
2056
|
+
max_user_connections: typing.Optional[jsii.Number] = None,
|
|
1969
2057
|
parameter_prefix: typing.Optional[builtins.str] = None,
|
|
1970
2058
|
secret_name: typing.Optional[builtins.str] = None,
|
|
1971
2059
|
) -> None:
|
|
@@ -1980,6 +2068,7 @@ def _typecheckingstub__a7ed79cdb7903207b3240698f6bcb0582905979c1519e2b49d66fa6fb
|
|
|
1980
2068
|
database_name: typing.Optional[builtins.str] = None,
|
|
1981
2069
|
enable_iam_auth: typing.Optional[builtins.bool] = None,
|
|
1982
2070
|
encryption_key: typing.Optional[_aws_cdk_aws_kms_ceddda9d.IKey] = None,
|
|
2071
|
+
max_user_connections: typing.Optional[jsii.Number] = None,
|
|
1983
2072
|
parameter_prefix: typing.Optional[builtins.str] = None,
|
|
1984
2073
|
secret_name: typing.Optional[builtins.str] = None,
|
|
1985
2074
|
) -> None:
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from pkgutil import extend_path
|
|
2
|
+
__path__ = extend_path(__path__, __name__)
|
|
3
|
+
|
|
4
|
+
import abc
|
|
5
|
+
import builtins
|
|
6
|
+
import datetime
|
|
7
|
+
import enum
|
|
8
|
+
import typing
|
|
9
|
+
|
|
10
|
+
import jsii
|
|
11
|
+
import publication
|
|
12
|
+
import typing_extensions
|
|
13
|
+
|
|
14
|
+
from jsii._type_checking import cached_type_hints, check_type
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
import aws_cdk._jsii
|
|
18
|
+
import constructs._jsii
|
|
19
|
+
|
|
20
|
+
__jsii_assembly__ = jsii.JSIIAssembly.load(
|
|
21
|
+
"cdk-rds-sql", "9.0.0", __name__[0:-6], "cdk-rds-sql@9.0.0.jsii.tgz"
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
__all__ = [
|
|
25
|
+
"__jsii_assembly__",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
publication.publish()
|
|
Binary file
|
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: cdk-rds-sql
|
|
3
|
+
Version: 9.0.0
|
|
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
|
+
Home-page: https://github.com/berenddeboer/cdk-rds-sql.git
|
|
6
|
+
Author: Berend de Boer<berend@pobox.com>
|
|
7
|
+
License: Apache-2.0
|
|
8
|
+
Project-URL: Source, https://github.com/berenddeboer/cdk-rds-sql.git
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: JavaScript
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Classifier: Typing :: Typed
|
|
19
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
20
|
+
Classifier: License :: OSI Approved
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: aws-cdk-lib<3.0.0,>=2.273.0
|
|
25
|
+
Requires-Dist: constructs<11.0.0,>=10.5.0
|
|
26
|
+
Requires-Dist: jsii<2.0.0,>=1.141.0
|
|
27
|
+
Requires-Dist: publication>=0.0.3
|
|
28
|
+
|
|
1
29
|
# About
|
|
2
30
|
|
|
3
31
|
This CDK construct library makes it possible to create databases,
|
|
@@ -16,6 +44,8 @@ environments, and works in isolated subnets.
|
|
|
16
44
|
# Requirements
|
|
17
45
|
|
|
18
46
|
* CDK v2.
|
|
47
|
+
* Node.js 22.14 or newer for consumers, as declared in `package.json`'s `engines`.
|
|
48
|
+
This is the library's supported minimum, independent of its development tools.
|
|
19
49
|
|
|
20
50
|
# Installation
|
|
21
51
|
|
|
@@ -145,6 +175,31 @@ has been created.
|
|
|
145
175
|
If you want to make the role the owner of a new database, just specify
|
|
146
176
|
the `databaseName` here, and create the database later.
|
|
147
177
|
|
|
178
|
+
### Connection limit (MySQL/MariaDB)
|
|
179
|
+
|
|
180
|
+
Cap how many connections a MySQL or MariaDB user may open:
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
const role = new Role(this, "Role", {
|
|
184
|
+
provider: provider,
|
|
185
|
+
roleName: "myrole",
|
|
186
|
+
databaseName: "mydb",
|
|
187
|
+
maxUserConnections: 5,
|
|
188
|
+
})
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Create and update then run:
|
|
192
|
+
|
|
193
|
+
```sql
|
|
194
|
+
ALTER USER 'myrole'@'%' WITH MAX_USER_CONNECTIONS 5
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Omit `maxUserConnections` to leave the user unlimited, which is the
|
|
198
|
+
existing behaviour. Omitting it does not clear a limit that was already
|
|
199
|
+
applied; set `0` to restore the server default (unlimited unless the
|
|
200
|
+
global `max_user_connections` is set). PostgreSQL and DSQL throw if
|
|
201
|
+
this property is set.
|
|
202
|
+
|
|
148
203
|
### IAM Authentication
|
|
149
204
|
|
|
150
205
|
Instead of password-based authentication, you can create roles that
|
|
@@ -519,17 +574,35 @@ const provider = new Provider(this, "Provider", {
|
|
|
519
574
|
|
|
520
575
|
# Working on this code
|
|
521
576
|
|
|
522
|
-
This code is managed by
|
|
523
|
-
[
|
|
524
|
-
|
|
577
|
+
This code is managed by [projen](https://github.com/projen/projen).
|
|
578
|
+
[mise](https://mise.jdx.dev/) installs Node 24, pnpm 12, and
|
|
579
|
+
[hk](https://hk.jdx.dev/) for Git hooks. Biome handles formatting and linting.
|
|
525
580
|
|
|
526
|
-
|
|
581
|
+
Development and CI use Node 24. Testcontainers is a development-only dependency;
|
|
582
|
+
its dependency tree requires newer APIs than the consumer minimum of Node 22.14.
|
|
527
583
|
|
|
584
|
+
After cloning:
|
|
585
|
+
|
|
586
|
+
```sh
|
|
587
|
+
mise trust
|
|
588
|
+
mise install
|
|
589
|
+
mise run setup
|
|
528
590
|
```
|
|
529
|
-
pre-commit install --install-hooks --hook-type commit-msg --hook-type pre-commit
|
|
530
|
-
```
|
|
531
591
|
|
|
532
|
-
|
|
592
|
+
When migrating an existing clone, replace the old pre-commit hooks with
|
|
593
|
+
`mise exec -- hk install --mise --force`.
|
|
594
|
+
|
|
595
|
+
Run all checks with `mise run check`, or format and lint with
|
|
596
|
+
`pnpm exec projen biome`. Tests require Docker. TypeScript stays on the
|
|
597
|
+
6.0 release line supported by jsii 6.0.
|
|
598
|
+
|
|
599
|
+
The pre-commit hook runs the full build, tests, and packaging, so Docker must
|
|
600
|
+
be running. When `VPC_ID` is set, changes under `src/` also run CDK synthesis
|
|
601
|
+
against that VPC; this requires AWS credentials. Unset `VPC_ID` to skip synthesis.
|
|
602
|
+
|
|
603
|
+
The development tsconfig uses `node16` module resolution, including package
|
|
604
|
+
exports. Jest tasks enable Node's VM module support for native dynamic imports
|
|
605
|
+
such as the MySQL driver import.
|
|
533
606
|
|
|
534
607
|
## Testing
|
|
535
608
|
|
|
@@ -539,6 +612,9 @@ Test code via projen with:
|
|
|
539
612
|
pnpm exec projen test
|
|
540
613
|
```
|
|
541
614
|
|
|
615
|
+
Tests do not update snapshots automatically. To intentionally refresh them, run
|
|
616
|
+
`pnpm exec projen test:update` and review the snapshot diff.
|
|
617
|
+
|
|
542
618
|
You can run the PostgreSQL sample stack with:
|
|
543
619
|
|
|
544
620
|
```
|
|
@@ -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@
|
|
14
|
+
src/cdk_rds_sql/_jsii/cdk-rds-sql@9.0.0.jsii.tgz
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
from pkgutil import extend_path
|
|
2
|
-
__path__ = extend_path(__path__, __name__)
|
|
3
|
-
|
|
4
|
-
import abc
|
|
5
|
-
import builtins
|
|
6
|
-
import datetime
|
|
7
|
-
import enum
|
|
8
|
-
import typing
|
|
9
|
-
|
|
10
|
-
import jsii
|
|
11
|
-
import publication
|
|
12
|
-
import typing_extensions
|
|
13
|
-
|
|
14
|
-
import typeguard
|
|
15
|
-
from importlib.metadata import version as _metadata_package_version
|
|
16
|
-
TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])
|
|
17
|
-
|
|
18
|
-
def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any:
|
|
19
|
-
if TYPEGUARD_MAJOR_VERSION <= 2:
|
|
20
|
-
return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore
|
|
21
|
-
else:
|
|
22
|
-
if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue]
|
|
23
|
-
pass
|
|
24
|
-
else:
|
|
25
|
-
if TYPEGUARD_MAJOR_VERSION == 3:
|
|
26
|
-
typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore
|
|
27
|
-
typeguard.check_type(value=value, expected_type=expected_type) # type:ignore
|
|
28
|
-
else:
|
|
29
|
-
typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore
|
|
30
|
-
|
|
31
|
-
import aws_cdk._jsii
|
|
32
|
-
import constructs._jsii
|
|
33
|
-
|
|
34
|
-
__jsii_assembly__ = jsii.JSIIAssembly.load(
|
|
35
|
-
"cdk-rds-sql", "8.1.6", __name__[0:-6], "cdk-rds-sql@8.1.6.jsii.tgz"
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
__all__ = [
|
|
39
|
-
"__jsii_assembly__",
|
|
40
|
-
]
|
|
41
|
-
|
|
42
|
-
publication.publish()
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|