首页 > 解决方案 > 如何通过 cloudformation 创建/添加加密/密钥到发电机表?

问题描述

请参阅下面的示例 dynamodb 表和 cloudformation 模板。当我创建下表时,encrpytion aws 会采取什么措施来保护我的数据,如果可以的话?如果不是,我如何在下面的模板中指定我想用 aws 本身提供的密钥加密我的数据,如果可能的话。如果不是我假设,我还需要为此添加一个关键资源。

AWSTemplateFormatVersion: "2010-09-09"
Resources: 
  myDynamoDBTable: 
    Type: AWS::DynamoDB::Table
    Properties: 
      AttributeDefinitions: 
        - 
          AttributeName: "product"
          AttributeType: "S"
        - 
          AttributeName: "model"
          AttributeType: "S"
      KeySchema: 
        - 
          AttributeName: "product"
          KeyType: "HASH"
        - 
          AttributeName: "Model"
          KeyType: "RANGE"
      ProvisionedThroughput: 
        ReadCapacityUnits: "5"
        WriteCapacityUnits: "5"
      TableName: "InfoTable"

标签: amazon-dynamodbamazon-cloudformationamazon-kms

解决方案


如此处所述,将一个添加SSESpecification到您的表中。所以:

AWSTemplateFormatVersion: "2010-09-09"
Resources: 
  myDynamoDBTable: 
    Type: AWS::DynamoDB::Table
    Properties: 
      AttributeDefinitions: 
        - 
          AttributeName: "product"
          AttributeType: "S"
        - 
          AttributeName: "model"
          AttributeType: "S"
      KeySchema: 
        - 
          AttributeName: "product"
          KeyType: "HASH"
        - 
          AttributeName: "Model"
          KeyType: "RANGE"
      ProvisionedThroughput: 
        ReadCapacityUnits: "5"
        WriteCapacityUnits: "5"
      TableName: "InfoTable"
      SSESpecification:
        SSEEnabled: 'true'

这将使用 AWS 托管的加密密钥对表进行加密。


推荐阅读