如何将AWS CloudFormation模板与简单系统管理和ElasticBeanstalk一起使用 [英] How to use AWS CloudFormation templates with Simple System Management and ElasticBeanstalk

查看:63
本文介绍了如何将AWS CloudFormation模板与简单系统管理和ElasticBeanstalk一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将AWS CloudFormation模板与SSM和ElasticBeanstalk一起使用,但是出现以下错误:

服务:AmazonCloudFormation,消息:名为"awseb-e-dg6tmg2rmj-stack"的堆栈中止了操作.当前状态:"UPDATE_ROLLBACK_IN_PROGRESS"原因:以下资源创建失败:[ssmParameter].

我基本上需要从SSM检索值并在Amazon Linux上用作环境变量.

我已经研究并阅读了AWS CloudFormation官方资料中的所有相关资料,但是在使用这些模板方面并不清楚.

这是我模板的代码:

 资源:ssmParameter:类型:"AWS :: SSM :: Parameter"特性:名称:"MySSMParameter"option_settings:'aws:elasticbeanstalk:application:environment':MY_ENV_VAR:{"Fn :: GetAtt":"ssmParameter"} 

此解决方案已经按照此 AWS博客文章将AWS CloudFormation与AWS Systems Manager参数存储集成"

尽管如此,现在显示另一个错误:

InvalidParameterValue:未知参数类型:AWS :: SSM :: Parameter :: Value

预先感谢

解决方案

错误消息中包含错误:未知参数类型

正确的格式为 AWS :: SSM :: Parameter :: Value< TYPE> ,其中 TYPE 是参数:D

例如,要提取字符串: AWS :: SSM :: Parameter :: Value< String>

I am trying to use AWS CloudFormation templates together with SSM and ElasticBeanstalk, but get the following error:

Service:AmazonCloudFormation, Message:Stack named 'awseb-e-dg6tmg2rmj-stack' aborted operation. Current state: 'UPDATE_ROLLBACK_IN_PROGRESS' Reason: The following resource(s) failed to create: [ssmParameter].

I basically need to retrieve values from SSM and use as environment variables on Amazon Linux.

I have already researched and read all the related material on AWS CloudFormation official material, but things are not clear on the use of these templates.

Here is my template's code:

Resources:
  ssmParameter:
    Type: "AWS::SSM::Parameter"
    Properties:
      Name: "MySSMParameter"

option_settings:
  'aws:elasticbeanstalk:application:environment':
     MY_ENV_VAR: {"Fn::GetAtt": "ssmParameter"}

This solution was already tested as explained in this AWS blog post titled 'Integrating AWS CloudFormation with AWS Systems Manager Parameter Store'

Nevertheless, now another error is shown:

InvalidParameterValue: Unknown Parameter Type: AWS::SSM::Parameter::Value

Thanks in advance

解决方案

The error is in the error message: Unknown Parameter Type

The correct form is AWS::SSM::Parameter::Value<TYPE> where TYPE is the, ahem, type of the parameter :D

For example, to extract a String: AWS::SSM::Parameter::Value<String>

这篇关于如何将AWS CloudFormation模板与简单系统管理和ElasticBeanstalk一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