I am trying to use %
to test out a scenario where I need to parse the value to integer and get the remainder.
this._zones.names
is a DataAWSAvailabilityZones All, so contains a list of three elements (zones)`
My code.
tags: {
Zone: Fn.element(this._zones.names, (Fn.parseInt("4", 10) % 3)),
If I am correct, the above correct should return the index at 1 and spit out us-east-2b but it always resolves to zero.
When I run synth however, it completely ignores the %
modulo operator, and outputs the following in my cdktf.json
file for that stack.
"Zone": "${element(data.aws_availability_zones.all.names, 0)}"
I can use escape hatch but thought I could use operators?