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 Answer
1
Accepted Answer

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
EXPERT
answered 6 months ago
profile picture
EXPERT
reviewed 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions