Skip to content

[datadog_csm_threats] supporting cws multi-policy in terraform #2681

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

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

homoeconomics
Copy link

@homoeconomics homoeconomics commented Nov 15, 2024

Adding new resources and data sources to support the CWS multi-policy feature.

  1. Updated the data source and resource datadog_csm_threats_agent_rule
  2. Added a new data source resource datadog_csm_threats_policy for users to manage their policies.
  3. Added a new data source and resource datadog_csm_threats_multi_policy_agent_rule for users to manage their rules in a policy.
  • Create an agent rule (for GovCloud or backward compatibility):
resource "datadog_csm_threats_agent_rule" "my_agent_rule" {
    description  = "my terraform rule"
    enabled      = false
    expression   = "bind.addr.ip==1.1.1.1"
    name         = "my_terraform_rule"
}
  • Create a policy resource:
resource "datadog_csm_threats_policy" "my_policy" {
    description  = "my terraform policy"
    enabled      = false
    name         = "TERRAFORM POLICY"
    tags         = ["env:staging"]
}
  • Create a multi policy agent rule resource:
resource "datadog_csm_threats_multi_policy_agent_rule" "my_rule" {
    description  = "my terraform rule"
    enabled      = false
    expression   = "bind.addr.ip==1.1.1.1"
    name         = "TERRAFORM_RULE"
    policy_id    = datadog_csm_threats_policy.my_policy.id
    product_tags = ["foo:bar"]
}

@homoeconomics homoeconomics force-pushed the daniel.zhou/CWS-3394-tf-provider branch from 6322019 to 5da3fb7 Compare November 15, 2024 20:48
@QuentinGuillard QuentinGuillard force-pushed the daniel.zhou/CWS-3394-tf-provider branch 2 times, most recently from bf4b1af to 4c19fd8 Compare February 14, 2025 13:25
@QuentinGuillard QuentinGuillard force-pushed the daniel.zhou/CWS-3394-tf-provider branch from a390790 to 6fc7905 Compare February 27, 2025 13:04
@QuentinGuillard QuentinGuillard force-pushed the daniel.zhou/CWS-3394-tf-provider branch 2 times, most recently from f715a3a to 595f718 Compare February 28, 2025 16:56
@QuentinGuillard QuentinGuillard force-pushed the daniel.zhou/CWS-3394-tf-provider branch 2 times, most recently from 8c3f3f3 to 1d306ae Compare March 28, 2025 15:36
@QuentinGuillard QuentinGuillard force-pushed the daniel.zhou/CWS-3394-tf-provider branch from 2c6ae21 to 37ea69b Compare April 3, 2025 12:09
@QuentinGuillard QuentinGuillard force-pushed the daniel.zhou/CWS-3394-tf-provider branch 2 times, most recently from a8a6b1c to fdbc105 Compare May 13, 2025 13:58
@QuentinGuillard QuentinGuillard force-pushed the daniel.zhou/CWS-3394-tf-provider branch from fdbc105 to 3f0069d Compare May 15, 2025 07:35
@QuentinGuillard QuentinGuillard force-pushed the daniel.zhou/CWS-3394-tf-provider branch from 84f08b8 to b528f99 Compare May 15, 2025 08:25
@QuentinGuillard QuentinGuillard marked this pull request as ready for review May 15, 2025 08:56
@QuentinGuillard QuentinGuillard requested review from a team as code owners May 15, 2025 08:56
@QuentinGuillard QuentinGuillard changed the title supporting cws multi-policy in terraform [CWS - Workload Protection] supporting cws multi-policy in terraform May 15, 2025
@QuentinGuillard QuentinGuillard changed the title [CWS - Workload Protection] supporting cws multi-policy in terraform [CWS] supporting cws multi-policy in terraform May 15, 2025
@QuentinGuillard QuentinGuillard changed the title [CWS] supporting cws multi-policy in terraform [datadog_csm_threats] supporting cws multi-policy in terraform May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants