【问题标题】:AWS SSM Parameter Store with CloudFormation带有 CloudFormation 的 AWS SSM 参数存储
【发布时间】:2019-04-05 23:34:16
【问题描述】:

从 CFN 文档中,我可以看到我可以创建一个 AWS::SSM::Parameter。我还了解如何创建KMS Master Key

但是文档页面中SSM:Parameter 上的type 参数未列出secure string 类型。

有没有办法可以在 cloudformation 模板中执行以下操作:

1) create KMS Key
2) use KMS key to encrypt a param
3) pull that param in User-Data for an EC2 instance

我将使用 jenkins 密码参数中的参数值从 Jenkins 作业运行 CFN 模板。我还可以在模板的参数上设置"NoEcho": true,这样它就不会在 CloudFormation 控制台中回显。

【问题讨论】:

    标签: amazon-web-services jenkins amazon-ec2 aws-kms amazon-cloudformation


    【解决方案1】:

    已添加对此的支持,因此您不再需要使用自定义资源。您必须使用对安全参数的动态引用。

    https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html

    使用此功能,您可以在 Fn::Join CF 内部函数中将 {{resolve:ssm-secure:parameter-name:version}} 添加到您的用户数据中。

    自 2019 年 4 月起,安全字符串在 cloudformation 模板中不能用作参数类型,但文档指出 CloudFormation will support the Parameter Store ‘SecureString’ type in a later release.

    https://aws.amazon.com/blogs/mt/integrating-aws-cloudformation-with-aws-systems-manager-parameter-store/

    【讨论】:

      【解决方案2】:

      似乎有一种方法可以使用custom resource 来做到这一点。与 lambda 函数结合使用。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2019-02-19
        • 1970-01-01
        • 2020-05-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-03-30
        相关资源
        最近更新 更多