@@ -2,11 +2,12 @@ package sysdig
22
33import (
44 "context"
5+ "strconv"
6+ "time"
7+
58 v2 "github.com/draios/terraform-provider-sysdig/sysdig/internal/client/v2"
69 "github.com/hashicorp/terraform-plugin-sdk/v2/diag"
710 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
8- "strconv"
9- "time"
1011)
1112
1213func resourceSysdigSecurePostureZone () * schema.Resource {
@@ -105,16 +106,6 @@ func getPostureZoneClient(c SysdigClients) (v2.PostureZoneInterface, error) {
105106}
106107
107108func resourceCreateOrUpdatePostureZone (ctx context.Context , d * schema.ResourceData , meta interface {}) diag.Diagnostics {
108- commonClient , err := meta .(SysdigClients ).commonClientV2 ()
109- if err != nil {
110- return diag .FromErr (err )
111- }
112-
113- identityCtx , err := commonClient .GetIdentityContext (ctx )
114- if err != nil {
115- return diag .FromErr (err )
116- }
117-
118109 policiesData := d .Get (SchemaPolicyIDsKey ).([]interface {})
119110 policies := make ([]string , len (policiesData ))
120111 for i , p := range policiesData {
@@ -134,18 +125,12 @@ func resourceCreateOrUpdatePostureZone(ctx context.Context, d *schema.ResourceDa
134125 }
135126 }
136127
137- username := identityCtx .Username
138- if identityCtx .ServiceAccountID != 0 {
139- username = identityCtx .ServiceAccountName
140- }
141-
142128 req := & v2.PostureZoneRequest {
143129 ID : d .Id (),
144130 Name : d .Get (SchemaNameKey ).(string ),
145131 Description : d .Get (SchemaDescriptionKey ).(string ),
146132 PolicyIDs : policies ,
147133 Scopes : scopes ,
148- Username : username ,
149134 }
150135
151136 zoneClient , err := getPostureZoneClient (meta .(SysdigClients ))
0 commit comments