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 Risposta
1
Risposta accettata

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
ESPERTO
con risposta 6 mesi fa
profile picture
ESPERTO
verificato 6 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande