0
0
AWScloud~10 mins

Creating a DynamoDB table in AWS - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the primary key attribute name for the DynamoDB table.

AWS
{
  "TableName": "MyTable",
  "KeySchema": [
    {
      "AttributeName": "[1]",
      "KeyType": "HASH"
    }
  ],
  "AttributeDefinitions": [
    {
      "AttributeName": "Id",
      "AttributeType": "S"
    }
  ],
  "ProvisionedThroughput": {
    "ReadCapacityUnits": 5,
    "WriteCapacityUnits": 5
  }
}
Drag options to blanks, or click blank then click option'
AId
BName
CPrimary
DKey
Attempts:
3 left
💡 Hint
Common Mistakes
Using an attribute name not defined in AttributeDefinitions.
Confusing KeyType values.
2fill in blank
medium

Complete the code to specify the attribute type for the primary key in DynamoDB.

AWS
{
  "TableName": "MyTable",
  "KeySchema": [
    {
      "AttributeName": "Id",
      "KeyType": "HASH"
    }
  ],
  "AttributeDefinitions": [
    {
      "AttributeName": "Id",
      "AttributeType": "[1]"
    }
  ],
  "ProvisionedThroughput": {
    "ReadCapacityUnits": 5,
    "WriteCapacityUnits": 5
  }
}
Drag options to blanks, or click blank then click option'
AN
BM
CS
DB
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'N' when the attribute is a string.
Using 'M' which is not a valid AttributeType.
3fill in blank
hard

Fix the error in the ProvisionedThroughput configuration by completing the missing value.

AWS
{
  "TableName": "MyTable",
  "KeySchema": [
    {
      "AttributeName": "Id",
      "KeyType": "HASH"
    }
  ],
  "AttributeDefinitions": [
    {
      "AttributeName": "Id",
      "AttributeType": "S"
    }
  ],
  "ProvisionedThroughput": {
    "ReadCapacityUnits": [1],
    "WriteCapacityUnits": 5
  }
}
Drag options to blanks, or click blank then click option'
A10000
B0
C-1
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Setting capacity units to zero or negative values.
Using excessively large numbers without justification.
4fill in blank
hard

Fill both blanks to add a sort key attribute named 'Timestamp' of type number.

AWS
{
  "TableName": "MyTable",
  "KeySchema": [
    {
      "AttributeName": "Id",
      "KeyType": "HASH"
    },
    {
      "AttributeName": "[1]",
      "KeyType": "RANGE"
    }
  ],
  "AttributeDefinitions": [
    {
      "AttributeName": "Id",
      "AttributeType": "S"
    },
    {
      "AttributeName": "Timestamp",
      "AttributeType": "[2]"
    }
  ],
  "ProvisionedThroughput": {
    "ReadCapacityUnits": 5,
    "WriteCapacityUnits": 5
  }
}
Drag options to blanks, or click blank then click option'
ATimestamp
BS
CN
DB
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'S' for a numeric attribute.
Mismatching attribute names between KeySchema and AttributeDefinitions.
5fill in blank
hard

Fill all three blanks to create a global secondary index named 'GSI1' with a partition key 'Category' of type string and provisioned throughput of 10 read and 5 write units.

AWS
{
  "TableName": "MyTable",
  "AttributeDefinitions": [
    {
      "AttributeName": "Id",
      "AttributeType": "S"
    },
    {
      "AttributeName": "Category",
      "AttributeType": "S"
    }
  ],
  "KeySchema": [
    {
      "AttributeName": "Id",
      "KeyType": "HASH"
    }
  ],
  "GlobalSecondaryIndexes": [
    {
      "IndexName": "[1]",
      "KeySchema": [
        {
          "AttributeName": "[2]",
          "KeyType": "HASH"
        }
      ],
      "Projection": {
        "ProjectionType": "ALL"
      },
      "ProvisionedThroughput": {
        "ReadCapacityUnits": [3],
        "WriteCapacityUnits": 5
      }
    }
  ],
  "ProvisionedThroughput": {
    "ReadCapacityUnits": 5,
    "WriteCapacityUnits": 5
  }
}
Drag options to blanks, or click blank then click option'
AGSI1
BCategory
C10
DId
Attempts:
3 left
💡 Hint
Common Mistakes
Using the table's primary key attribute as the GSI partition key.
Setting incorrect provisioned throughput values.