问题
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