How to use AWS CloudFormation templates with Simple System Management and ElasticBeanstalk

﹥>﹥吖頭↗ 提交于 2021-01-28 07:29:33

问题


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


回答1:


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>



来源:https://stackoverflow.com/questions/51540795/how-to-use-aws-cloudformation-templates-with-simple-system-management-and-elasti

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!