title: AWS-CDK get secondary indexes and metrics for those
body: <p>I have a cdk stack with a DDB table created with some alarms over it. Now have successfully add a secondary index to it.</p>
  <p>However, how can I programmatically list the secondary indexes that a table has and how can I get the metrics for it.</p>
  <p>Background, we have a module which creates the alarms for our DDB tables. That module receives the cdk table object and creates some alarms over it using methods like <code>metricConsumedWriteCapacityUnits</code>.</p>
  <p>I want to extend that alarm creator module to also create alarms for the indexes of the table, for such I need to read the secondary indexes (more concretely a global one) to check if the table has any; and if it does then create the alarms. Those alarms should be over capacity consumption and throttled requests (but might be extended to other metrics).</p>
  <ol>
  <li>Given a table cdk object, how can I list the secondary indexes it has?</li>
  <li>Having retrieved the secondary indexes, how can I now if they are local or global?</li>
  <li>Having retrieved a global secondary index, how can I get the metrics associated with it; capacity usage and throttled requests?</li>
  </ol>