Skip to content

Commit

Permalink
Add support for replica zones, service account scopes, and auditd log…
Browse files Browse the repository at this point in the history
…ging in workstations configs (#9028) (#1487)

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Sep 22, 2023
1 parent 39869f6 commit c698c6b
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ func GetWorkstationsWorkstationConfigApiObject(d tpgresource.TerraformResourceDa
} else if v, ok := d.GetOkExists("running_timeout"); !tpgresource.IsEmptyValue(reflect.ValueOf(runningTimeoutProp)) && (ok || !reflect.DeepEqual(v, runningTimeoutProp)) {
obj["runningTimeout"] = runningTimeoutProp
}
replicaZonesProp, err := expandWorkstationsWorkstationConfigReplicaZones(d.Get("replica_zones"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("replica_zones"); !tpgresource.IsEmptyValue(reflect.ValueOf(replicaZonesProp)) && (ok || !reflect.DeepEqual(v, replicaZonesProp)) {
obj["replicaZones"] = replicaZonesProp
}
enableAuditAgentProp, err := expandWorkstationsWorkstationConfigEnableAuditAgent(d.Get("enable_audit_agent"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("enable_audit_agent"); !tpgresource.IsEmptyValue(reflect.ValueOf(enableAuditAgentProp)) && (ok || !reflect.DeepEqual(v, enableAuditAgentProp)) {
obj["enableAuditAgent"] = enableAuditAgentProp
}
hostProp, err := expandWorkstationsWorkstationConfigHost(d.Get("host"), d, config)
if err != nil {
return nil, err
Expand Down Expand Up @@ -156,6 +168,14 @@ func expandWorkstationsWorkstationConfigRunningTimeout(v interface{}, d tpgresou
return v, nil
}

func expandWorkstationsWorkstationConfigReplicaZones(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}

func expandWorkstationsWorkstationConfigEnableAuditAgent(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}

func expandWorkstationsWorkstationConfigHost(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 || l[0] == nil {
Expand Down Expand Up @@ -198,6 +218,13 @@ func expandWorkstationsWorkstationConfigHostGceInstance(v interface{}, d tpgreso
transformed["serviceAccount"] = transformedServiceAccount
}

transformedServiceAccountScopes, err := expandWorkstationsWorkstationConfigHostGceInstanceServiceAccountScopes(original["service_account_scopes"], d, config)
if err != nil {
return nil, err
} else if val := reflect.ValueOf(transformedServiceAccountScopes); val.IsValid() && !tpgresource.IsEmptyValue(val) {
transformed["serviceAccountScopes"] = transformedServiceAccountScopes
}

transformedPoolSize, err := expandWorkstationsWorkstationConfigHostGceInstancePoolSize(original["pool_size"], d, config)
if err != nil {
return nil, err
Expand Down Expand Up @@ -265,6 +292,10 @@ func expandWorkstationsWorkstationConfigHostGceInstanceServiceAccount(v interfac
return v, nil
}

func expandWorkstationsWorkstationConfigHostGceInstanceServiceAccountScopes(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}

func expandWorkstationsWorkstationConfigHostGceInstancePoolSize(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}
Expand Down

0 comments on commit c698c6b

Please sign in to comment.