stackitcloud / terraform-provider-stackit

The official Terraform provider for STACKIT
https://registry.terraform.io/providers/stackitcloud/stackit
Apache License 2.0
42 stars 14 forks source link

Document how to use vault provider with stackit secrets manager #270

Closed not22day closed 7 months ago

not22day commented 8 months ago

The following code worked for me 1) how to carry over user/pw from secretsmanager_user into provider 2) skip_child_token = true required to make it work 3) mount is the instance id

provider "vault" {
  address = "https://prod.sm.eu01.stackit.cloud"
  skip_child_token = true
  auth_login_userpass {
    username = stackit_secretsmanager_user.example.username
    password = stackit_secretsmanager_user.example.password

  }
}

resource "vault_kv_secret_v2" "example" {
  mount                      = stackit_secretsmanager_instance.example.instance_id
  name                       = "my-secret"
  cas                        = 1
  delete_all_versions        = true
  data_json                  = jsonencode(
  {
    zip       = "zap",
    foo       = "bar"
  }
  )
}
DiogoFerrao commented 7 months ago

Documentation for this case is available in the Terraform Registry