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

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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인