Amazon web services 在CloudFormation::Init-files步骤中从加密的s3存储桶下载文件

Amazon web services 在CloudFormation::Init-files步骤中从加密的s3存储桶下载文件,amazon-web-services,amazon-s3,amazon-cloudformation,amazon-kms,Amazon Web Services,Amazon S3,Amazon Cloudformation,Amazon Kms,在CloudFormation::Init资源的文件步骤中,如何从kms服务器端加密的S3存储桶读取文件?如果S3存储桶不进行任何加密,下面的示例堆栈将工作。但是失败,错误如下所示 错误: 使用AWS KMS托管密钥指定服务器端加密的请求需要AWS签名版本4 精简模板: { "AWSTemplateFormatVersion" : "2010-09-09", "Resources" : { "ProcessingMachine1" : { "Type": "AWS

在CloudFormation::Init资源的文件步骤中,如何从kms服务器端加密的S3存储桶读取文件?如果S3存储桶不进行任何加密,下面的示例堆栈将工作。但是失败,错误如下所示

错误:

使用AWS KMS托管密钥指定服务器端加密的请求需要AWS签名版本4

精简模板:

{
  "AWSTemplateFormatVersion" : "2010-09-09",

  "Resources" : {
    "ProcessingMachine1" : {
      "Type": "AWS::EC2::Instance",
      "Metadata": {
        "AWS::CloudFormation::Authentication": {
          "S3AccessCreds": {
            "type" : "S3",
            "accessKeyId" : "some-key",
            "secretKey" : "some-secret",
            "buckets" : [ "bucket-name" ]
          }
        },
        "AWS::CloudFormation::Init": {
          "config": {
            "files": {
              "path-to-file": {
                "source": "https://bucket-name.s3.amazonaws.com/file-name"
              }
            }
          }
        }
      }
    }

  }
}

您是否尝试在“用户数据”部分下运行aws cli命令<代码>“UserData”:{“Fn::Base64”:{“Fn::Join”:[“\n”、[“#!/bin/bash-vxe”、aws s3 cp,然后是aws s3 decrypt。我还没有尝试过,您可以看到它是否有效,我能够在不使用CFT Init节的情况下复制未加密的文件。