How to Pass the version for SSM Parameter while creating on CloudFormation

0

I am getting the below error while creating the SSM Parameter via CF passign version.

Property validation failure: [Encountered unsupported properties in {/}: [Version]] My Securitygroup.Yaml

AWSTemplateFormatVersion: 2010-09-09 Description: Basic SSH Security Group.

Resources: MySSHSecurityGroup: Type: AWS::EC2::SecurityGroup Properties: GroupDescription: my new SSH SG SecurityGroupIngress: - IpProtocol: tcp FromPort: '22' ToPort: '22' CidrIp: 0.0.0.0/0

MYSSHSecuritygroupParameter: Type: AWS::SSM::Parameter Properties: Name: Security Type: String Value: !Ref MySSHSecurityGroup Tier: Standard Version: 1 Description: My SSH Securitygroup on SSM Parameter

Please help on this how to pass with Version number in CF, i need to create difference type of versions needs to create on the Same Parameter using CF.

已提問 2 年前檢視次數 526 次
2 個答案
1

You can't specify the version of Parameter when you create it, which is a result of the underlying API also not allowing that. Parameters will have a new version created automatically when they are updated.

I'd suggest instead creating multiple Parameters for your different requirements, which will also allow you better visibility and tracking of changes in the future. You can use / characters in your Parameter names to create a hierarchy to help with organisation (and access control).

profile pictureAWS
專家
James_S
已回答 2 年前
0

You could pass the Parameter Store parameter key in as a string and the version as a string. Then use a dynamic reference to that parameter. See: SSM parameters

profile pictureAWS
專家
kentrad
已回答 2 年前
  • I have tried its not working below is my Yaml script for only SSM Parameter. Property validation failure: [Encountered unsupported properties in {/}: [Version]] MYSSHSecuritygroupParameter: Type: AWS::SSM::Parameter Properties: Name: Security Type: String Value: !Ref MySSHSecurityGroup Tier: Standard Policies: '[{"Type":"String","Version":"1.0"}]' #Version: 1.0 Description: My SSH Securitygroup on SSM Parameter

  • Version is not supported. How are you using this parameter?

  • You have said like "Parameter Store parameter key in as a string and the version as a string" i passed it throws error.

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

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

回答問題指南