cdk-rds-sql 7.0.2 → 7.1.0

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.
package/.jsii CHANGED
@@ -10,8 +10,8 @@
10
10
  "@types/aws-lambda": "^8.10.152"
11
11
  },
12
12
  "dependencies": {
13
- "aws-cdk-lib": "^2.189.1",
14
- "constructs": "^10.3.0"
13
+ "aws-cdk-lib": "^2.214.0",
14
+ "constructs": "^10.4.2"
15
15
  },
16
16
  "dependencyClosure": {
17
17
  "@aws-cdk/asset-awscli-v1": {
@@ -163,6 +163,19 @@
163
163
  }
164
164
  }
165
165
  },
166
+ "aws-cdk-lib.aws_aiops": {
167
+ "targets": {
168
+ "dotnet": {
169
+ "package": "Amazon.CDK.AWS.AIOps"
170
+ },
171
+ "java": {
172
+ "package": "software.amazon.awscdk.services.aiops"
173
+ },
174
+ "python": {
175
+ "module": "aws_cdk.aws_aiops"
176
+ }
177
+ }
178
+ },
166
179
  "aws-cdk-lib.aws_amazonmq": {
167
180
  "targets": {
168
181
  "dotnet": {
@@ -410,6 +423,19 @@
410
423
  }
411
424
  }
412
425
  },
426
+ "aws-cdk-lib.aws_arcregionswitch": {
427
+ "targets": {
428
+ "dotnet": {
429
+ "package": "Amazon.CDK.AWS.ARCRegionSwitch"
430
+ },
431
+ "java": {
432
+ "package": "software.amazon.awscdk.services.arcregionswitch"
433
+ },
434
+ "python": {
435
+ "module": "aws_cdk.aws_arcregionswitch"
436
+ }
437
+ }
438
+ },
413
439
  "aws-cdk-lib.aws_arczonalshift": {
414
440
  "targets": {
415
441
  "dotnet": {
@@ -1555,6 +1581,19 @@
1555
1581
  }
1556
1582
  }
1557
1583
  },
1584
+ "aws-cdk-lib.aws_evs": {
1585
+ "targets": {
1586
+ "dotnet": {
1587
+ "package": "Amazon.CDK.AWS.EVS"
1588
+ },
1589
+ "java": {
1590
+ "package": "software.amazon.awscdk.services.evs"
1591
+ },
1592
+ "python": {
1593
+ "module": "aws_cdk.aws_evs"
1594
+ }
1595
+ }
1596
+ },
1558
1597
  "aws-cdk-lib.aws_finspace": {
1559
1598
  "targets": {
1560
1599
  "dotnet": {
@@ -2491,6 +2530,19 @@
2491
2530
  }
2492
2531
  }
2493
2532
  },
2533
+ "aws-cdk-lib.aws_mpa": {
2534
+ "targets": {
2535
+ "dotnet": {
2536
+ "package": "Amazon.CDK.AWS.MPA"
2537
+ },
2538
+ "java": {
2539
+ "package": "software.amazon.awscdk.services.mpa"
2540
+ },
2541
+ "python": {
2542
+ "module": "aws_cdk.aws_mpa"
2543
+ }
2544
+ }
2545
+ },
2494
2546
  "aws-cdk-lib.aws_msk": {
2495
2547
  "targets": {
2496
2548
  "dotnet": {
@@ -2621,6 +2673,32 @@
2621
2673
  }
2622
2674
  }
2623
2675
  },
2676
+ "aws-cdk-lib.aws_observabilityadmin": {
2677
+ "targets": {
2678
+ "dotnet": {
2679
+ "package": "Amazon.CDK.AWS.ObservabilityAdmin"
2680
+ },
2681
+ "java": {
2682
+ "package": "software.amazon.awscdk.services.observabilityadmin"
2683
+ },
2684
+ "python": {
2685
+ "module": "aws_cdk.aws_observabilityadmin"
2686
+ }
2687
+ }
2688
+ },
2689
+ "aws-cdk-lib.aws_odb": {
2690
+ "targets": {
2691
+ "dotnet": {
2692
+ "package": "Amazon.CDK.AWS.ODB"
2693
+ },
2694
+ "java": {
2695
+ "package": "software.amazon.awscdk.services.odb"
2696
+ },
2697
+ "python": {
2698
+ "module": "aws_cdk.aws_odb"
2699
+ }
2700
+ }
2701
+ },
2624
2702
  "aws-cdk-lib.aws_omics": {
2625
2703
  "targets": {
2626
2704
  "dotnet": {
@@ -3518,6 +3596,19 @@
3518
3596
  }
3519
3597
  }
3520
3598
  },
3599
+ "aws-cdk-lib.aws_ssmguiconnect": {
3600
+ "targets": {
3601
+ "dotnet": {
3602
+ "package": "Amazon.CDK.AWS.SSMGuiConnect"
3603
+ },
3604
+ "java": {
3605
+ "package": "software.amazon.awscdk.services.ssmguiconnect"
3606
+ },
3607
+ "python": {
3608
+ "module": "aws_cdk.aws_ssmguiconnect"
3609
+ }
3610
+ }
3611
+ },
3521
3612
  "aws-cdk-lib.aws_ssmincidents": {
3522
3613
  "targets": {
3523
3614
  "dotnet": {
@@ -3752,6 +3843,19 @@
3752
3843
  }
3753
3844
  }
3754
3845
  },
3846
+ "aws-cdk-lib.aws_workspacesinstances": {
3847
+ "targets": {
3848
+ "dotnet": {
3849
+ "package": "Amazon.CDK.AWS.WorkspacesInstances"
3850
+ },
3851
+ "java": {
3852
+ "package": "software.amazon.awscdk.services.workspacesinstances"
3853
+ },
3854
+ "python": {
3855
+ "module": "aws_cdk.aws_workspacesinstances"
3856
+ }
3857
+ }
3858
+ },
3755
3859
  "aws-cdk-lib.aws_workspacesthinclient": {
3756
3860
  "targets": {
3757
3861
  "dotnet": {
@@ -3949,7 +4053,7 @@
3949
4053
  }
3950
4054
  }
3951
4055
  },
3952
- "description": "A CDK construct that allows creating roles or users and databases an on Aurora Serverless Postgresql or Mysql/MariaDB cluster.",
4056
+ "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.",
3953
4057
  "docs": {
3954
4058
  "stability": "stable"
3955
4059
  },
@@ -3960,6 +4064,7 @@
3960
4064
  "aws",
3961
4065
  "aws-cdk",
3962
4066
  "cdk",
4067
+ "dsql",
3963
4068
  "mysql",
3964
4069
  "postgres",
3965
4070
  "rds"
@@ -3975,7 +4080,7 @@
3975
4080
  },
3976
4081
  "name": "cdk-rds-sql",
