How to check if a parameter exists in Systems Manager from CloudFormation
up vote
0
down vote
favorite
Reading the AWS documentation here, I've found the following statement:
AWS::SSM::Parameter::Name
The name of a Systems Manager parameter key.
Use this parameter when you want to pass the parameter key. For example, you can use this type to validate that the parameter exists.
I wasn't able to make it work, every time I get: Parameter validation failed: parameter value ... for parameter name ... does not exist.
Shoud it be trying to resolve the parameter type AWS::SSM::Parameter::Name? Anyway, I kept searching and found another statement here:
The first one in the list is used to pass the name of the parameter key as-is. CloudFormation will not fetch the value stored against it. For example, you can use this type to validate that the parameter exists in Parameter Store.
I'm probably not understanding it correctly, so I would like to request an example on how to check if a parameter existis in Systems Manager from CloudFormation?
Use case:
My main region has all parameters stored on Systems Manager, but my second one (redundancy) has only a few. Consider as example not creating the Zone/RecorSet twice in each region. For that I use a condition, as shown bellow:
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
MainRegion:
Type: String
Default: 'us-east-1'
PrivateFullyQualifiedDomainName:
Type: 'AWS::SSM::Parameter::Name'
Default: '/company/route53/private'
Conditions:
CreateUniqueResources: !Equals [ !Ref 'AWS::Region', !Ref MainRegion ]
Resources:
Route53Stack:
Type: 'AWS::CloudFormation::Stack'
Condition: CreateUniqueResources
Properties:
TemplateURL: [some s3 bucket]
Parameters:
PrivateDomainName: !Ref PrivateFullyQualifiedDomainName
Outputs:
TestParameterName:
# Outputs: /company/route53/private
Value: !Ref PrivateFullyQualifiedDomainName
And the nested stack:
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
PrivateDomainName:
Type: 'AWS::SSM::Parameter::Value<String>'
Resources:
[sutff...]
Outputs:
TestParameterValue:
# Outputs WHEN it exists: supersecretdomain.company.com
Value: !Ref PrivateDomainName
amazon-web-services amazon-cloudformation amazon-systems-manager
add a comment |
up vote
0
down vote
favorite
Reading the AWS documentation here, I've found the following statement:
AWS::SSM::Parameter::Name
The name of a Systems Manager parameter key.
Use this parameter when you want to pass the parameter key. For example, you can use this type to validate that the parameter exists.
I wasn't able to make it work, every time I get: Parameter validation failed: parameter value ... for parameter name ... does not exist.
Shoud it be trying to resolve the parameter type AWS::SSM::Parameter::Name? Anyway, I kept searching and found another statement here:
The first one in the list is used to pass the name of the parameter key as-is. CloudFormation will not fetch the value stored against it. For example, you can use this type to validate that the parameter exists in Parameter Store.
I'm probably not understanding it correctly, so I would like to request an example on how to check if a parameter existis in Systems Manager from CloudFormation?
Use case:
My main region has all parameters stored on Systems Manager, but my second one (redundancy) has only a few. Consider as example not creating the Zone/RecorSet twice in each region. For that I use a condition, as shown bellow:
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
MainRegion:
Type: String
Default: 'us-east-1'
PrivateFullyQualifiedDomainName:
Type: 'AWS::SSM::Parameter::Name'
Default: '/company/route53/private'
Conditions:
CreateUniqueResources: !Equals [ !Ref 'AWS::Region', !Ref MainRegion ]
Resources:
Route53Stack:
Type: 'AWS::CloudFormation::Stack'
Condition: CreateUniqueResources
Properties:
TemplateURL: [some s3 bucket]
Parameters:
PrivateDomainName: !Ref PrivateFullyQualifiedDomainName
Outputs:
TestParameterName:
# Outputs: /company/route53/private
Value: !Ref PrivateFullyQualifiedDomainName
And the nested stack:
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
PrivateDomainName:
Type: 'AWS::SSM::Parameter::Value<String>'
Resources:
[sutff...]
Outputs:
TestParameterValue:
# Outputs WHEN it exists: supersecretdomain.company.com
Value: !Ref PrivateDomainName
amazon-web-services amazon-cloudformation amazon-systems-manager
1
Do you have a parameter in Parameter Store named /company/route53/private? All that's going on here, as far as I know, is that CloudFormation is offering you a mechanism to avoid specifying the parameter store key as a simple string because its value could not be verified. Also, presumably, it allows the CloudFormation console to enumerate the existing Parameter Store keys and offer them to you in a dropdown list when creating the stack.
– jarmod
Nov 11 at 22:12
No I don't. That's the point I was trying to understand. I thought that using this type (AWS::SSM::Parameter::Name), somehow I could check if it exists before using in my configuration. But after trying a few things I realize that it doesn't resolve the value on compile time, but it does resolve on execution time. And thank you very much for you comment, it made me realize a few use cases of this parameter type, improving the readbility of many places in my configuration.
– Bruno Novais
Nov 12 at 20:58
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Reading the AWS documentation here, I've found the following statement:
AWS::SSM::Parameter::Name
The name of a Systems Manager parameter key.
Use this parameter when you want to pass the parameter key. For example, you can use this type to validate that the parameter exists.
I wasn't able to make it work, every time I get: Parameter validation failed: parameter value ... for parameter name ... does not exist.
Shoud it be trying to resolve the parameter type AWS::SSM::Parameter::Name? Anyway, I kept searching and found another statement here:
The first one in the list is used to pass the name of the parameter key as-is. CloudFormation will not fetch the value stored against it. For example, you can use this type to validate that the parameter exists in Parameter Store.
I'm probably not understanding it correctly, so I would like to request an example on how to check if a parameter existis in Systems Manager from CloudFormation?
Use case:
My main region has all parameters stored on Systems Manager, but my second one (redundancy) has only a few. Consider as example not creating the Zone/RecorSet twice in each region. For that I use a condition, as shown bellow:
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
MainRegion:
Type: String
Default: 'us-east-1'
PrivateFullyQualifiedDomainName:
Type: 'AWS::SSM::Parameter::Name'
Default: '/company/route53/private'
Conditions:
CreateUniqueResources: !Equals [ !Ref 'AWS::Region', !Ref MainRegion ]
Resources:
Route53Stack:
Type: 'AWS::CloudFormation::Stack'
Condition: CreateUniqueResources
Properties:
TemplateURL: [some s3 bucket]
Parameters:
PrivateDomainName: !Ref PrivateFullyQualifiedDomainName
Outputs:
TestParameterName:
# Outputs: /company/route53/private
Value: !Ref PrivateFullyQualifiedDomainName
And the nested stack:
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
PrivateDomainName:
Type: 'AWS::SSM::Parameter::Value<String>'
Resources:
[sutff...]
Outputs:
TestParameterValue:
# Outputs WHEN it exists: supersecretdomain.company.com
Value: !Ref PrivateDomainName
amazon-web-services amazon-cloudformation amazon-systems-manager
Reading the AWS documentation here, I've found the following statement:
AWS::SSM::Parameter::Name
The name of a Systems Manager parameter key.
Use this parameter when you want to pass the parameter key. For example, you can use this type to validate that the parameter exists.
I wasn't able to make it work, every time I get: Parameter validation failed: parameter value ... for parameter name ... does not exist.
Shoud it be trying to resolve the parameter type AWS::SSM::Parameter::Name? Anyway, I kept searching and found another statement here:
The first one in the list is used to pass the name of the parameter key as-is. CloudFormation will not fetch the value stored against it. For example, you can use this type to validate that the parameter exists in Parameter Store.
I'm probably not understanding it correctly, so I would like to request an example on how to check if a parameter existis in Systems Manager from CloudFormation?
Use case:
My main region has all parameters stored on Systems Manager, but my second one (redundancy) has only a few. Consider as example not creating the Zone/RecorSet twice in each region. For that I use a condition, as shown bellow:
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
MainRegion:
Type: String
Default: 'us-east-1'
PrivateFullyQualifiedDomainName:
Type: 'AWS::SSM::Parameter::Name'
Default: '/company/route53/private'
Conditions:
CreateUniqueResources: !Equals [ !Ref 'AWS::Region', !Ref MainRegion ]
Resources:
Route53Stack:
Type: 'AWS::CloudFormation::Stack'
Condition: CreateUniqueResources
Properties:
TemplateURL: [some s3 bucket]
Parameters:
PrivateDomainName: !Ref PrivateFullyQualifiedDomainName
Outputs:
TestParameterName:
# Outputs: /company/route53/private
Value: !Ref PrivateFullyQualifiedDomainName
And the nested stack:
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
PrivateDomainName:
Type: 'AWS::SSM::Parameter::Value<String>'
Resources:
[sutff...]
Outputs:
TestParameterValue:
# Outputs WHEN it exists: supersecretdomain.company.com
Value: !Ref PrivateDomainName
amazon-web-services amazon-cloudformation amazon-systems-manager
amazon-web-services amazon-cloudformation amazon-systems-manager
asked Nov 11 at 21:45
Bruno Novais
416
416
1
Do you have a parameter in Parameter Store named /company/route53/private? All that's going on here, as far as I know, is that CloudFormation is offering you a mechanism to avoid specifying the parameter store key as a simple string because its value could not be verified. Also, presumably, it allows the CloudFormation console to enumerate the existing Parameter Store keys and offer them to you in a dropdown list when creating the stack.
– jarmod
Nov 11 at 22:12
No I don't. That's the point I was trying to understand. I thought that using this type (AWS::SSM::Parameter::Name), somehow I could check if it exists before using in my configuration. But after trying a few things I realize that it doesn't resolve the value on compile time, but it does resolve on execution time. And thank you very much for you comment, it made me realize a few use cases of this parameter type, improving the readbility of many places in my configuration.
– Bruno Novais
Nov 12 at 20:58
add a comment |
1
Do you have a parameter in Parameter Store named /company/route53/private? All that's going on here, as far as I know, is that CloudFormation is offering you a mechanism to avoid specifying the parameter store key as a simple string because its value could not be verified. Also, presumably, it allows the CloudFormation console to enumerate the existing Parameter Store keys and offer them to you in a dropdown list when creating the stack.
– jarmod
Nov 11 at 22:12
No I don't. That's the point I was trying to understand. I thought that using this type (AWS::SSM::Parameter::Name), somehow I could check if it exists before using in my configuration. But after trying a few things I realize that it doesn't resolve the value on compile time, but it does resolve on execution time. And thank you very much for you comment, it made me realize a few use cases of this parameter type, improving the readbility of many places in my configuration.
– Bruno Novais
Nov 12 at 20:58
1
1
Do you have a parameter in Parameter Store named /company/route53/private? All that's going on here, as far as I know, is that CloudFormation is offering you a mechanism to avoid specifying the parameter store key as a simple string because its value could not be verified. Also, presumably, it allows the CloudFormation console to enumerate the existing Parameter Store keys and offer them to you in a dropdown list when creating the stack.
– jarmod
Nov 11 at 22:12
Do you have a parameter in Parameter Store named /company/route53/private? All that's going on here, as far as I know, is that CloudFormation is offering you a mechanism to avoid specifying the parameter store key as a simple string because its value could not be verified. Also, presumably, it allows the CloudFormation console to enumerate the existing Parameter Store keys and offer them to you in a dropdown list when creating the stack.
– jarmod
Nov 11 at 22:12
No I don't. That's the point I was trying to understand. I thought that using this type (AWS::SSM::Parameter::Name), somehow I could check if it exists before using in my configuration. But after trying a few things I realize that it doesn't resolve the value on compile time, but it does resolve on execution time. And thank you very much for you comment, it made me realize a few use cases of this parameter type, improving the readbility of many places in my configuration.
– Bruno Novais
Nov 12 at 20:58
No I don't. That's the point I was trying to understand. I thought that using this type (AWS::SSM::Parameter::Name), somehow I could check if it exists before using in my configuration. But after trying a few things I realize that it doesn't resolve the value on compile time, but it does resolve on execution time. And thank you very much for you comment, it made me realize a few use cases of this parameter type, improving the readbility of many places in my configuration.
– Bruno Novais
Nov 12 at 20:58
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53253560%2fhow-to-check-if-a-parameter-exists-in-systems-manager-from-cloudformation%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Do you have a parameter in Parameter Store named /company/route53/private? All that's going on here, as far as I know, is that CloudFormation is offering you a mechanism to avoid specifying the parameter store key as a simple string because its value could not be verified. Also, presumably, it allows the CloudFormation console to enumerate the existing Parameter Store keys and offer them to you in a dropdown list when creating the stack.
– jarmod
Nov 11 at 22:12
No I don't. That's the point I was trying to understand. I thought that using this type (AWS::SSM::Parameter::Name), somehow I could check if it exists before using in my configuration. But after trying a few things I realize that it doesn't resolve the value on compile time, but it does resolve on execution time. And thank you very much for you comment, it made me realize a few use cases of this parameter type, improving the readbility of many places in my configuration.
– Bruno Novais
Nov 12 at 20:58