Support arrays
tenjaa opened this issue · 1 comments
Hi :)
We have a few private resources which I want to generate L1 constructs for.
For some of them I get always the same error:
Unsupported type {"type":"array","items":{"type":"string"}} for read-only property (attribute) PRIVATE::PRIVATE::Shared.Subnets
The properties of the schema look like this:
"properties": {
"Id": {
"description": "unique identifier",
"type": "string"
},
"VpcId": {
"description": "id of the vpc",
"type": "string"
},
"Subnets": {
"type": "array",
"items": {
"type": "string"
}
}
},
Therefore for me it looks like arrays are not supported yet.
Is that assumption correct? Could it be implemented?
edit: Looking at
cdk-import/src/cfn-resource-generator.ts
Line 185 in 45d0fbb
edit2: Found it!
Adding && def.type !== 'array'
to
cdk-import/src/cfn-resource-generator.ts
Line 47 in 45d0fbb
It gets properly resolved via
this.attrSubnets = cdk.Token.asList(this.getAtt('Subnets'));
What do you think about fixing that? Did I miss something?
Hi @madeline-k I saw you merging my other pull request.
Could you have a quick look at this one too? A fix is already included :)