3977
4082
  "readme": {
3978
- "markdown": "# About\n\nThis CDK construct library makes it possible to create databases,\nschemas, and roles in an Aurora Serverless v2, RDS Database Cluster or\nDatabase Instance. Both PostgreSQL and MySQL databases are supported.\n\nThis construct library is intended to be used in enterprise\nenvironments, and works in isolated subnets.\n\n<p align=\"left\">\n <a href=\"https://github.com/semantic-release/semantic-release\"><img src=\"https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release\" alt=semantic-release: angular\"></a>\n <a href=\"https://github.com/berenddeboer/cdk-rds-sql/actions/workflows/release.yml\"><img src=\"https://github.com/berenddeboer/cdk-rds-sql/actions/workflows/release.yml/badge.svg\" alt=\"Release badge\"></a>\n</p>\n\n# Requirements\n\n- CDK v2.\n\n# Installation\n\n npm i cdk-rds-sql\n\n# Usage\n\n## Provider\n\nFirst setup your VPC and create your cluster:\n\n```ts\nimport { Duration, RemovalPolicy } from \"aws-cdk-lib\"\nimport * as ec2 from \"aws-cdk-lib/aws-ec2\"\nimport * as rds from \"aws-cdk-lib/aws-rds\"\n\nconst vpc = ec2.Vpc.fromLookup(this, \"Vpc\", {\n vpcId: this.node.tryGetContext(\"vpc-id\"),\n})\n\nconst cluster = new rds.ServerlessCluster(this, \"Cluster\", {\n vpc: vpc,\n vpcSubnets: {\n subnetType: ec2.SubnetType.PRIVATE_ISOLATED,\n },\n engine: rds.DatabaseClusterEngine.AURORA_POSTGRESQL,\n parameterGroup: rds.ParameterGroup.fromParameterGroupName(\n this,\n \"ParameterGroup\",\n \"default.aurora-postgresql11\"\n ),\n removalPolicy: RemovalPolicy.DESTROY,\n scaling: {\n autoPause: Duration.minutes(60),\n minCapacity: rds.AuroraCapacityUnit.ACU_2,\n maxCapacity: rds.AuroraCapacityUnit.ACU_2,\n },\n})\n```\n\nThen create a provider which will connect to your database. For a cluster:\n\n```ts\nimport { Provider } from \"cdk-rds-sql\"\n\nconst provider = new Provider(this, \"Provider\", {\n vpc: vpc,\n cluster: cluster,\n secret: cluster.secret!,\n})\n```\n\nFor an instance:\n\n```ts\nimport { Provider } from \"cdk-rds-sql\"\n\nconst provider = new Provider(this, \"Provider\", {\n vpc: vpc,\n instance: instance,\n secret: cluster.secret!,\n})\n```\n\nThe provider will setup a lambda, which normally lives in the same VPC\nas the database. You can give a different VPC, as long as that VPC has\naccess to the VPC of the database. Only the provider lambda will talk\nto your database.\n\nThe provider will by default use the private isolated subnet of the\nVPC. Your isolated network must have a VPC endpoint to AWS Secrets Manager\nand possibly KMS as well. If you want to use a subnet with egress\naccess in case you have no such VPC endpoints, specify the subnet as\nfollows:\n\n```ts\nimport { Provider } from \"cdk-rds-sql\"\n\nconst provider = new Provider(this, \"Provider\", {\n vpc: vpc,\n vpcSubnets: {\n subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS,\n },\n cluster: cluster,\n secret: cluster.secret!,\n})\n```\n\n### Disabling SSL\n\nThe default connection to RDS is ssl enabled. You can disable ssl by\nsetting the `ssl` option to `false`:\n\n```ts\nconst provider = new Provider(this, \"Provider\", {\n vpc: vpc,\n instance: instance,\n secret: cluster.secret!,\n ssl: false, // default is true\n})\n```\n\n## Roles\n\nCreate a postgres role (or mysql user) for a cluster as follows:\n\n```ts\nimport { Role } from \"cdk-rds-sql\"\n\nconst role = new Role(this, \"Role\", {\n provider: provider,\n roleName: \"myrole\",\n databaseName: \"mydb\",\n})\n```\n\nThis will automatically create a secret just like `ServerlessCluster`\ndoes, with all the connection info needed for this user. It's secret\nvalue is a JSON like:\n\n```json\n{\n \"dbClusterIdentifier\": \"teststack-clustereb1186t9-sh4wpqfdyfvu\",\n \"password\": \"very-long-and-boring\",\n \"dbname\": \"mydb\",\n \"engine\": \"postgres\",\n \"port\": 5432,\n \"host\": \"teststack-clustereb1186t9-sh4wpqfdyfvu.cluster-cgudolabssna.us-east-1.rds.amazonaws.com\",\n \"username\": \"myrole\"\n}\n```\n\nYou can access the secret via `role.secret`.\n\nInstead of `databaseName` you can also specify `database` to reference\nan existing database. The role will not be created until the database\nhas been created.\n\nIf you want to make the role the owner of a new database, just specify\nthe `databaseName` here, and create the database later.\n\n### IAM Authentication\n\nInstead of password-based authentication, you can create roles that\nuse AWS IAM database authentication. This eliminates the need to store\ndatabase passwords and provides enhanced security through AWS IAM\npolicies.\n\n```ts\nimport { Role } from \"cdk-rds-sql\"\n\nconst iamRole = new Role(this, \"IamRole\", {\n provider: provider,\n roleName: \"myiamrole\",\n databaseName: \"mydb\",\n enableIamAuth: true,\n})\n```\n\nFor IAM-authenticated roles, the secret will not contain a password field:\n\n```json\n{\n \"dbClusterIdentifier\": \"teststack-clustereb1186t9-sh4wpqfdyfvu\",\n \"dbname\": \"mydb\",\n \"engine\": \"postgres\",\n \"port\": 5432,\n \"host\": \"teststack-clustereb1186t9-sh4wpqfdyfvu.cluster-cgudolabssna.us-east-1.rds.amazonaws.com\",\n \"username\": \"myiamrole\"\n}\n```\n\n**Requirements for IAM Authentication:**\n\n- SSL connections are required (enabled by default in this library)\n- Your application must have IAM permissions to connect to the database\n- The database user/role name must match the IAM identity\n\n**IAM Policy Example:**\n\nYour application will need an IAM policy like this to connect:\n\n```json\n{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Effect\": \"Allow\",\n \"Action\": [\"rds-db:connect\"],\n \"Resource\": [\n \"arn:aws:rds-db:region:account-id:dbuser:cluster-resource-id/myiamrole\"\n ]\n }\n ]\n}\n```\n\nBoth PostgreSQL and MySQL databases support IAM authentication. For more details, see the [AWS RDS IAM Database Authentication documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html).\n\n### MySQL support\n\nIn MySQL users are created with '%' as value for the host. It is hard\nto do this better:\n\n- Determine the CIDR blocks used by a VPC is not trivial.\n- For imported VPCs you cannot specify the IPv6 CIDR.\n- CIDRs might change without the system knowing, meaning applications\n could lose access to the database at random times, such as when a\n container is restarted.\n\n## Database\n\nCreate a database as follows:\n\n```ts\nimport { Database } from \"cdk-rds-sql\"\n\nconst database = new Database(this, \"Database\", {\n provider: provider,\n databaseName: \"mydb\",\n})\n```\n\nYou can provide an owner, which makes it easy to create database owned\nby a new user:\n\n```ts\nconst database = new Database(this, \"Database\", {\n provider: provider,\n databaseName: \"mydb\",\n owner: role,\n})\n```\n\n## Schema\n\nCreate a schema in the default database as follows:\n\n```ts\nimport { Schema } from \"cdk-rds-sql\"\n\nnew Schema(this, \"Schema\", {\n provider: provider,\n schemaName: \"myschema\",\n})\n```\n\nOr in another database:\n\n```ts\nconst database = new Database(this, \"Database\", {\n provider: provider,\n databaseName: \"mydb\",\n})\n\nnew Schema(this, \"Schema\", {\n provider: provider,\n schemaName: \"myschema\",\n databaseName: database.databaseName,\n})\n```\n\nOne may need a role permitted for using schema:\n\n```ts\nnew Schema(this, \"Schema\", {\n provider: provider,\n schemaName: \"myschema\",\n databaseName: database.databaseName,\n role: role,\n})\n```\n\n## Sql\n\nYou can insert arbitrary SQL into your database with the `Sql` construct:\n\n```ts\nimport { Sql } from \"cdk-rds-sql\"\n\nconst sql = new Sql(this, \"Sql\", {\n provider: provider,\n database: database,\n statement: \"create table t (i int)\",\n})\n```\n\nCreate a table if it does not exist, and grant a role privileges:\n\n```ts\nconst sql = new Sql(this, \"Sql\", {\n provider: provider,\n database: database,\n statement: `\ncreate table if not exists t (i int);\ngrant select on t to myrole;\n`,\n})\n```\n\nRollback sql on stack deletion:\n\n```ts\nconst sql = new Sql(this, \"Sql\", {\n provider: provider,\n database: database,\n statement: `\ncreate table if not exists t (i int);\ngrant select on t to myrole;\n`,\n rollback: `\nDO $$BEGIN\n IF EXISTS (select from pg_database WHERE datname = 't') THEN\n IF EXISTS (select from pg_catalog.pg_roles WHERE rolname = 'myrole') THEN\n revoke select t from myrole;\n END IF;\n drop table t;\n END IF;\nEND$$;\n`,\n})\n```\n\nNote that there is no synchronisation between various `Sql`\nconstructs, in particular the order in your code does not determine\nthe order in which your SQL is executed. This happens in parallel,\nunless you specify an explicit dependency via `sql.node.addDepency()`.\n\nThere are a lot of concerns when using `Sql`:\n\n- When you update your Sql, your previous Sql is not \"rolled back\",\n the new Sql is simply executed again.\n- When you delete your `Sql` construct the rollback is executed if specified\n- When permission are granted via `Sql` they must be removed via\n rollback to succesfully remove the role\n- Currently the `Sql` constructs has less than 5 minutes to execute\n its work.\n- It is unknown how large your SQL can be.\n\n# Parameters\n\nSome lambda constructs, in particular [Bref](https://bref.sh/), do not\nsupport secrets out of the box. Use the `parameterPrefix` property to\ncreate SSM parameters in addition to a secret:\n\n```ts\nconst role = new Role(this, \"Role\", {\n provider: provider,\n roleName: \"myrole\",\n databaseName: \"mydb\",\n parameterPrefix: \"/my-app/\",\n})\n```\n\nThis will create `/my-app/username`, `/my-app/password` and such.\n\nTo access parameters you will need IAM permissions such as:\n\n```ts\ninitialPolicy: [\n new iam.PolicyStatement({\n\tactions: [\"ssm:GetParameter\", \"ssm:GetParameters\"],\n\tresources: [\n\t // Grant access to all parameters under the base path\n\t `arn:aws:ssm:${this.region}:${this.account}:parameter/my-app/*`,\n\t],\n\teffect: iam.Effect.ALLOW,\n })\n],\n```\n\nNote that your VPC will need an SSM Parameters interface endpoint to support this.\n\n# IPv6\n\nIf you use the provider in an IPv6 subnet you probably need these settings:\n\n```ts\nimport { Provider } from \"cdk-rds-sql\"\n\nconst provider = new Provider(this, \"Provider\", {\n ...\n functionProps: {\n\tipv6AllowedForDualStack: true,\n\tallowAllIpv6Outbound: true,\n },\n}\n```\n\n# Working on this code\n\nThis code is managed by\n[projen](https://github.com/projen/projen/blob/main/README.md). In\naddition [pre-commit](https://pre-commit.com/) is used.\n\nSo after git clone and `npm ci` you would do:\n\n```\npre-commit install --install-hooks --hook-type commit-msg --hook-type pre-commit\n```\n\nto install the pre-commit hooks.\n\n## Testing\n\nTest code via projen with:\n\n npx projen test\n\nYou can run the sample stack with:\n\n npx projen integ:deploy:serverless\n\nIf you want to use an existing vpc:\n\n npx cdk deploy --context vpc-id=vpc-0123456789 TestServerlessV2Stack\n\n# To do\n\n- Update role: will not revoke connect to previous database if database name has changed.\n"
4083
+ "markdown": "# About\n\nThis CDK construct library makes it possible to create databases,\nschemas, and roles in an Aurora Serverless v2, RDS Database Cluster,\nDatabase Instance, or AWS DSQL clusters. PostgreSQL, MySQL, and DSQL\ndatabases are supported.\n\nThis construct library is intended to be used in enterprise\nenvironments, and works in isolated subnets.\n\n<p align=\"left\">\n <a href=\"https://github.com/semantic-release/semantic-release\"><img src=\"https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release\" alt=semantic-release: angular\"></a>\n <a href=\"https://github.com/berenddeboer/cdk-rds-sql/actions/workflows/release.yml\"><img src=\"https://github.com/berenddeboer/cdk-rds-sql/actions/workflows/release.yml/badge.svg\" alt=\"Release badge\"></a>\n</p>\n\n# Requirements\n\n- CDK v2.\n\n# Installation\n\n npm i cdk-rds-sql\n\n# Usage\n\n## Provider\n\nFirst setup your VPC and create your cluster:\n\n```ts\nimport { Duration, RemovalPolicy } from \"aws-cdk-lib\"\nimport * as ec2 from \"aws-cdk-lib/aws-ec2\"\nimport * as rds from \"aws-cdk-lib/aws-rds\"\n\nconst vpc = ec2.Vpc.fromLookup(this, \"Vpc\", {\n vpcId: this.node.tryGetContext(\"vpc-id\"),\n})\n\nconst cluster = new rds.ServerlessCluster(this, \"Cluster\", {\n vpc: vpc,\n vpcSubnets: {\n subnetType: ec2.SubnetType.PRIVATE_ISOLATED,\n },\n engine: rds.DatabaseClusterEngine.AURORA_POSTGRESQL,\n parameterGroup: rds.ParameterGroup.fromParameterGroupName(\n this,\n \"ParameterGroup\",\n \"default.aurora-postgresql11\"\n ),\n removalPolicy: RemovalPolicy.DESTROY,\n scaling: {\n autoPause: Duration.minutes(60),\n minCapacity: rds.AuroraCapacityUnit.ACU_2,\n maxCapacity: rds.AuroraCapacityUnit.ACU_2,\n },\n})\n```\n\nThen create a provider which will connect to your database. For a cluster:\n\n```ts\nimport { Provider } from \"cdk-rds-sql\"\n\nconst provider = new Provider(this, \"Provider\", {\n vpc: vpc,\n cluster: cluster,\n secret: cluster.secret!,\n})\n```\n\nFor an instance:\n\n```ts\nimport { Provider } from \"cdk-rds-sql\"\n\nconst provider = new Provider(this, \"Provider\", {\n vpc: vpc,\n instance: instance,\n secret: cluster.secret!,\n})\n```\n\nThe provider will setup a lambda, which normally lives in the same VPC\nas the database. You can give a different VPC, as long as that VPC has\naccess to the VPC of the database. Only the provider lambda will talk\nto your database.\n\nThe provider will by default use the private isolated subnet of the\nVPC. Your isolated network must have a VPC endpoint to AWS Secrets Manager\nand possibly KMS as well. If you want to use a subnet with egress\naccess in case you have no such VPC endpoints, specify the subnet as\nfollows:\n\n```ts\nimport { Provider } from \"cdk-rds-sql\"\n\nconst provider = new Provider(this, \"Provider\", {\n vpc: vpc,\n vpcSubnets: {\n subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS,\n },\n cluster: cluster,\n secret: cluster.secret!,\n})\n```\n\n## Roles\n\nCreate a postgres role (or mysql user) for a cluster as follows:\n\n```ts\nimport { Role } from \"cdk-rds-sql\"\n\nconst role = new Role(this, \"Role\", {\n provider: provider,\n roleName: \"myrole\",\n databaseName: \"mydb\",\n})\n```\n\nThis will automatically create a secret just like `ServerlessCluster`\ndoes, with all the connection info needed for this user. It's secret\nvalue is a JSON like:\n\n```json\n{\n \"dbClusterIdentifier\": \"teststack-clustereb1186t9-sh4wpqfdyfvu\",\n \"password\": \"very-long-and-boring\",\n \"dbname\": \"mydb\",\n \"engine\": \"postgres\",\n \"port\": 5432,\n \"host\": \"teststack-clustereb1186t9-sh4wpqfdyfvu.cluster-cgudolabssna.us-east-1.rds.amazonaws.com\",\n \"username\": \"myrole\"\n}\n```\n\nYou can access the secret via `role.secret`.\n\nInstead of `databaseName` you can also specify `database` to reference\nan existing database. The role will not be created until the database\nhas been created.\n\nIf you want to make the role the owner of a new database, just specify\nthe `databaseName` here, and create the database later.\n\n### IAM Authentication\n\nInstead of password-based authentication, you can create roles that\nuse AWS IAM database authentication. This eliminates the need to store\ndatabase passwords and provides enhanced security through AWS IAM\npolicies.\n\n```ts\nimport { Role } from \"cdk-rds-sql\"\n\nconst iamRole = new Role(this, \"IamRole\", {\n provider: provider,\n roleName: \"myiamrole\",\n databaseName: \"mydb\",\n enableIamAuth: true,\n})\n```\n\nFor IAM-authenticated roles, the secret will not contain a password field:\n\n```json\n{\n \"dbClusterIdentifier\": \"teststack-clustereb1186t9-sh4wpqfdyfvu\",\n \"dbname\": \"mydb\",\n \"engine\": \"postgres\",\n \"port\": 5432,\n \"host\": \"teststack-clustereb1186t9-sh4wpqfdyfvu.cluster-cgudolabssna.us-east-1.rds.amazonaws.com\",\n \"username\": \"myiamrole\"\n}\n```\n\n**Requirements for IAM Authentication:**\n\n- SSL connections are required (enabled by default in this library)\n- Your application must have IAM permissions to connect to the database\n- The database user/role name must match the IAM identity\n\n**IAM Policy Example:**\n\nYour application will need an IAM policy like this to connect:\n\n```json\n{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Effect\": \"Allow\",\n \"Action\": [\"rds-db:connect\"],\n \"Resource\": [\n \"arn:aws:rds-db:region:account-id:dbuser:cluster-resource-id/myiamrole\"\n ]\n }\n ]\n}\n```\n\nBoth PostgreSQL and MySQL databases support IAM authentication. For more details, see the [AWS RDS IAM Database Authentication documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html).\n\n### MySQL support\n\nIn MySQL users are created with '%' as value for the host. It is hard\nto do this better:\n\n- Determine the CIDR blocks used by a VPC is not trivial.\n- For imported VPCs you cannot specify the IPv6 CIDR.\n- CIDRs might change without the system knowing, meaning applications\n could lose access to the database at random times, such as when a\n container is restarted.\n\n## Database\n\nCreate a database as follows:\n\n```ts\nimport { Database } from \"cdk-rds-sql\"\n\nconst database = new Database(this, \"Database\", {\n provider: provider,\n databaseName: \"mydb\",\n})\n```\n\nYou can provide an owner, which makes it easy to create database owned\nby a new user:\n\n```ts\nconst database = new Database(this, \"Database\", {\n provider: provider,\n databaseName: \"mydb\",\n owner: role,\n})\n```\n\n## Schema\n\nCreate a schema in the default database as follows:\n\n```ts\nimport { Schema } from \"cdk-rds-sql\"\n\nnew Schema(this, \"Schema\", {\n provider: provider,\n schemaName: \"myschema\",\n})\n```\n\nOr in another database:\n\n```ts\nconst database = new Database(this, \"Database\", {\n provider: provider,\n databaseName: \"mydb\",\n})\n\nnew Schema(this, \"Schema\", {\n provider: provider,\n schemaName: \"myschema\",\n databaseName: database.databaseName,\n})\n```\n\nOne may need a role permitted for using schema:\n\n```ts\nnew Schema(this, \"Schema\", {\n provider: provider,\n schemaName: \"myschema\",\n databaseName: database.databaseName,\n role: role,\n})\n```\n\n## Sql\n\nYou can insert arbitrary SQL into your database with the `Sql` construct:\n\n```ts\nimport { Sql } from \"cdk-rds-sql\"\n\nconst sql = new Sql(this, \"Sql\", {\n provider: provider,\n database: database,\n statement: \"create table t (i int)\",\n})\n```\n\nCreate a table if it does not exist, and grant a role privileges:\n\n```ts\nconst sql = new Sql(this, \"Sql\", {\n provider: provider,\n database: database,\n statement: `\ncreate table if not exists t (i int);\ngrant select on t to myrole;\n`,\n})\n```\n\nRollback sql on stack deletion:\n\n```ts\nconst sql = new Sql(this, \"Sql\", {\n provider: provider,\n database: database,\n statement: `\ncreate table if not exists t (i int);\ngrant select on t to myrole;\n`,\n rollback: `\nDO $$BEGIN\n IF EXISTS (select from pg_database WHERE datname = 't') THEN\n IF EXISTS (select from pg_catalog.pg_roles WHERE rolname = 'myrole') THEN\n revoke select t from myrole;\n END IF;\n drop table t;\n END IF;\nEND$$;\n`,\n})\n```\n\nNote that there is no synchronisation between various `Sql`\nconstructs, in particular the order in your code does not determine\nthe order in which your SQL is executed. This happens in parallel,\nunless you specify an explicit dependency via `sql.node.addDepency()`.\n\nThere are a lot of concerns when using `Sql`:\n\n- When you update your Sql, your previous Sql is not \"rolled back\",\n the new Sql is simply executed again.\n- When you delete your `Sql` construct the rollback is executed if specified\n- When permission are granted via `Sql` they must be removed via\n rollback to succesfully remove the role\n- Currently the `Sql` constructs has less than 5 minutes to execute\n its work.\n- It is unknown how large your SQL can be.\n\n# Parameters\n\nSome lambda constructs, in particular [Bref](https://bref.sh/), do not\nsupport secrets out of the box. Use the `parameterPrefix` property to\ncreate SSM parameters in addition to a secret:\n\n```ts\nconst role = new Role(this, \"Role\", {\n provider: provider,\n roleName: \"myrole\",\n databaseName: \"mydb\",\n parameterPrefix: \"/my-app/\",\n})\n```\n\nThis will create `/my-app/username`, `/my-app/password` and such.\n\nTo access parameters you will need IAM permissions such as:\n\n```ts\ninitialPolicy: [\n new iam.PolicyStatement({\n\tactions: [\"ssm:GetParameter\", \"ssm:GetParameters\"],\n\tresources: [\n\t // Grant access to all parameters under the base path\n\t `arn:aws:ssm:${this.region}:${this.account}:parameter/my-app/*`,\n\t],\n\teffect: iam.Effect.ALLOW,\n })\n],\n```\n\nNote that your VPC will need an SSM Parameters interface endpoint to support this.\n\n# AWS DSQL Support\n\nThis construct also supports AWS DSQL. DSQL is a great number of\nlimitations around it's postgresql support, so there is some learing\ncurve. This library supports creating roles, schemas, and executing\nSQL on DSQL clusters. Creating databases is not supported by DSQL.\n\n## DSQL Provider Setup\n\nDSQL clusters don't require a VPC or secrets since they use IAM authentication:\n\n```ts\nimport * as dsql from \"aws-cdk-lib/aws-dsql\"\nimport { Provider } from \"cdk-rds-sql\"\n\nconst dsqlCluster = new dsql.CfnCluster(this, \"DsqlCluster\", {\n deletionProtectionEnabled: false,\n})\n\nconst provider = new Provider(this, \"Provider\", {\n cluster: dsqlCluster,\n // No VPC or secret needed for DSQL\n})\n```\n\nYou can access DSQL from within a VPC, but cdk-rds-sql has not been\nspecifically tested with that scenario.\n\n## DSQL Roles\n\nDSQL always uses IAM authentication, so the `enableIamAuth` property is ignored:\n\n```ts\nimport { Role } from \"cdk-rds-sql\"\n\nconst role = new Role(this, \"Role\", {\n provider: provider,\n roleName: \"myrole\",\n})\n```\n\n## Using DSQL\n\nConnecting to DSQL requires a couple of things:\n\n1. Your IAM role needs the `dsql:DbConnect` IAM permission to connect to the cluster.\n2. You probably want a normal postgres role (not \"admin\") to use from your apps.\n3. Your IAM role needs to be connected to your postgres role: use the `IamGrant` construct for that:\n\n ```ts\n new IamGrant(this, \"LambdaIamGrant\", {\n provider: provider,\n roleName: role.roleName,\n resourceArn: queryLambda.role!.roleArn,\n })\n ```\n\n4. From your code use the Dsql signer to create the password:\n\n ```ts\n import { DsqlSigner } from \"@aws-sdk/dsql-signer\"\n import { Client } from \"pg\"\n\n const region =\n process.env[\"AWS_REGION\"] || process.env[\"AWS_DEFAULT_REGION\"] || \"us-west-2\"\n\n // Generate DSQL auth token using AWS SDK\n const signer = new DsqlSigner({\n hostname: host,\n region,\n })\n\n const authToken = await signer.getDbConnectAuthToken()\n\n const client = new Client({\n host,\n port: 5432,\n user: dbUser,\n database: dbName,\n password: authToken,\n ssl: { rejectUnauthorized: false },\n })\n\n await client.connect()\n ```\n\n# IPv6\n\nIf you use the provider in an IPv6 subnet you probably need these settings:\n\n```ts\nimport { Provider } from \"cdk-rds-sql\"\n\nconst provider = new Provider(this, \"Provider\", {\n ...\n functionProps: {\n\tipv6AllowedForDualStack: true,\n\tallowAllIpv6Outbound: true,\n },\n}\n```\n\n# Disabling SSL\n\nThe default connection to RDS is ssl enabled. You can disable ssl by\nsetting the `ssl` option to `false`:\n\n```ts\nconst provider = new Provider(this, \"Provider\", {\n vpc: vpc,\n instance: instance,\n secret: cluster.secret!,\n ssl: false, // default is true\n})\n```\n\n# Working on this code\n\nThis code is managed by\n[projen](https://github.com/projen/projen/blob/main/README.md). In\naddition [pre-commit](https://pre-commit.com/) is used.\n\nSo after git clone and `npm ci` you would do:\n\n```\npre-commit install --install-hooks --hook-type commit-msg --hook-type pre-commit\n```\n\nto install the pre-commit hooks.\n\n## Testing\n\nTest code via projen with:\n\n npx projen test\n\nYou can run the sample stack with:\n\n npx projen integ:deploy:serverless\n\nIf you want to use an existing vpc:\n\n npx cdk deploy --context vpc-id=vpc-0123456789 TestServerlessV2Stack\n\nYou can also test DSQL support with:\n\n npx projen integ:deploy:dsql\n\n# To do\n\n- Update role: will not revoke connect to previous database if database name has changed.\n"
3979
4084
  },
