Skip to content

Commit

Permalink
Change Zone policy_ids schema to set instead of array (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
chen-shmilovich-sysdig authored Nov 7, 2023
1 parent d3b3af5 commit f32bd98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sysdig/resource_sysdig_secure_posture_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func resourceSysdigSecurePostureZone() *schema.Resource {
},
SchemaPolicyIDsKey: {
Optional: true,
Type: schema.TypeList,
Type: schema.TypeSet,
Elem: &schema.Schema{
Type: schema.TypeInt,
},
Expand Down Expand Up @@ -106,7 +106,7 @@ func getPostureZoneClient(c SysdigClients) (v2.PostureZoneInterface, error) {
}

func resourceCreateOrUpdatePostureZone(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
policiesData := d.Get(SchemaPolicyIDsKey).([]interface{})
policiesData := d.Get(SchemaPolicyIDsKey).(*schema.Set).List()
policies := make([]string, len(policiesData))
for i, p := range policiesData {
policies[i] = strconv.Itoa(p.(int))
Expand Down

0 comments on commit f32bd98

Please sign in to comment.