I have configured a key value pair in the AWS SSM parameter store UI as my-ssm-key
= ssm-value
.
I have the following YAML template for CF built on Serverless:
service: redirect-test
provider:
name: aws
runtime: python3.8
environment:
ssm_value: '{{resolve:ssm:my-ssm-key:1}}'
ssm_value_is_correct: !If [SSM_KEY_IS_CORRECT, yes, no]
functions:
hello:
handler: handler.hello
resources:
Conditions:
SSM_KEY_IS_CORRECT:
!Equals
- '{{resolve:ssm:my-ssm-key:1}}'
- 'ssm-value'
On deploying the stack, environment variables are being set to ssm_value
= ssm-value
and ssm_value_is_correct
= no
.
Why is the conditional statement resolving to "no" instead of "yes"? What is the correct way to use SSM parameter store values in conditionals?