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 Risposta
1
Risposta accettata

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
ESPERTO
con risposta 9 mesi fa
profile picture
ESPERTO
verificato 9 mesi fa
profile picture
ESPERTO
verificato 9 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande