The DatabaseInstanceProps TS api is missing 'securityGroups' that exists in docs
Docs: https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-rds.DatabaseInstanceProps.html#securitygroups-span-class-api-icon-api-icon-experimental-title-this-api-element-is-experimental-it-may-change-without-notice-span
But it's not accessible in TS when creating a DatabaseInstance.
This change has been introduced in 1.15.0, are you using the latest version?
https://github.com/aws/aws-cdk/blob/v1.15.0/CHANGELOG.md
Yes, I'm on 1.15.0.
I had to use this so far:
(dbInstanceProps as any).securityGroups = [ securityGroup ];
Please double check that you are on 1.15.0, see the released instance.d.ts in 1.15.0 https://unpkg.com/browse/@aws-cdk/[email protected]/lib/instance.d.ts
Yes, I've checked your link and the DatabaseInstanceProps interface doesn't have the securityGroups property. But I've found the DatabaseInstanceNewProps interface that is used in the ctor of the DatabaseInstanceNew class, but the latter is not in the docs.
Ok, it seems that I got it. The DatabaseInstanceNewProps interface is supposed to be used with the new DatabaseInstance(...) statement. But it's impossible to realize it since in the docs I can see only:
new DatabaseInstance(scope: Construct, id: string, props: DatabaseInstanceProps)
UPD: It appears that it's impossible to use DatabaseInstanceNewProps with new DatabaseInstance(...).
I don't get your problem... DatabaseInstanceProps extends DatabaseInstanceSourceProps which extends DatabaseInstanceNewProps.
You can clearly see in this test that it's possible to create a DatabaseInstance with the securityGroups prop:
https://github.com/aws/aws-cdk/blob/bdbe3aad61ae6d239c113670d0ed1b1052abf417/packages/%40aws-cdk/aws-rds/test/test.instance.ts#L551-L567
Feel like wasting your time. I tried it one more time and I don't see any TS errors now. I don't know what it was, probably some kind of cache in VSCode. Thanks for your help, I'm closing this issue.