I have an SSM parameter created with type SecureString and key-value as (pasword=Passwor@d123). I am trying to fetch the value using data resources where the value is getting printed in plan output.
data "aws_ssm_parameter" "foo" {
name = "password"
}
module "lamda_env_vars" {
New_password = data.aws_ssm_parameter.foo.value
}
plan output:-
New_paswword = Password@123
I tried encryption like below.
data "aws_ssm_parameter" "foo" {
name = "password"
with_decryption = false
}
module "lambda_env_vars" {
New_password = data.aws_ssm_parameter.foo.value
}
plan output:-
New_password = Q#iuws##)9ssdhs(some encryptrd value)
Here the problem is the same encrypted hash code is getting assigned as the value for my lambda function.
How to mask value while terraforming plan and get the plain text value for my lambda function?