AWS Network firewall endpoint is not generated properly

I’m currently using typescript for CDKTF, the below lines

 const firewall = new DataAwsNetworkfirewallFirewall(this, "test", {
      name: "firewall"
 });
firewall.firewallStatus.get(0).syncStates.get(0).attachment.get(0).endpointId;

seems to generate the following lines under cdk.tf.json

 "${tolist(data.aws_networkfirewall_firewall.test.firewall_status[0].sync_states)[0][\"attachment[0].endpoint_id\"]}"

in which ["attachment[0].endpoint_id"] is incorrect, the correct way to access should be

"${tolist(data.aws_networkfirewall_firewall.test.firewall_status[0].sync_states)[0].attachment[0].endpoint_id}"

Hi @waynechong1995 :wave:

This looks like a bug :bug:! Would you mind filing it in our repository over here?

I think that one might have to do with the underlying type of sync_states being a set, but the code you have should work :sweat_smile:

1 Like