# How can I configure a Map type attribute to be projected as a NonKeyAttribute for a Global Secondary Index?

**URL:** <https://forum.serverless.com/t/how-can-i-configure-a-map-type-attribute-to-be-projected-as-a-nonkeyattribute-for-a-global-secondary-index/10612>\
**Category:** Serverless Framework\
**Tags:** aws, dynamodb\
**Created:** [February 19, 2020, 12:36am UTC](https://forum.serverless.com/t/how-can-i-configure-a-map-type-attribute-to-be-projected-as-a-nonkeyattribute-for-a-global-secondary-index/10612 "2020-02-19T00:36:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phebe.s](https://avatars.discourse-cdn.com/v4/letter/p/b487fb/32.png) [@phebe.s](https://forum.serverless.com/u/phebe.s)\
**Post date:** [February 19, 2020, 12:36am UTC](https://forum.serverless.com/t/how-can-i-configure-a-map-type-attribute-to-be-projected-as-a-nonkeyattribute-for-a-global-secondary-index/10612/1 "2020-02-19T00:36:40Z")

</div>

Basically need configure a DynamoDB table with a Global Secondary Index that projects a Map type attribute. Would this configuration work?

```
Resources:
DynamoDbTable:
  Type: 'AWS::DynamoDB::Table'
  DeletionPolicy: Retain
  Properties:
    AttributeDefinitions:
      - AttributeName: email_id
        AttributeType: S
      - AttributeName: user_id
        AttributeType: N
      - AttributeName: metrics
        AttributeType: M
    KeySchema:
      - AttributeName: email_id
        KeyType: HASH
    ProvisionedThroughput:
      ReadCapacityUnits: 50
      WriteCapacityUnits: 5
    TableName: ${self:custom.dynamoDBTable}
    GlobalSecondaryIndexes:
    - IndexName: user_id-index
      KeySchema:
      - AttributeName: user_id
        KeyType: HASH
      Projection:
        ProjectionType: INCLUDE
        NonKeyAttributes:
        - metrics
      ProvisionedThroughput:
        ReadCapacityUnits: 50
        WriteCapacityUnits: 5
```
