I have two resources in TF that I linked.
service_account = \
ServiceAccount(tf_stack,
id='123',
description='',
name="service-account",
provider=cc_provider)
api_key = ApiKey(tf_stack,
id='api-keys',
environment_id="env-xxxxx",
cluster_id="lkc-123123",
user_id=service_account.id,
provider=cc_provider)
The ServiceAccount.id is a string, but ApiKey.user_id is int.
When running this I get a legit exception from cdktf for type mismatch when setting user_id on ApiKey object.
Is it possible to craft type conversion of those variables somehow?
In plain TF it's not a problem as I'd use atoi for this.
But my challenge to make it work with cdktf
I think this should work:
this would render the terraform file with
atoifunction and then it should work as it works with normal terraform.