Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: lacework_agent_configuration type #63

Merged
merged 2 commits into from
Nov 23, 2022

Conversation

jon-stewart
Copy link
Contributor

@jon-stewart jon-stewart commented Nov 23, 2022

Summary

The keyword map is a shorthand for map(any), which accepts any element type as long as every element is the same type. This is for compatibility with older configurations; for new code, we recommend using the full form.

Need to change variable type of lacework_agent_configuration from a collectionType to a structuralType. This means defining specific object attributes.

My best attempt at finding documented agent configuration Configure Linux Agent Behavior in config.json File | Lacework Documentation. There are a lot more nested objects that are supported. Even the TF examples contains an undocumented variable privileges.

Therefore I am proposing changing the type to any.

How did you test this change?

Local testing with terraform validate and terraform plan.

Example main.tf attached to Jira ticket. With this change:

  # module.lacework_k8s_datacollector.random_id.config_name_tail will be created
  + resource "random_id" "config_name_tail" {
      + b64_std     = (known after apply)
      + b64_url     = (known after apply)
      + byte_length = 8
      + dec         = (known after apply)
      + hex         = (known after apply)
      + id          = (known after apply)
      + keepers     = {
          + "data" = jsonencode(
                {
                  + cpurequest = "200m"
                  + fim        = {
                      + mode  = "enable"
                      + runat = "23:50"
                    }
                  + privileges = {
                      + capsmode = "enabled"
                    }
                  + serverurl  = ""
                  + tags       = {
                      + Env = "k8s"
                    }
                  + tokens     = {
                      + AccessToken = ""
                    }
                }
            )
        }
    }

Issue

LINK-1111

@jon-stewart jon-stewart self-assigned this Nov 23, 2022
@jon-stewart jon-stewart marked this pull request as ready for review November 23, 2022 12:14
@dmurray-lacework dmurray-lacework merged commit 9d9fde7 into main Nov 23, 2022
@dmurray-lacework dmurray-lacework deleted the jon-stewart/LINK-1111/agent-conf-type branch November 23, 2022 13:02
@lacework-releng lacework-releng mentioned this pull request Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants