Hi everyone im having a kind of design problem and...
# typescript
p
Hi everyone im having a kind of design problem and was looking for advice. My design is the following: ComponentResource1 that holds multiple components: 1. aws eks 2. Aws rds 3. Aws alb When creating those components im using the constructor to pass in those values but the problem is i have like 10-15 different parameters/args and the component initilization and constructor is huge Is there any way to make it more clean? Or is this just how its done
l
Does all of the configuration have to be passed in to the component resource's constructor? Generally, in your context some resource constructor values will be fixed, so you can remove those from the args.
If not, then you may find that a re-architecture is worthwhile. For example, RDS is often shared by multiple resources and therefore shouldn't be created within any one of them; this means you can pass a database ID into your component resource constructor, instead of all the properties required to create a DB.
👍 1