Open ttaka66 opened 1 year ago
I believe this is because how it is implemented here unless it is rendered with a Lazy class I guess.
Before we refactor its implementation, the easiest way is just update your cluster securityGroups
prop as:
securityGroups: [sg, newSg],
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
@pahud Thank you for your reply. You say the feature that we able to add Security Groups later will be implemented in the future?
Describe the bug
I wanna add a security group to all instances within the RDS cluster that created with the CDK. It seems to be similar to #17684.
I tried to write the code below by TypeScript.
The RDS instances within the cluster didn't have newSg.
In addition, I tried to get each instances within the cluster to let each have security group. But, It seems that DatabaseCluster class don't have a method to get instances. Is there a good way to add security groups to the RDS cluster later?
Expected Behavior
The RDS cluster (named
cluster
by above example) can add a security group (namednewSG
by above example) to instances.Current Behavior
The RDS cluster (named
cluster
by above example) can't add a security group (namednewSG
by above example) to instances.Reproduction Steps
Install CDK
Create the app
Copy and Paste below code to
lib/additional-sg-stack.ts
Bootstrap
Add below
@aws-cdk/core:bootstrapQualifier
context tocdk.json
.Deploy the stack
You can see that the RDS instance containing the name
adsgdb
has just security group namedadsg-sg
. But, I expect the RDS instance to have two security groups.(adsg-sg
andnew-adsg-sg
)Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.81.0
Framework Version
No response
Node.js Version
v18.11.0
OS
macOS 13.4
Language
Typescript
Language Version
TypeScript (5.0.4)
Other information
No response