@@ -10,7 +10,7 @@ import (
10
10
"github.com/hashicorp/terraform-plugin-framework/types"
11
11
)
12
12
13
- type DeploymentResource struct {
13
+ type Deployment struct {
14
14
// Common fields
15
15
Id types.String `tfsdk:"id"`
16
16
Name types.String `tfsdk:"name"`
@@ -68,7 +68,7 @@ type DeploymentResource struct {
68
68
IsHighAvailability types.Bool `tfsdk:"is_high_availability"`
69
69
}
70
70
71
- func (data * DeploymentResource ) ReadFromResponse (
71
+ func (data * Deployment ) ReadFromResponse (
72
72
ctx context.Context ,
73
73
deployment * platform.Deployment ,
74
74
) diag.Diagnostics {
@@ -166,58 +166,6 @@ func (data *DeploymentResource) ReadFromResponse(
166
166
return nil
167
167
}
168
168
169
- // DeploymentDataSource describes the data source data model.
170
- type DeploymentDataSource struct {
171
- Id types.String `tfsdk:"id"`
172
- Name types.String `tfsdk:"name"`
173
- Description types.String `tfsdk:"description"`
174
- CreatedAt types.String `tfsdk:"created_at"`
175
- UpdatedAt types.String `tfsdk:"updated_at"`
176
- CreatedBy types.Object `tfsdk:"created_by"`
177
- UpdatedBy types.Object `tfsdk:"updated_by"`
178
- WorkspaceId types.String `tfsdk:"workspace_id"`
179
- ClusterId types.String `tfsdk:"cluster_id"`
180
- Region types.String `tfsdk:"region"`
181
- CloudProvider types.String `tfsdk:"cloud_provider"`
182
- AstroRuntimeVersion types.String `tfsdk:"astro_runtime_version"`
183
- AirflowVersion types.String `tfsdk:"airflow_version"`
184
- Namespace types.String `tfsdk:"namespace"`
185
- ContactEmails types.List `tfsdk:"contact_emails"`
186
- Executor types.String `tfsdk:"executor"`
187
- SchedulerAu types.Int64 `tfsdk:"scheduler_au"`
188
- SchedulerCpu types.String `tfsdk:"scheduler_cpu"`
189
- SchedulerMemory types.String `tfsdk:"scheduler_memory"`
190
- SchedulerReplicas types.Int64 `tfsdk:"scheduler_replicas"`
191
- ImageTag types.String `tfsdk:"image_tag"`
192
- ImageRepository types.String `tfsdk:"image_repository"`
193
- ImageVersion types.String `tfsdk:"image_version"`
194
- EnvironmentVariables types.List `tfsdk:"environment_variables"`
195
- WebserverIngressHostname types.String `tfsdk:"webserver_ingress_hostname"`
196
- WebserverUrl types.String `tfsdk:"webserver_url"`
197
- WebserverAirflowApiUrl types.String `tfsdk:"webserver_airflow_api_url"`
198
- Status types.String `tfsdk:"status"`
199
- StatusReason types.String `tfsdk:"status_reason"`
200
- DagTarballVersion types.String `tfsdk:"dag_tarball_version"`
201
- DesiredDagTarballVersion types.String `tfsdk:"desired_dag_tarball_version"`
202
- WorkerQueues types.List `tfsdk:"worker_queues"`
203
- TaskPodNodePoolId types.String `tfsdk:"task_pod_node_pool_id"`
204
- IsCicdEnforced types.Bool `tfsdk:"is_cicd_enforced"`
205
- Type types.String `tfsdk:"type"`
206
- IsDagDeployEnabled types.Bool `tfsdk:"is_dag_deploy_enabled"`
207
- SchedulerSize types.String `tfsdk:"scheduler_size"`
208
- IsHighAvailability types.Bool `tfsdk:"is_high_availability"`
209
- IsDevelopmentMode types.Bool `tfsdk:"is_development_mode"`
210
- WorkloadIdentity types.String `tfsdk:"workload_identity"`
211
- ExternalIps types.List `tfsdk:"external_ips"`
212
- OidcIssuerUrl types.String `tfsdk:"oidc_issuer_url"`
213
- ResourceQuotaCpu types.String `tfsdk:"resource_quota_cpu"`
214
- ResourceQuotaMemory types.String `tfsdk:"resource_quota_memory"`
215
- DefaultTaskPodCpu types.String `tfsdk:"default_task_pod_cpu"`
216
- DefaultTaskPodMemory types.String `tfsdk:"default_task_pod_memory"`
217
- ScalingStatus types.Object `tfsdk:"scaling_status"`
218
- ScalingSpec types.Object `tfsdk:"scaling_spec"`
219
- }
220
-
221
169
type DeploymentEnvironmentVariable struct {
222
170
Key types.String `tfsdk:"key"`
223
171
Value types.String `tfsdk:"value"`
@@ -238,90 +186,6 @@ type WorkerQueue struct {
238
186
WorkerConcurrency types.Int64 `tfsdk:"worker_concurrency"`
239
187
}
240
188
241
- func (data * DeploymentDataSource ) ReadFromResponse (
242
- ctx context.Context ,
243
- deployment * platform.Deployment ,
244
- ) diag.Diagnostics {
245
- data .Id = types .StringValue (deployment .Id )
246
- data .Name = types .StringValue (deployment .Name )
247
- data .Description = types .StringPointerValue (deployment .Description )
248
- data .CreatedAt = types .StringValue (deployment .CreatedAt .String ())
249
- data .UpdatedAt = types .StringValue (deployment .UpdatedAt .String ())
250
- var diags diag.Diagnostics
251
- data .CreatedBy , diags = SubjectProfileTypesObject (ctx , deployment .CreatedBy )
252
- if diags .HasError () {
253
- return diags
254
- }
255
- data .UpdatedBy , diags = SubjectProfileTypesObject (ctx , deployment .UpdatedBy )
256
- if diags .HasError () {
257
- return diags
258
- }
259
- data .WorkspaceId = types .StringValue (deployment .WorkspaceId )
260
- data .ClusterId = types .StringPointerValue (deployment .ClusterId )
261
- data .Region = types .StringPointerValue (deployment .Region )
262
- data .CloudProvider = types .StringPointerValue ((* string )(deployment .CloudProvider ))
263
- data .AstroRuntimeVersion = types .StringValue (deployment .AstroRuntimeVersion )
264
- data .AirflowVersion = types .StringValue (deployment .AirflowVersion )
265
- data .Namespace = types .StringValue (deployment .Namespace )
266
- data .ContactEmails , diags = utils .StringList (deployment .ContactEmails )
267
- if diags .HasError () {
268
- return diags
269
- }
270
- data .Executor = types .StringPointerValue ((* string )(deployment .Executor ))
271
- if deployment .SchedulerAu != nil {
272
- deploymentSchedulerAu := int64 (* deployment .SchedulerAu )
273
- data .SchedulerAu = types .Int64Value (deploymentSchedulerAu )
274
- }
275
- data .SchedulerCpu = types .StringValue (deployment .SchedulerCpu )
276
- data .SchedulerMemory = types .StringValue (deployment .SchedulerMemory )
277
- data .SchedulerReplicas = types .Int64Value (int64 (deployment .SchedulerReplicas ))
278
- data .ImageTag = types .StringValue (deployment .ImageTag )
279
- data .ImageRepository = types .StringValue (deployment .ImageRepository )
280
- data .ImageVersion = types .StringPointerValue (deployment .ImageVersion )
281
- data .EnvironmentVariables , diags = utils .ObjectList (ctx , deployment .EnvironmentVariables , schemas .DeploymentEnvironmentVariableAttributeTypes (), DeploymentEnvironmentVariableTypesObject )
282
- if diags .HasError () {
283
- return diags
284
- }
285
- data .WebserverIngressHostname = types .StringValue (deployment .WebServerIngressHostname )
286
- data .WebserverUrl = types .StringValue (deployment .WebServerUrl )
287
- data .WebserverAirflowApiUrl = types .StringValue (deployment .WebServerAirflowApiUrl )
288
- data .Status = types .StringValue (string (deployment .Status ))
289
- data .StatusReason = types .StringPointerValue (deployment .StatusReason )
290
- data .DagTarballVersion = types .StringPointerValue (deployment .DagTarballVersion )
291
- data .DesiredDagTarballVersion = types .StringPointerValue (deployment .DesiredDagTarballVersion )
292
- data .WorkerQueues , diags = utils .ObjectList (ctx , deployment .WorkerQueues , schemas .WorkerQueueAttributeTypes (), WorkerQueueTypesObject )
293
- if diags .HasError () {
294
- return diags
295
- }
296
- data .TaskPodNodePoolId = types .StringPointerValue (deployment .TaskPodNodePoolId )
297
- data .IsCicdEnforced = types .BoolValue (deployment .IsCicdEnforced )
298
- data .Type = types .StringPointerValue ((* string )(deployment .Type ))
299
- data .IsDagDeployEnabled = types .BoolValue (deployment .IsDagDeployEnabled )
300
- data .SchedulerSize = types .StringPointerValue ((* string )(deployment .SchedulerSize ))
301
- data .IsHighAvailability = types .BoolPointerValue (deployment .IsHighAvailability )
302
- data .IsDevelopmentMode = types .BoolPointerValue (deployment .IsDevelopmentMode )
303
- data .WorkloadIdentity = types .StringPointerValue (deployment .WorkloadIdentity )
304
- data .ExternalIps , diags = utils .StringList (deployment .ExternalIPs )
305
- if diags .HasError () {
306
- return diags
307
- }
308
- data .OidcIssuerUrl = types .StringPointerValue (deployment .OidcIssuerUrl )
309
- data .ResourceQuotaCpu = types .StringPointerValue (deployment .ResourceQuotaCpu )
310
- data .ResourceQuotaMemory = types .StringPointerValue (deployment .ResourceQuotaMemory )
311
- data .DefaultTaskPodCpu = types .StringPointerValue (deployment .DefaultTaskPodCpu )
312
- data .DefaultTaskPodMemory = types .StringPointerValue (deployment .DefaultTaskPodMemory )
313
- data .ScalingStatus , diags = ScalingStatusTypesObject (ctx , deployment .ScalingStatus )
314
- if diags .HasError () {
315
- return diags
316
- }
317
- data .ScalingSpec , diags = ScalingSpecTypesObject (ctx , deployment .ScalingSpec )
318
- if diags .HasError () {
319
- return diags
320
- }
321
-
322
- return nil
323
- }
324
-
325
189
func DeploymentEnvironmentVariableTypesObject (
326
190
ctx context.Context ,
327
191
envVar platform.DeploymentEnvironmentVariable ,
0 commit comments