I figure it out! using this password = jsondecode(data.aws_secretsmanager_secret_version.db_password_version.secret_string)["password"]instead of password = data.aws_secretsmanager_secret_version.db_password_version.secret_string
password = jsondecode(data.aws_secretsmanager_secret_version.db_password_version.secret_string)["password"]
password = data.aws_secretsmanager_secret_version.db_password_version.secret_string