lacework / terraform-provider-lacework

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

bug: remediation is not optional for policies #583

Closed eambrosyupgrade closed 10 months ago

eambrosyupgrade commented 10 months ago

Describe the bug When creating a compliance policy, an empty string is interpreted as a blank and the provider receives a 400 from the Lacework API. Additionally not including the remediation field also 400s for the field not being blank.

Looking at docs, this is a required field in the API

To Reproduce

  1. create a compliance policy and set remediation to "" or don't include a remediation
  2. Run an apply

Expected behavior I should be able to provide an empty string or null value for Remediation based on terraform docs and Option: True here

Screenshots

╷
│ Error: 
│   [POST] https://upgrade.lacework.net/api/v2/Policies
│   [400] Incorrect configuration of field remediation: must not be blank
│ 
│   with lacework_policy.example,
│   on test_policy.tf line 1, in resource "lacework_policy" "example":
│    1: resource "lacework_policy" "example" {
│ 

Please complete the following information):

Additional context

afiune commented 10 months ago

Thank you so much for reporting this, @eambrosyupgrade !!