Cloudformation Combine two attribute to make up partition key in dynamoDB

0

Hello please how do i make Cloudformation Combine two attribute to make up partition key in dynamoDB

Please can you share a sample code, Thanks

1 回答
1
已接受的回答

Hi,

Here is such an example:

AWSTemplateFormatVersion: "2010-09-09"
Resources: 
  usersTable: 
    Type: "AWS::DynamoDB::Table"
    Properties: 
      AttributeDefinitions: 
        - 
          AttributeName: "userId"
          AttributeType: "S"
        - 
          AttributeName: "noteId"
          AttributeType: "S"
      KeySchema: 
        - 
          AttributeName: "userId"
          KeyType: "HASH"
        - 
          AttributeName: "noteId"
          KeyType: "RANGE"
      ProvisionedThroughput: 
        ReadCapacityUnits: "5"
        WriteCapacityUnits: "5"
      TableName: "notes_serverless"

You can have a look at https://dynobase.dev/dynamodb-cloudformation/ to get more details about CFN & DDB.

Best,

Didier

profile pictureAWS
专家
已回答 9 个月前
profile picture
专家
已审核 9 个月前
profile picture
专家
已审核 9 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容