36 lines
No EOL
1.2 KiB
HCL
36 lines
No EOL
1.2 KiB
HCL
// Observability Instance
|
|
resource "stackit_observability_instance" "observability" {
|
|
project_id = var.stackit_project_id
|
|
name = var.instance_name
|
|
plan_name = var.service_plan
|
|
}
|
|
|
|
// Observability Credentials
|
|
resource "stackit_observability_credential" "observability_credentials" {
|
|
project_id = var.stackit_project_id
|
|
instance_id = stackit_observability_instance.observability.instance_id
|
|
}
|
|
|
|
// Configure Secret Manager Provider
|
|
provider "vault" {
|
|
address = "https://prod.sm.eu01.stackit.cloud"
|
|
skip_child_token = true
|
|
auth_login_userpass {
|
|
username = var.secret_manager_username
|
|
password = var.secret_manager_password
|
|
}
|
|
}
|
|
|
|
// Store Observability Credentials in Secret Manager
|
|
resource "vault_kv_secret_v2" "secret_manager_cred_save" {
|
|
mount = var.secret_manager_instance_id
|
|
name = "observability"
|
|
cas = 1
|
|
delete_all_versions = true
|
|
data_json = jsonencode(
|
|
{
|
|
username = stackit_observability_credential.observability_credentials.username,
|
|
password = stackit_observability_credential.observability_credentials.password
|
|
}
|
|
)
|
|
} |