lacework / terraform-provider-lacework

Terraform Lacework provider
Mozilla Public License 2.0
17 stars 14 forks source link

fix: adding resource tags to policy exception data type #619

Closed ipcrm closed 7 months ago

ipcrm commented 7 months ago

Issue: https://lacework.atlassian.net/browse/GROW-2831

Description:

Prior to this commit the data type supplied via the policy exception field_value_map resulted in map[string]string being sent to the API. The required format is map[string][]string. This commit fixes this.

Additional Info: See example and test updates.

rwlodarczyk-xealth commented 7 months ago

Looks great! Thanks for the fix!

ipcrm commented 7 months ago

Unfortunately we cannot release this as-is because it will cause issues with existing state, and even with a state upgrader (tested) this will still cause errors because of the schema type change (string -> []string).

To avoid breakage, we are going to introduce a new field_values_map (plural instead of singular) that supports the correct data type. The existing field_value_map will be marked deprecated and removed next version bump. @rwlodarczyk-xealth apologies on the delay on this, will get his wrapped hopefully in the next day.

ipcrm commented 7 months ago

Revised the approach here; from the commit message:

Deprecates field_value_map for field_values_map. The data type needs to
change for the exceptions to take effect. By deprecating field_value_map
instead of changing it we will not introduce a breaking change, corrupt
any current state, and avoid any required code changes due to breakage.