hcl2cdktf
hcl2cdktf copied to clipboard
Attribute References should be Camel Cased
That's how it's generated:
const b = new S3Bucket(this, 'b', {
acl: "private",
bucket: "mybucket",
tags: {
Name: "My bucket"
}
});
//...
origin: [{
domainName: b.bucket_regional_domain_name!,
originId: s3_origin_id!,
s3OriginConfig: [{
originAccessIdentity: "origin-access-identity/cloudfront/ABCDEFG1234567"
}]
}],
That's how it should be:
const b = new S3Bucket(this, 'b', {
acl: "private",
bucket: "mybucket",
tags: {
Name: "My bucket"
}
});
//...
origin: [{
domainName: b.bucketRegionalDomainName!,
originId: s3_origin_id!,
s3OriginConfig: [{
originAccessIdentity: "origin-access-identity/cloudfront/ABCDEFG1234567"
}]
}],
Fixed in d7bb111ef796705ee5adc23b6e81cfe415159f21
domainName: "${aws_s3_bucket.b.bucket_regional_domain_name}",
// ...
const b = new S3Bucket(this, 'b', {
acl: "private",
bucket: "mybucket",
tags: {
Name: "My bucket"
}
});
Unfortunately, this doesn't work since the reference wont be a static b
but something like stackName_b_252335
.
Assume the above comment was more for #7. Updated logic to detect if an unseen reference is found and if so, will bump the resource to the back of a list.
Opinions?