aws-cloudformation / cloudformation-pkl

Apache License 2.0
11 stars 2 forks source link

Change `dbsubnetgroup.DBSubnetGroup` from `Listing<String|Mapping>` to `Listing<String|Mapping>|Mapping` #10

Open henriqueleite42 opened 3 months ago

henriqueleite42 commented 3 months ago

Currently, it doesn't support this kind of use:

Resources {
    ["SubnetGroup"] = new dbsubnetgroup.DBSubnetGroup {
        // ...
        SubnetIds = cfn.Ref("SubnetsIds")
        // ...
    }
}

It forces you to receive multiple subnet parameters to be passed directly in a listing, like this:

Resources {
    ["SubnetGroup"] = new dbsubnetgroup.DBSubnetGroup {
        // ...
        SubnetIds = new Listing {
            cfn.Ref("SubnetId1")
            cfn.Ref("SubnetId2")
            cfn.Ref("SubnetId3")
        }
        // ...
    }
}

The idea is to fix it and allow using refs directly

ericzbeard commented 2 months ago

Seems like we need to do this for all array types.