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

Nafiu
已提問 9 個月前檢視次數 273 次
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 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南