如何使用CloudFormation在DynamoDB上启用静态加密

时间:2018-05-22 10:21:16

标签: amazon-dynamodb amazon-cloudformation

我试图弄清楚是否可以使用CloudFormation创建DynamoDB表,但使用Restption at Rest。

我设法找到了以下开发指南,但它只是告诉您如何使用控制台和AWS CLI创建表:https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/encryption.tutorial.html

从查看SDK看来,您需要在DECLARE @t TABLE ( c1 CHAR(1), c2 CHAR(3)) INSERT INTO @t VALUES ('A', 'AAA') ,('B', 'BBB') ,('C', 'CCC') ,('D', 'DDD'); WITH Numbered AS ( SELECT * ,ROW_NUMBER() OVER(ORDER BY c1) AS RowIndex FROM @t ) SELECT MAX(CASE WHEN RowIndex=1 THEN c1 END) AS [Column1.1] ,MAX(CASE WHEN RowIndex=1 THEN c2 END) AS [Column2.1] ,MAX(CASE WHEN RowIndex=2 THEN c1 END) AS [Column1.2] ,MAX(CASE WHEN RowIndex=2 THEN c2 END) AS [Column2.2] ,MAX(CASE WHEN RowIndex=3 THEN c1 END) AS [Column1.3] ,MAX(CASE WHEN RowIndex=3 THEN c2 END) AS [Column2.3] ,MAX(CASE WHEN RowIndex=4 THEN c1 END) AS [Column1.4] ,MAX(CASE WHEN RowIndex=4 THEN c2 END) AS [Column2.4] FROM Numbered SSEEnabled上设置一个属性SSESpecification,但这可以放在cloudformation模板中吗?如果有的话?

AWS::DynamoDB::Table

1 个答案:

答案 0 :(得分:5)

在模板中创建表时,您应该能够添加它:

{
    "Type" : "AWS::DynamoDB::Table",
    "Properties" : {
      "AttributeDefinitions" : [ AttributeDefinition, ... ],
      "GlobalSecondaryIndexes" : [ GlobalSecondaryIndexes, ... ],
      "KeySchema" : [ KeySchema, ... ],
      "LocalSecondaryIndexes" : [ LocalSecondaryIndexes, ... ],
      "ProvisionedThroughput" : ProvisionedThroughput,
      "SSESpecification" : {
          "SSEEnabled": true
        },
      "StreamSpecification" : StreamSpecification,
      "TableName" : String,
      "Tags" : [ Resource Tag, ... ],
      "TimeToLiveSpecification" : TimeToLiveSpecification
    }
  }
}

来自文档的链接:https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html

可能是智能感知问题吗?