3980
4085
  "repository": {
3981
4086
  "type": "git",
@@ -4001,7 +4106,7 @@
4001
4106
  },
4002
4107
  "locationInModule": {
4003
4108
  "filename": "src/database.ts",
4004
- "line": 51
4109
+ "line": 62
4005
4110
  },
4006
4111
  "parameters": [
4007
4112
  {
@@ -4030,7 +4135,7 @@
4030
4135
  "kind": "class",
4031
4136
  "locationInModule": {
4032
4137
  "filename": "src/database.ts",
4033
- "line": 39
4138
+ "line": 50
4034
4139
  },
4035
4140
  "methods": [
4036
4141
  {
@@ -4041,7 +4146,7 @@
4041
4146
  },
4042
4147
  "locationInModule": {
4043
4148
  "filename": "src/database.ts",
4044
- "line": 43
4149
+ "line": 54
4045
4150
  },
4046
4151
  "name": "fromDatabaseName",
4047
4152
  "parameters": [
@@ -4081,7 +4186,7 @@
4081
4186
  "immutable": true,
4082
4187
  "locationInModule": {
4083
4188
  "filename": "src/database.ts",
4084
- "line": 49
4189
+ "line": 60
4085
4190
  },
4086
4191
  "name": "databaseName",
4087
4192
  "overrides": "cdk-rds-sql.IDatabase",
@@ -4102,7 +4207,7 @@
4102
4207
  "kind": "interface",
4103
4208
  "locationInModule": {
4104
4209
  "filename": "src/database.ts",
4105
- "line": 19
4210
+ "line": 30
4106
4211
  },
4107
4212
  "name": "DatabaseProps",
4108
4213
  "properties": [
@@ -4115,7 +4220,7 @@
4115
4220
  "immutable": true,
4116
4221
  "locationInModule": {
4117
4222
  "filename": "src/database.ts",
4118
- "line": 11
4223
+ "line": 22
4119
4224
  },
4120
4225
  "name": "databaseName",
4121
4226
  "type": {
@@ -4131,7 +4236,7 @@
4131
4236
  "immutable": true,
4132
4237
  "locationInModule": {
4133
4238
  "filename": "src/database.ts",
4134
- "line": 23
4239
+ "line": 34
4135
4240
  },
4136
4241
  "name": "provider",
4137
4242
  "type": {
@@ -4147,7 +4252,7 @@
4147
4252
  "immutable": true,
4148
4253
  "locationInModule": {
4149
4254
  "filename": "src/database.ts",
4150
- "line": 16
4255
+ "line": 27
4151
4256
  },
4152
4257
  "name": "owner",
4153
4258
  "optional": true,
@@ -4167,7 +4272,7 @@
4167
4272
  "kind": "interface",
4168
4273
  "locationInModule": {
4169
4274
  "filename": "src/database.ts",
4170
- "line": 26
4275
+ "line": 37
4171
4276
  },
4172
4277
  "name": "IDatabase",
4173
4278
  "properties": [
@@ -4179,7 +4284,7 @@
4179
4284
  "immutable": true,
4180
4285
  "locationInModule": {
4181
4286
  "filename": "src/database.ts",
4182
- "line": 27
4287
+ "line": 38
4183
4288
  },
4184
4289
  "name": "databaseName",
4185
4290
  "type": {
@@ -4189,6 +4294,115 @@
4189
4294
  ],
4190
4295
  "symbolId": "src/database:IDatabase"
4191
4296
  },
4297
+ "cdk-rds-sql.IamGrant": {
4298
+ "assembly": "cdk-rds-sql",
4299
+ "base": "aws-cdk-lib.CustomResource",
4300
+ "docs": {
4301
+ "stability": "stable"
4302
+ },
4303
+ "fqn": "cdk-rds-sql.IamGrant",
4304
+ "initializer": {
4305
+ "docs": {
4306
+ "stability": "stable"
4307
+ },
4308
+ "locationInModule": {
4309
+ "filename": "src/iam-grant.ts",
4310
+ "line": 32
4311
+ },
4312
+ "parameters": [
4313
+ {
4314
+ "name": "scope",
4315
+ "type": {
4316
+ "fqn": "constructs.Construct"
4317
+ }
4318
+ },
4319
+ {
4320
+ "name": "id",
4321
+ "type": {
4322
+ "primitive": "string"
4323
+ }
4324
+ },
4325
+ {
4326
+ "name": "props",
4327
+ "type": {
4328
+ "fqn": "cdk-rds-sql.IamGrantProps"
4329
+ }
4330
+ }
4331
+ ]
4332
+ },
4333
+ "kind": "class",
4334
+ "locationInModule": {
4335
+ "filename": "src/iam-grant.ts",
4336
+ "line": 31
4337
+ },
4338
+ "name": "IamGrant",
4339
+ "symbolId": "src/iam-grant:IamGrant"
4340
+ },
4341
+ "cdk-rds-sql.IamGrantProps": {
4342
+ "assembly": "cdk-rds-sql",
4343
+ "datatype": true,
4344
+ "docs": {
4345
+ "stability": "stable"
4346
+ },
4347
+ "fqn": "cdk-rds-sql.IamGrantProps",
4348
+ "kind": "interface",
4349
+ "locationInModule": {
4350
+ "filename": "src/iam-grant.ts",
4351
+ "line": 7
4352
+ },
4353
+ "name": "IamGrantProps",
4354
+ "properties": [
4355
+ {
4356
+ "abstract": true,
4357
+ "docs": {
4358
+ "stability": "stable",
4359
+ "summary": "Provider."
4360
+ },
4361
+ "immutable": true,
4362
+ "locationInModule": {
4363
+ "filename": "src/iam-grant.ts",
4364
+ "line": 11
4365
+ },
4366
+ "name": "provider",
4367
+ "type": {
4368
+ "fqn": "cdk-rds-sql.Provider"
4369
+ }
4370
+ },
4371
+ {
4372
+ "abstract": true,
4373
+ "docs": {
4374
+ "stability": "stable",
4375
+ "summary": "IAM resource ARN (role, user, or other IAM principal)."
4376
+ },
4377
+ "immutable": true,
4378
+ "locationInModule": {
4379
+ "filename": "src/iam-grant.ts",
4380
+ "line": 21
4381
+ },
4382
+ "name": "resourceArn",
4383
+ "type": {
4384
+ "primitive": "string"
4385
+ }
4386
+ },
4387
+ {
4388
+ "abstract": true,
4389
+ "docs": {
4390
+ "stability": "stable",
4391
+ "summary": "Database role name to grant IAM access to."
4392
+ },
4393
+ "immutable": true,
4394
+ "locationInModule": {
4395
+ "filename": "src/iam-grant.ts",
4396
+ "line": 16
4397
+ },
4398
+ "name": "roleName",
4399
+ "type": {
4400
+ "primitive": "string"
4401
+ }
4402
+ }
4403
+ ],
4404
+ "symbolId": "src/iam-grant:IamGrantProps"
4405
+ },
4192
4406
  "cdk-rds-sql.Provider": {
4193
4407
  "assembly": "cdk-rds-sql",
4194
4408
  "base": "constructs.Construct",
@@ -4202,7 +4416,7 @@
4202
4416
  },
4203
4417
  "locationInModule": {
4204
4418
  "filename": "src/provider.ts",
4205
- "line": 89
4419
+ "line": 107
4206
4420
  },
4207
4421
  "parameters": [
4208
4422
  {
@@ -4228,7 +4442,7 @@
4228
4442
  "kind": "class",
4229
4443
  "locationInModule": {
4230
4444
  "filename": "src/provider.ts",
4231
- "line": 76
4445
+ "line": 94
4232
4446
  },
4233
4447
  "methods": [
4234
4448
  {
@@ -4237,7 +4451,7 @@
4237
4451
  },
4238
4452
  "locationInModule": {
4239
4453
  "filename": "src/provider.ts",
4240
- "line": 133
4454
+ "line": 186
4241
4455
  },
4242
4456
  "name": "newCustomResourceHandler",
4243
4457
  "parameters": [
@@ -4277,7 +4491,7 @@
4277
4491
  "immutable": true,
4278
4492
  "locationInModule": {
4279
4493
  "filename": "src/provider.ts",
4280
- "line": 80
4494
+ "line": 98
4281
4495
  },
4282
4496
  "name": "cluster",
4283
4497
  "type": {
@@ -4288,6 +4502,9 @@
4288
4502
  },
4289
4503
  {
4290
4504
  "fqn": "aws-cdk-lib.aws_rds.IDatabaseInstance"
4505
+ },
4506
+ {
4507
+ "fqn": "aws-cdk-lib.aws_dsql.CfnCluster"
4291
4508
  }
4292
4509
  ]
4293
4510
  }
@@ -4302,7 +4519,7 @@
4302
4519
  "immutable": true,
4303
4520
  "locationInModule": {
4304
4521
  "filename": "src/provider.ts",
4305
- "line": 87
4522
+ "line": 105
4306
4523
  },
4307
4524
  "name": "engine",
4308
4525
  "type": {
@@ -4316,7 +4533,7 @@
4316
4533
  "immutable": true,
4317
4534
  "locationInModule": {
4318
4535
  "filename": "src/provider.ts",
4319
- "line": 79
4536
+ "line": 97
4320
4537
  },
4321
4538
  "name": "handler",
4322
4539
  "type": {
@@ -4330,11 +4547,11 @@
4330
4547
  "immutable": true,
4331
4548
  "locationInModule": {
4332
4549
  "filename": "src/provider.ts",
4333
- "line": 78
4550
+ "line": 95
4334
4551
  },
4335
- "name": "secret",
4552
+ "name": "serviceToken",
4336
4553
  "type": {
4337
- "fqn": "aws-cdk-lib.aws_secretsmanager.ISecret"
4554
+ "primitive": "string"
4338
4555
  }
4339
4556
  },
4340
4557
  {
@@ -4344,11 +4561,12 @@
4344
4561
  "immutable": true,
4345
4562
  "locationInModule": {
4346
4563
  "filename": "src/provider.ts",
4347
- "line": 77
4564
+ "line": 96
4348
4565
  },
4349
- "name": "serviceToken",
4566
+ "name": "secret",
4567
+ "optional": true,
4350
4568
  "type": {
4351
- "primitive": "string"
4569
+ "fqn": "aws-cdk-lib.aws_secretsmanager.ISecret"
4352
4570
  }
4353
4571
  }
4354
4572
  ],
@@ -4364,20 +4582,21 @@
4364
4582
  "kind": "interface",
4365
4583
  "locationInModule": {
4366
4584
  "filename": "src/provider.ts",
4367
- "line": 14
4585
+ "line": 24
4368
4586
  },
4369
4587
  "name": "RdsSqlProps",
4370
4588
  "properties": [
4371
4589
  {
4372
4590
  "abstract": true,
4373
4591
  "docs": {
4592
+ "remarks": "Supports both traditional RDS/Aurora clusters and DSQL clusters.\n- For RDS/Aurora: security groups will be configured to allow access\n- For DSQL: IAM authentication will be used instead of secrets",
4374
4593
  "stability": "stable",
4375
- "summary": "Your database."
4594
+ "summary": "Your database cluster or instance."
4376
4595
  },
4377
4596
  "immutable": true,
4378
4597
  "locationInModule": {
4379
4598
  "filename": "src/provider.ts",
4380
- "line": 34
4599
+ "line": 49
4381
4600
  },
4382
4601
  "name": "cluster",
4383
4602
  "type": {
@@ -4388,6 +4607,9 @@
4388
4607
  },
4389
4608
  {
4390
4609
  "fqn": "aws-cdk-lib.aws_rds.IDatabaseInstance"
4610
+ },
4611
+ {
4612
+ "fqn": "aws-cdk-lib.aws_dsql.CfnCluster"
4391
4613
  }
4392
4614
  ]
4393
4615
  }
@@ -4396,71 +4618,73 @@
4396
4618
  {
4397
4619
  "abstract": true,
4398
4620
  "docs": {
4399
- "remarks": "Usually this is your cluster's master secret.",
4621
+ "default": "- empty",
4622
+ "remarks": "This enables additional function customization such as the log group. However,\nlambda function properties controlled by other {RdsSqlProps} parameters will trump\nopions set via this parameter.",
4400
4623
  "stability": "stable",
4401
- "summary": "Secret that grants access to your database."
4624
+ "summary": "Additional function customization."
4402
4625
  },
4403
4626
  "immutable": true,
4404
4627
  "locationInModule": {
4405
4628
  "filename": "src/provider.ts",
4406
- "line": 41
4629
+ "line": 84
4407
4630
  },
4408
- "name": "secret",
4631
+ "name": "functionProps",
4632
+ "optional": true,
4409
4633
  "type": {
4410
- "fqn": "aws-cdk-lib.aws_secretsmanager.ISecret"
4634
+ "fqn": "aws-cdk-lib.aws_lambda_nodejs.NodejsFunctionProps"
4411
4635
  }
4412
4636
  },
4413
4637
  {
4414
4638
  "abstract": true,
4415
4639
  "docs": {
4416
- "default": "- Function is not placed within a VPC.",
4417
- "remarks": "Normally this is the VPC of your database.",
4640
+ "default": "- false",
4641
+ "remarks": "This includes passwords. Use only for debugging.",
4418
4642
  "stability": "stable",
4419
- "summary": "VPC network to place the provider lambda."
4643
+ "summary": "Log SQL statements."
4420
4644
  },
4421
4645
  "immutable": true,
4422
4646
  "locationInModule": {
4423
4647
  "filename": "src/provider.ts",
4424
- "line": 22
4648
+ "line": 73
4425
4649
  },
4426
- "name": "vpc",
4650
+ "name": "logger",
4651
+ "optional": true,
4427
4652
  "type": {
4428
- "fqn": "aws-cdk-lib.aws_ec2.IVpc"
4653
+ "primitive": "boolean"
4429
4654
  }
4430
4655
  },
4431
4656
  {
4432
4657
  "abstract": true,
4433
4658
  "docs": {
4434
- "default": "- empty",
4435
- "remarks": "This enables additional function customization such as the log group. However,\nlambda function properties controlled by other {RdsSqlProps} parameters will trump\nopions set via this parameter.",
4659
+ "default": "- undefined for DSQL clusters using IAM authentication",
4660
+ "remarks": "Usually this is your cluster's master secret.\nNot required when relying on IAM authentication (such as DSQL).",
4436
4661
  "stability": "stable",
4437
- "summary": "Additional function customization."
4662
+ "summary": "Secret that grants access to your database."
4438
4663
  },
4439
4664
  "immutable": true,
4440
4665
  "locationInModule": {
4441
4666
  "filename": "src/provider.ts",
4442
- "line": 66
4667
+ "line": 59
4443
4668
  },
4444
- "name": "functionProps",
4669
+ "name": "secret",
4445
4670
  "optional": true,
4446
4671
  "type": {
4447
- "fqn": "aws-cdk-lib.aws_lambda_nodejs.NodejsFunctionProps"
4672
+ "fqn": "aws-cdk-lib.aws_secretsmanager.ISecret"
4448
4673
  }
4449
4674
  },
4450
4675
  {
4451
4676
  "abstract": true,
4452
4677
  "docs": {
4453
- "default": "- false",
4454
- "remarks": "This includes passwords. Use only for debugging.",
4678
+ "default": "- true",
4455
4679
  "stability": "stable",
4456
- "summary": "Log SQL statements."
4680
+ "summary": "Use SSL?"
4457
4681
  },
4458
4682
  "immutable": true,
4459
4683
  "locationInModule": {
4460
4684
  "filename": "src/provider.ts",
4461
- "line": 55
4685
+ "line": 91
4462
4686
  },
4463
- "name": "logger",
4687
+ "name": "ssl",
4464
4688
  "optional": true,
4465
4689
  "type": {
4466
4690
  "primitive": "boolean"
@@ -4469,37 +4693,38 @@
4469
4693
  {
4470
4694
  "abstract": true,
4471
4695
  "docs": {
4472
- "default": "- true",
4696
+ "default": "- 5 minutes",
4473
4697
  "stability": "stable",
4474
- "summary": "Use SSL?"
4698
+ "summary": "Timeout for lambda to do its work."
4475
4699
  },
4476
4700
  "immutable": true,
4477
4701
  "locationInModule": {
4478
4702
  "filename": "src/provider.ts",
4479
- "line": 73
4703
+ "line": 66
4480
4704
  },
4481
- "name": "ssl",
4705
+ "name": "timeout",
4482
4706
  "optional": true,
4483
4707
  "type": {
4484
- "primitive": "boolean"
4708
+ "fqn": "aws-cdk-lib.Duration"
4485
4709
  }
4486
4710
  },
4487
4711
  {
4488
4712
  "abstract": true,
4489
4713
  "docs": {
4490
- "default": "- 5 minutes",
4714
+ "default": "- Function is not placed within a VPC.",
4715
+ "remarks": "Normally this is the VPC of your database.\nRequired when your database is only accessible in a VPC.\nNot required for DSQL as it uses public endpoints with IAM authentication.",
4491
4716
  "stability": "stable",
4492
- "summary": "Timeout for lambda to do its work."
4717
+ "summary": "VPC network to place the provider lambda."
4493
4718
  },
4494
4719
  "immutable": true,
4495
4720
  "locationInModule": {
4496
4721
  "filename": "src/provider.ts",
4497
- "line": 48
4722
+ "line": 34
4498
4723
  },
4499
- "name": "timeout",
4724
+ "name": "vpc",
4500
4725
  "optional": true,
4501
4726
  "type": {
4502
- "fqn": "aws-cdk-lib.Duration"
4727
+ "fqn": "aws-cdk-lib.aws_ec2.IVpc"
4503
4728
  }
4504
4729
  },
4505
4730
  {
@@ -4512,7 +4737,7 @@
4512
4737
  "immutable": true,
4513
4738
  "locationInModule": {
4514
4739
  "filename": "src/provider.ts",
4515
- "line": 29
4740
+ "line": 41
4516
4741
  },
4517
4742
  "name": "vpcSubnets",
4518
4743
  "optional": true,
@@ -4564,6 +4789,12 @@
4564
4789
  "stability": "stable"
4565
4790
  },
4566
4791
  "name": "PARAMETER_PASSWORD"
4792
+ },
4793
+ {
4794
+ "docs": {
4795
+ "stability": "stable"
4796
+ },
4797
+ "name": "IAM_GRANT"
4567
4798
  }
4568
4799
  ],
4569
4800
  "name": "RdsSqlResource",
@@ -4582,7 +4813,7 @@
4582
4813
  },
4583
4814
  "locationInModule": {
4584
4815
  "filename": "src/role.ts",
4585
- "line": 152
4816
+ "line": 156
4586
4817
  },
4587
4818
  "parameters": [
4588
4819
  {
@@ -4608,7 +4839,7 @@
4608
4839
  "kind": "class",
4609
4840
  "locationInModule": {
4610
4841
  "filename": "src/role.ts",
4611
- "line": 141
4842
+ "line": 144
4612
4843
  },
4613
4844
  "name": "Role",
4614
4845
  "properties": [
@@ -4620,7 +4851,7 @@
4620
4851
  "immutable": true,
4621
4852
  "locationInModule": {
4622
4853
  "filename": "src/role.ts",
4623
- "line": 145
4854
+ "line": 148
4624
4855
  },
4625
4856
  "name": "roleName",
4626
4857
  "type": {
@@ -4629,15 +4860,17 @@
4629
4860
  },
4630
4861
  {
4631
4862
  "docs": {
4863
+ "remarks": "Only available for non-DSQL clusters as DSQL uses IAM authentication.",
4632
4864
  "stability": "stable",
4633
4865
  "summary": "The generated secret."
4634
4866
  },
4635
4867
  "immutable": true,
4636
4868
  "locationInModule": {
4637
4869
  "filename": "src/role.ts",
4638
- "line": 150
4870
+ "line": 154
4639
4871
  },
4640
4872
  "name": "secret",
4873
+ "optional": true,
4641
4874
  "type": {
4642
4875
  "fqn": "aws-cdk-lib.aws_secretsmanager.ISecret"
4643
4876
  }
@@ -4731,14 +4964,14 @@
4731
4964
  "abstract": true,
4732
4965
  "docs": {
4733
4966
  "default": "false - use password authentication",
4734
- "remarks": "When enabled, the role will be created without a password and\nconfigured for AWS IAM database authentication. The secret\nwill not contain a password field.",
4967
+ "remarks": "When enabled, the role will be created without a password and\nconfigured for AWS IAM database authentication. The secret\nwill not contain a password field.\n\nNote: For DSQL clusters, this property is ignored as DSQL always\nuses IAM authentication.",
4735
4968
  "stability": "stable",
4736
4969
  "summary": "Enable IAM authentication for this role."
4737
4970
  },
4738
4971
  "immutable": true,
4739
4972
  "locationInModule": {
4740
4973
  "filename": "src/role.ts",
4741
- "line": 84
4974
+ "line": 87
4742
4975
  },
4743
4976
  "name": "enableIamAuth",
4744
4977
  "optional": true,
@@ -4817,7 +5050,7 @@
4817
5050
  },
4818
5051
  "locationInModule": {
4819
5052
  "filename": "src/schema.ts",
4820
- "line": 35
5053
+ "line": 37
4821
5054
  },
4822
5055
  "parameters": [
4823
5056
  {
@@ -4843,7 +5076,7 @@
4843
5076
  "kind": "class",
4844
5077
  "locationInModule": {
4845
5078
  "filename": "src/schema.ts",
4846
- "line": 32
5079
+ "line": 34
4847
5080
  },
4848
5081
  "name": "Schema",
4849
5082
  "properties": [
@@ -4854,7 +5087,7 @@
4854
5087
  "immutable": true,
4855
5088
  "locationInModule": {
4856
5089
  "filename": "src/schema.ts",
4857
- "line": 33
5090
+ "line": 35
4858
5091
  },
4859
5092
  "name": "schemaName",
4860
5093
  "type": {
@@ -4931,13 +5164,14 @@
4931
5164
  {
4932
5165
  "abstract": true,
4933
5166
  "docs": {
5167
+ "remarks": "This way the role can read its own tables, but\ncannot see or access tables created by others.",
4934
5168
  "stability": "stable",
4935
- "summary": "Optional role to be granted for managing tables in schema."
5169
+ "summary": "Optional role which will be granted usage and create permissions to this schema."
4936
5170
  },
4937
5171
  "immutable": true,
4938
5172
  "locationInModule": {
4939
5173
  "filename": "src/schema.ts",
4940
- "line": 29
5174
+ "line": 31
4941
5175
  },
4942
5176
  "name": "role",
4943
5177
  "optional": true,
@@ -5078,6 +5312,6 @@
5078
5312
  "symbolId": "src/sql:SqlProps"
5079
5313
  }
5080
5314
  },
5081
- "version": "7.0.2",
5082
- "fingerprint": "Gqi6ekHV+BnnlZxO+HWWzW/Cuy9wIzQgqLQGGRdodAw="
5315
+ "version": "7.1.0",
5316
+ "fingerprint": "Br67rMWoquyfP4fkoXFhxUY052ccvSQ97cHjBsTGprI="
5083
5317
  }