@@ -17,6 +17,7 @@ import (
17
17
"github.com/hashicorp/terraform-plugin-framework/types"
18
18
"github.com/hashicorp/terraform-plugin-log/tflog"
19
19
"github.com/yugabyte/terraform-provider-ybm/managed/fflags"
20
+ planmodifier "github.com/yugabyte/terraform-provider-ybm/managed/plan_modifier"
20
21
openapiclient "github.com/yugabyte/yugabytedb-managed-go-client-internal"
21
22
)
22
23
@@ -53,12 +54,18 @@ func (r resourceIntegrationType) getSchemaAttributes() map[string]tfsdk.Attribut
53
54
Description : "The name of the integration" ,
54
55
Type : types .StringType ,
55
56
Required : true ,
57
+ PlanModifiers : []tfsdk.AttributePlanModifier {
58
+ planmodifier.ImmutableFieldModifier {},
59
+ },
56
60
},
57
61
"type" : {
58
62
Description : "Defines different exporter destination types." ,
59
63
Type : types .StringType ,
60
64
Required : true ,
61
65
Validators : []tfsdk.AttributeValidator {stringvalidator .OneOf ("DATADOG" , "GRAFANA" , "SUMOLOGIC" , "GOOGLECLOUD" , "PROMETHEUS" , "VICTORIAMETRICS" )},
66
+ PlanModifiers : []tfsdk.AttributePlanModifier {
67
+ planmodifier.ImmutableFieldModifier {},
68
+ },
62
69
},
63
70
"is_valid" : {
64
71
Description : "Signifies whether the integration configuration is valid or not" ,
@@ -68,7 +75,10 @@ func (r resourceIntegrationType) getSchemaAttributes() map[string]tfsdk.Attribut
68
75
"datadog_spec" : {
69
76
Description : "The specifications of a Datadog integration." ,
70
77
Optional : true ,
71
- Validators : onlyContainsPath ("datadog_spec" ),
78
+ PlanModifiers : []tfsdk.AttributePlanModifier {
79
+ planmodifier.ImmutableFieldModifier {},
80
+ },
81
+ Validators : onlyContainsPath ("datadog_spec" ),
72
82
Attributes : tfsdk .SingleNestedAttributes (map [string ]tfsdk.Attribute {
73
83
"api_key" : {
74
84
Description : "Datadog Api Key" ,
@@ -80,13 +90,15 @@ func (r resourceIntegrationType) getSchemaAttributes() map[string]tfsdk.Attribut
80
90
Description : "Datadog site." ,
81
91
Type : types .StringType ,
82
92
Required : true ,
83
- },
84
- }),
93
+ }}),
85
94
},
86
95
"prometheus_spec" : {
87
96
Description : "The specifications of a Prometheus integration." ,
88
97
Optional : true ,
89
- Validators : onlyContainsPath ("prometheus_spec" ),
98
+ PlanModifiers : []tfsdk.AttributePlanModifier {
99
+ planmodifier.ImmutableFieldModifier {},
100
+ },
101
+ Validators : onlyContainsPath ("prometheus_spec" ),
90
102
Attributes : tfsdk .SingleNestedAttributes (map [string ]tfsdk.Attribute {
91
103
"endpoint" : {
92
104
Description : "Prometheus OTLP endpoint URL e.g. http://my-prometheus-endpoint/api/v1/otlp" ,
@@ -98,7 +110,10 @@ func (r resourceIntegrationType) getSchemaAttributes() map[string]tfsdk.Attribut
98
110
"victoriametrics_spec" : {
99
111
Description : "The specifications of a VictoriaMetrics integration." ,
100
112
Optional : true ,
101
- Validators : onlyContainsPath ("victoriametrics_spec" ),
113
+ PlanModifiers : []tfsdk.AttributePlanModifier {
114
+ planmodifier.ImmutableFieldModifier {},
115
+ },
116
+ Validators : onlyContainsPath ("victoriametrics_spec" ),
102
117
Attributes : tfsdk .SingleNestedAttributes (map [string ]tfsdk.Attribute {
103
118
"endpoint" : {
104
119
Description : "VictoriaMetrics OTLP endpoint URL e.g. http://my-victoria-metrics-endpoint/opentelemetry" ,
@@ -110,7 +125,10 @@ func (r resourceIntegrationType) getSchemaAttributes() map[string]tfsdk.Attribut
110
125
"grafana_spec" : {
111
126
Description : "The specifications of a Grafana integration." ,
112
127
Optional : true ,
113
- Validators : onlyContainsPath ("grafana_spec" ),
128
+ PlanModifiers : []tfsdk.AttributePlanModifier {
129
+ planmodifier.ImmutableFieldModifier {},
130
+ },
131
+ Validators : onlyContainsPath ("grafana_spec" ),
114
132
Attributes : tfsdk .SingleNestedAttributes (map [string ]tfsdk.Attribute {
115
133
"access_policy_token" : {
116
134
Description : "Grafana Access Policy Token" ,
@@ -138,7 +156,10 @@ func (r resourceIntegrationType) getSchemaAttributes() map[string]tfsdk.Attribut
138
156
"sumologic_spec" : {
139
157
Description : "The specifications of a Sumo Logic integration." ,
140
158
Optional : true ,
141
- Validators : onlyContainsPath ("sumologic_spec" ),
159
+ PlanModifiers : []tfsdk.AttributePlanModifier {
160
+ planmodifier.ImmutableFieldModifier {},
161
+ },
162
+ Validators : onlyContainsPath ("sumologic_spec" ),
142
163
Attributes : tfsdk .SingleNestedAttributes (map [string ]tfsdk.Attribute {
143
164
"access_id" : {
144
165
Description : "Sumo Logic Access Key ID" ,
@@ -151,8 +172,7 @@ func (r resourceIntegrationType) getSchemaAttributes() map[string]tfsdk.Attribut
151
172
Type : types .StringType ,
152
173
Required : true ,
153
174
Sensitive : true ,
154
- },
155
- "installation_token" : {
175
+ }, "installation_token" : {
156
176
Description : "A Sumo Logic installation token to export telemetry to Grafana with" ,
157
177
Type : types .StringType ,
158
178
Required : true ,
@@ -163,7 +183,10 @@ func (r resourceIntegrationType) getSchemaAttributes() map[string]tfsdk.Attribut
163
183
"googlecloud_spec" : {
164
184
Description : "The specifications of a Google Cloud integration." ,
165
185
Optional : true ,
166
- Validators : onlyContainsPath ("googlecloud_spec" ),
186
+ PlanModifiers : []tfsdk.AttributePlanModifier {
187
+ planmodifier.ImmutableFieldModifier {},
188
+ },
189
+ Validators : onlyContainsPath ("googlecloud_spec" ),
167
190
Attributes : tfsdk .SingleNestedAttributes (map [string ]tfsdk.Attribute {
168
191
"type" : {
169
192
Description : "Service Account Type" ,
0 commit comments