-
Notifications
You must be signed in to change notification settings - Fork 484
Closed
Labels
Description
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
cdktf & Language Versions
0.3.0
Affected Resource(s)
import { DatabaseCluster } from "./.gen/providers/digitalocean";
(generated from "digitalocean/digitalocean@~> 2.8.0")
Debug Output
Expected Behavior
db.port should synthesize to Terraform reference instead of number:
"output": {
"database_host_port": {
"value": "${digitalocean_database_cluster.db.host}:${digitalocean_database_cluster.db.port}"
}
}
This workaround can achieve the above:
new TerraformOutput(this, 'database_host_port', { value: `${db.host}:${db.getStringAttribute('port')}` });
Actual Behavior
new TerraformOutput(this, 'database_host_port', { value: `${db.host}:${db.port}` });
synthesizes to
"output": {
"database_host_port": {
"value": "${digitalocean_database_cluster.db.host}:-1.8881545897087498e+289"
},
}
Steps to Reproduce
The above code originates from my CDK Day talk example.
Important Factoids
References
STollenaar