{# Secondary Indexes #}
{% if desc.GlobalSecondaryIndexes is defined and desc.GlobalSecondaryIndexes|length > 0 %}
Global Secondary Indexes
Index Name
Status
Partition Key
Sort Key
Projection
Item Count
{% for gsi in desc.GlobalSecondaryIndexes %}
{% set gsiPk = null %}{% set gsiSk = null %}
{% for k in gsi.KeySchema %}
{% if k.KeyType == 'HASH' %}{% set gsiPk = k.AttributeName %}{% endif %}
{% if k.KeyType == 'RANGE' %}{% set gsiSk = k.AttributeName %}{% endif %}
{% endfor %}
{{ gsi.IndexName }}
{{ gsi.IndexStatus ?? 'ACTIVE' }}
{{ gsiPk }}
{% if gsiSk %}{{ gsiSk }}{% else %}none{% endif %}
{{ gsi.Projection.ProjectionType ?? '—' }}
{{ (gsi.ItemCount ?? 0)|number_format }}
{% endfor %}
{% endif %}
{% if desc.LocalSecondaryIndexes is defined and desc.LocalSecondaryIndexes|length > 0 %}
Local Secondary Indexes
Index Name
Sort Key
Projection
{% for lsi in desc.LocalSecondaryIndexes %}
{% set lsiSk = null %}
{% for k in lsi.KeySchema %}{% if k.KeyType == 'RANGE' %}{% set lsiSk = k.AttributeName %}{% endif %}{% endfor %}