LoginSignup
0

More than 3 years have passed since last update.

CloudFormationでDynamoedbを作成するYAML

Last updated at Posted at 2019-09-30

はじめに

簡単なテンプレートなので、世間に出回っているとは思いますが自分のメモのために書きます。

テンプレートのYAMLファイル

パーティションキーとソートキーがあるテーブル、

AWSTemplateFormatVersion: 2010-09-09
Resources:
  famzonRequestDataDb:
    Type: AWS::DynamoDB::Table
    Properties:
      TableName: 【テーブル名】
      AttributeDefinitions:
        -
          AttributeName: 【パーティションキー名】
          AttributeType: 【データ型】
        -
          AttributeName: 【ソートキー名】
          AttributeType: 【データ型】
      KeySchema:
        -
          AttributeName: 【パーティションキー名】
          KeyType: HASH
        -
          AttributeName: 【ソートキー名】
          KeyType: RANGE
      ProvisionedThroughput:
        ReadCapacityUnits: 【読み込みキャパシティーユニット数】
        WriteCapacityUnits: 【書き込みキャパシティーユニット数】

パーティションキーとソートキーは、任意に決めたもの。
データ型は、下記のように設定する。
S:String
N:数値
B:バイナリ
※このブログを書くまでBの存在知らなかったです。

書き込み/読み込みキャパシティーユニット数は、整数で設定する。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0