Skip to content

Commit f9f2829

Browse files
chore(deps): bump github.com/stackitcloud/stackit-sdk-go/services/observability from 0.15.1 to 0.16.1 (#1144)
* chore(deps): bump github.com/stackitcloud/stackit-sdk-go/services/observability Bumps [github.com/stackitcloud/stackit-sdk-go/services/observability](https://github.com/stackitcloud/stackit-sdk-go) from 0.15.1 to 0.16.1. - [Release notes](https://github.com/stackitcloud/stackit-sdk-go/releases) - [Changelog](https://github.com/stackitcloud/stackit-sdk-go/blob/main/CHANGELOG.md) - [Commits](stackitcloud/stackit-sdk-go@core/v0.15.1...services/mongodbflex/v0.16.1) --- updated-dependencies: - dependency-name: github.com/stackitcloud/stackit-sdk-go/services/observability dependency-version: 0.16.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix(logalertgroup): Adjust toRulesPayload() Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de> * chore(observability): Remove grafanaAdminUser and grafanaAdminPassword. Add grafanaAdminEnabled field. Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alexander Dahmen <alexander.dahmen@inovex.de>
1 parent 8ce962d commit f9f2829

11 files changed

Lines changed: 44 additions & 59 deletions

File tree

docs/data-sources/observability_instance.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ data "stackit_observability_instance" "example" {
3333
- `alert_config` (Attributes) Alert configuration for the instance. (see [below for nested schema](#nestedatt--alert_config))
3434
- `alerting_url` (String) Specifies Alerting URL.
3535
- `dashboard_url` (String) Specifies Observability instance dashboard URL.
36-
- `grafana_initial_admin_password` (String, Sensitive) Specifies an initial Grafana admin password.
37-
- `grafana_initial_admin_user` (String) Specifies an initial Grafana admin username.
36+
- `grafana_admin_enabled` (Boolean) If true, a default Grafana server admin user was created.
3837
- `grafana_public_read_access` (Boolean) If true, anyone can access Grafana dashboards without logging in.
3938
- `grafana_url` (String) Specifies Grafana URL.
4039
- `id` (String) Terraform's internal data source. ID. It is structured as "`project_id`,`instance_id`".

docs/resources/observability_instance.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import {
4545

4646
- `acl` (Set of String) The access control list for this instance. Each entry is an IP address range that is permitted to access, in CIDR notation.
4747
- `alert_config` (Attributes) Alert configuration for the instance. (see [below for nested schema](#nestedatt--alert_config))
48+
- `grafana_admin_enabled` (Boolean) If true, a default Grafana server admin user is created. It's recommended to set this to false and use STACKIT SSO (Owner or Observability Grafana Server Admin role) instead. It is still possible to manually create a new Grafana admin user via the Grafana UI later.
4849
- `logs_retention_days` (Number) Specifies for how many days the logs are kept. Default is set to `7`.
4950
- `metrics_retention_days` (Number) Specifies for how many days the raw metrics are kept. Default is set to `90`.
5051
- `metrics_retention_days_1h_downsampling` (Number) Specifies for how many days the 1h downsampled metrics are kept. must be less than the value of the 5m downsampling retention. Default is set to `90`.
@@ -56,8 +57,6 @@ import {
5657

5758
- `alerting_url` (String) Specifies Alerting URL.
5859
- `dashboard_url` (String) Specifies Observability instance dashboard URL.
59-
- `grafana_initial_admin_password` (String, Sensitive) Specifies an initial Grafana admin password.
60-
- `grafana_initial_admin_user` (String) Specifies an initial Grafana admin username.
6160
- `grafana_public_read_access` (Boolean) If true, anyone can access Grafana dashboards without logging in.
6261
- `grafana_url` (String) Specifies Grafana URL.
6362
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`instance_id`".

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ require (
2525
github.com/stackitcloud/stackit-sdk-go/services/modelserving v0.6.3
2626
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.5.5
2727
github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.4.2
28-
github.com/stackitcloud/stackit-sdk-go/services/observability v0.15.1
28+
github.com/stackitcloud/stackit-sdk-go/services/observability v0.16.1
2929
github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.24.4
3030
github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.3.2
3131
github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.25.3

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.5.5 h1:tPISli81nu
179179
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.5.5/go.mod h1:G/UD3tzPzzu79MiFWUYqogxdLMB+YArNHR6Yqz7Cqr0=
180180
github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.4.2 h1:nsC6oA1whA4ibxEuD+0Osngmnpz8dLdV6bv+9jYP4Eo=
181181
github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.4.2/go.mod h1:WA6QlAAQ8aaw81W0VSVoDrxOfchGkdtmn2jQL/ub/50=
182-
github.com/stackitcloud/stackit-sdk-go/services/observability v0.15.1 h1:zk+47GhutK2ajO4Yiek0laGm2PdXvY8BvFZc8yHFnSE=
183-
github.com/stackitcloud/stackit-sdk-go/services/observability v0.15.1/go.mod h1:vapb/sJqbHlf+c7pZWdE9GqrbyI8wesGvUc9o7oJ1Xk=
182+
github.com/stackitcloud/stackit-sdk-go/services/observability v0.16.1 h1:FKeW3uiMXRl6Oau3xE6yBriXh4t7CwPb8QH6PR0uQXM=
183+
github.com/stackitcloud/stackit-sdk-go/services/observability v0.16.1/go.mod h1:RiknJnL3OuU9wb2lyb80Hu+EnlyDQMG8vejDV7B9a5U=
184184
github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.24.4 h1:ppmezCAc8XBW6sdS5lvV6Edx0FOPwC/fosvH3FEIdps=
185185
github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.24.4/go.mod h1:c509eL4M/Qdg4FGT6qTh7r4E07FtB2Ui3sbbLERUBqk=
186186
github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.3.2 h1:uQIpj0phDRGrV78/vhtULwxaO2cBdHwqZcFKYUrH1Hs=

stackit/internal/services/observability/instance/datasource.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,10 @@ func (d *instanceDataSource) Schema(_ context.Context, _ datasource.SchemaReques
123123
Description: "Specifies Grafana URL.",
124124
Computed: true,
125125
},
126-
"grafana_initial_admin_user": schema.StringAttribute{
127-
Description: "Specifies an initial Grafana admin username.",
126+
"grafana_admin_enabled": schema.BoolAttribute{
127+
Description: "If true, a default Grafana server admin user was created.",
128128
Computed: true,
129129
},
130-
"grafana_initial_admin_password": schema.StringAttribute{
131-
Description: "Specifies an initial Grafana admin password.",
132-
Computed: true,
133-
Sensitive: true,
134-
},
135130
"traces_retention_days": schema.Int64Attribute{
136131
Description: "Specifies for how many days the traces are kept. Default is set to `7`.",
137132
Computed: true,

stackit/internal/services/observability/instance/resource.go

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ type Model struct {
6363
IsUpdatable types.Bool `tfsdk:"is_updatable"`
6464
GrafanaURL types.String `tfsdk:"grafana_url"`
6565
GrafanaPublicReadAccess types.Bool `tfsdk:"grafana_public_read_access"`
66-
GrafanaInitialAdminPassword types.String `tfsdk:"grafana_initial_admin_password"`
67-
GrafanaInitialAdminUser types.String `tfsdk:"grafana_initial_admin_user"`
66+
GrafanaAdminEnabled types.Bool `tfsdk:"grafana_admin_enabled"`
6867
MetricsRetentionDays types.Int64 `tfsdk:"metrics_retention_days"`
6968
MetricsRetentionDays5mDownsampling types.Int64 `tfsdk:"metrics_retention_days_5m_downsampling"`
7069
MetricsRetentionDays1hDownsampling types.Int64 `tfsdk:"metrics_retention_days_1h_downsampling"`
@@ -500,20 +499,11 @@ func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, r
500499
stringplanmodifier.UseStateForUnknown(),
501500
},
502501
},
503-
"grafana_initial_admin_user": schema.StringAttribute{
504-
Description: "Specifies an initial Grafana admin username.",
505-
Computed: true,
506-
PlanModifiers: []planmodifier.String{
507-
stringplanmodifier.UseStateForUnknown(),
508-
},
509-
},
510-
"grafana_initial_admin_password": schema.StringAttribute{
511-
Description: "Specifies an initial Grafana admin password.",
502+
"grafana_admin_enabled": schema.BoolAttribute{
503+
Description: "If true, a default Grafana server admin user is created. It's recommended to set this to false and use STACKIT SSO (Owner or Observability Grafana Server Admin role) instead. It is still possible to manually create a new Grafana admin user via the Grafana UI later.",
504+
Optional: true,
512505
Computed: true,
513-
Sensitive: true,
514-
PlanModifiers: []planmodifier.String{
515-
stringplanmodifier.UseStateForUnknown(),
516-
},
506+
Default: booldefault.StaticBool(true),
517507
},
518508
"traces_retention_days": schema.Int64Attribute{
519509
Description: "Specifies for how many days the traces are kept. Default is set to `7`.",
@@ -1558,8 +1548,6 @@ func mapFields(ctx context.Context, r *observability.GetInstanceResponse, model
15581548
i := *r.Instance
15591549
model.GrafanaURL = types.StringPointerValue(i.GrafanaUrl)
15601550
model.GrafanaPublicReadAccess = types.BoolPointerValue(i.GrafanaPublicReadAccess)
1561-
model.GrafanaInitialAdminPassword = types.StringPointerValue(i.GrafanaAdminPassword)
1562-
model.GrafanaInitialAdminUser = types.StringPointerValue(i.GrafanaAdminUser)
15631551
model.MetricsURL = types.StringPointerValue(i.MetricsUrl)
15641552
model.MetricsPushURL = types.StringPointerValue(i.PushMetricsUrl)
15651553
model.TargetsURL = types.StringPointerValue(i.TargetsUrl)
@@ -1570,6 +1558,7 @@ func mapFields(ctx context.Context, r *observability.GetInstanceResponse, model
15701558
model.JaegerUIURL = types.StringPointerValue(i.JaegerUiUrl)
15711559
model.OtlpTracesURL = types.StringPointerValue(i.OtlpTracesUrl)
15721560
model.ZipkinSpansURL = types.StringPointerValue(i.ZipkinSpansUrl)
1561+
model.GrafanaAdminEnabled = types.BoolPointerValue(i.GrafanaAdminEnabled)
15731562
}
15741563

15751564
return nil
@@ -2128,9 +2117,10 @@ func toCreatePayload(model *Model) (*observability.CreateInstancePayload, error)
21282117
pa[k] = elements[k].String()
21292118
}
21302119
return &observability.CreateInstancePayload{
2131-
Name: conversion.StringValueToPointer(model.Name),
2132-
PlanId: conversion.StringValueToPointer(model.PlanId),
2133-
Parameter: &pa,
2120+
GrafanaAdminEnabled: conversion.BoolValueToPointer(model.GrafanaAdminEnabled),
2121+
Name: conversion.StringValueToPointer(model.Name),
2122+
PlanId: conversion.StringValueToPointer(model.PlanId),
2123+
Parameter: &pa,
21342124
}, nil
21352125
}
21362126

stackit/internal/services/observability/log-alertgroup/resource.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,9 @@ func toCreatePayload(ctx context.Context, model *Model) (*observability.CreateLo
412412
}
413413

414414
// toRulesPayload generates rules for create payload.
415-
func toRulesPayload(ctx context.Context, model *Model) ([]observability.UpdateAlertgroupsRequestInnerRulesInner, error) {
415+
func toRulesPayload(ctx context.Context, model *Model) ([]observability.CreateLogsAlertgroupsPayloadRulesInner, error) {
416416
if model.Rules.Elements() == nil || len(model.Rules.Elements()) == 0 {
417-
return []observability.UpdateAlertgroupsRequestInnerRulesInner{}, nil
417+
return []observability.CreateLogsAlertgroupsPayloadRulesInner{}, nil
418418
}
419419

420420
var rules []rule
@@ -423,10 +423,10 @@ func toRulesPayload(ctx context.Context, model *Model) ([]observability.UpdateAl
423423
return nil, core.DiagsToError(diags)
424424
}
425425

426-
var oarrs []observability.UpdateAlertgroupsRequestInnerRulesInner
426+
var oarrs []observability.CreateLogsAlertgroupsPayloadRulesInner
427427
for i := range rules {
428428
rule := &rules[i]
429-
oarr := observability.UpdateAlertgroupsRequestInnerRulesInner{}
429+
oarr := observability.CreateLogsAlertgroupsPayloadRulesInner{}
430430

431431
if !utils.IsUndefined(rule.Alert) {
432432
alert := conversion.StringValueToPointer(rule.Alert)

stackit/internal/services/observability/log-alertgroup/resource_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func TestToCreatePayload(t *testing.T) {
8080
expect: &observability.CreateLogsAlertgroupsPayload{
8181
Name: utils.Ptr("full-alertgroup"),
8282
Interval: utils.Ptr("10m"),
83-
Rules: &[]observability.UpdateAlertgroupsRequestInnerRulesInner{
83+
Rules: &[]observability.CreateLogsAlertgroupsPayloadRulesInner{
8484
{
8585
Alert: utils.Ptr("alert"),
8686
Annotations: &map[string]interface{}{
@@ -118,15 +118,15 @@ func TestToRulesPayload(t *testing.T) {
118118
tests := []struct {
119119
name string
120120
input *Model
121-
expect []observability.UpdateAlertgroupsRequestInnerRulesInner
121+
expect []observability.CreateLogsAlertgroupsPayloadRulesInner
122122
expectErr bool
123123
}{
124124
{
125125
name: "Nil Rules",
126126
input: &Model{
127127
Rules: types.ListNull(types.StringType), // Simulates a lack of rules
128128
},
129-
expect: []observability.UpdateAlertgroupsRequestInnerRulesInner{},
129+
expect: []observability.CreateLogsAlertgroupsPayloadRulesInner{},
130130
expectErr: false,
131131
},
132132
{
@@ -156,7 +156,7 @@ func TestToRulesPayload(t *testing.T) {
156156
}),
157157
}),
158158
},
159-
expect: []observability.UpdateAlertgroupsRequestInnerRulesInner{
159+
expect: []observability.CreateLogsAlertgroupsPayloadRulesInner{
160160
{
161161
Alert: utils.Ptr("alert"),
162162
Expr: utils.Ptr("expr"),
@@ -195,7 +195,7 @@ func TestToRulesPayload(t *testing.T) {
195195
}),
196196
}),
197197
},
198-
expect: []observability.UpdateAlertgroupsRequestInnerRulesInner{
198+
expect: []observability.CreateLogsAlertgroupsPayloadRulesInner{
199199
{
200200
Alert: utils.Ptr("alert1"),
201201
Expr: utils.Ptr("expr1"),

0 commit comments

Comments
 (0)