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 Resposta
1
Resposta aceita

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
ESPECIALISTA
respondido há 9 meses
profile picture
ESPECIALISTA
avaliado há 9 meses
profile picture
ESPECIALISTA
avaliado há 9 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas