AWS Parameter Store parameters instead of variables

Hello,

Is it possible for Terraform to use an aws_ssm_parameter data resource instead of specifying a variable’s value in a tfvars file? I have prepopulated the values in Parameter Store and trying to reference them gives only errors.

I would expect to supply only the AWS region and terraform to get retrieve the rest of the values from SSM.

Has anyone accomplished this?

Thanks,

1 Like

Where you able to accomplish this? I am in the same predicament.

you can store values in the parameter store and use them in terraform using data resource.

data "aws_ssm_parameter" "rds_password" {
  name = "/${var.project_name}/DB_PASSWORD"
}

resource "aws_db_instance" "rds" {
...
  password = data.aws_ssm_parameter.rds_password.value
...
}