I want to create the same CW alarm/metrics for a number of DynamoDB tables in cdk, my instinct was to try to use a for loop to append the name of the DDB table to the CW alarm, but doing so generates the following error: Cannot use tokens in construct ID
It makes sense, because the token has yet to be evaluated so its just a placeholder value. But then what would a good alternative be to sequentially naming the alarms?
My usecase isn't that complicated I could just repeat the same code X times and tweak the name each time, but that seems like an incorrect approach.
I'm using the bellow code for inspiration, but I can't see what values I can call on that wouldn't trigger this error.
https://aws.amazon.com/blogs/developer/aws-cdk-developer-preview/