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 Antwort
1
Akzeptierte Antwort

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
EXPERTE
beantwortet vor 6 Monaten
profile picture
EXPERTE
überprüft vor 6 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen