Add Observability plan details to `stackit_observability_instance` or add a new data source
Problem description
In my terraform module, I create an SKE Cluster and an Observability instance. After that, I deploy prometheus in the cluster and set up the remoteWrite.queueConfig according to my selected Observability plan. This is all done via automation. Currently, I have to maintain a variable that maps the Observability plan name to the plan details like Metric Samples (per minute), Logs (GB) and Traces (GB). In my case, Metric Samples per minute is the attribute I need to configure prometheus accordingly.
Wouldn't it be nicer, if these details were a read-only attribute on the stackit_observability_instance resource? Or part of a data source, e.g. stackit_observability_plan_details?
This way, I wouldn't have to maintain this mapping myself.
Proposed solution
# resource attribute variant
resource "stackit_observability_instance" "obs_ske" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "obs-ske"
plan_name = "Observability-Starter-EU01"
}
output "obs_metric_samples_per_minute" {
value = stackit_observability_instance.obs_ske.metric_samples_per_minute
}
# data source variant
resource "stackit_observability_instance" "obs_ske" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "obs-ske"
plan_name = "Observability-Starter-EU01"
}
data "stackit_observability_plan_details" "obs_ske" {
plan_name = stackit_observability_instance.obs_ske.plan_name
}
output "obs_metric_samples_per_minute" {
value = stackit_observability_plan_details.obs_ske.metric_samples_per_minute
}
Alternative solutions (optional)
Maintaining the above mentioned variable myself isn't much of an issue. I admit, this feature is a 'nice to have'.
Additional information
none
Hi @mardonner, thank you for reporting this issue. We will have a look at it.