ParameterStore without value in CloudFormation

0

Hi,

I want to create a parameter in CloudFormation, but without value (like secrets manager resource). Then I want to reference it in my template like "${MyParameter}". The only possible solution is to create parameter via console that use this syntax and reference it:

MyParameter:
    Type: 'AWS::SSM::Parameter::Value<String>'
    Default: /MyApp/MyPassword

Is it possible to create a parameter in CloudFormation and reference it this way? I see that value is required property, so CloudFormation will always overwrite that value in console with this value in a template.

Secret manager offers this possibility, I am interested in parameter store.

Thx, M

profile picture
已提問 6 個月前檢視次數 303 次
1 個回答
1
已接受的答案

Hello.

You can create parameters using "Type: AWS::SSM::Parameter".
The return value "Fn::GetAtt Value" is the parameter value.
https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-ssm-parameter.html

So I think you can reference the parameters in the following way.

---
Resources:
  BasicParameter:
    Type: AWS::SSM::Parameter
    Properties:
      Name: command
      Type: String
      Value: date
      Description: SSM Parameter for running date command.
      AllowedPattern: "^[a-zA-Z]{1,10}$"
      Tags:
        Environment: DEV
  
Outputs:
  ssmparameter:
    Value: !GetAtt BasicParameter.Value
profile picture
專家
已回答 6 個月前
profile picture
專家
已審閱 6 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南