Dear Experts,
I successfully imported custom Terraform Modules in Terraform CDK. However, I can’t use the output to create for example an instance with a security group:
const moduleSg = new AwsSg(this, `AwsSg${vpcIndex}`, { namePrefix: config.user_id, resourceTag: `resourceTag${vpcIndex}`, vpcId: vpc.id })
new ec2.Instance(this, `compute${subnetIndex}${vpcIndex}`, {
subnetId: subnet.id,
ami: "ami-089950bc622d39ed8",
instanceType: "t2.micro",
keyName: "Key_MBP_fdervisi",
securityGroups: [moduleSg.serviceSecurityGroupIdOutput],
tags: {
Name: "instance1",
Owner: ""
}
});
I got this error:
Inappropriate value for attribute "security_groups": element 0: string required.
type or paste code here
The problem is that the security is not resolved and therefore it is not a string. Is this the limitation? If yes do we have any workarounds?