こんな感じで取得できる
data "aws_secretsmanager_secret_version" "db" { secret_id = "test" } locals { credentials = jsondecode(data.aws_secretsmanager_secret_version.db.secret_string) } resource "aws_db_instance" "example" { instance_class = "db.t3.micro" allocated_storage = 64 engine = "mysql" username = local.credentials["user"] password = local.credentials["pass"] }