Skip to content

Conversation

@mohamed-challal
Copy link
Collaborator

What?

  • add TF examples for single region (simple), and cross project multi region (advanced)

@mohamed-challal mohamed-challal self-assigned this Nov 4, 2025
@mohamed-challal mohamed-challal requested a review from a team as a code owner November 4, 2025 09:59
@mohamed-challal mohamed-challal requested a review from k3nz0 November 7, 2025 09:42
description = "The Datadog site of your organization where scanner data will be sent (for example, datadoghq.com, datadoghq.eu, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ddog-gov.com). See https://docs.datadoghq.com/getting_started/site/"
type = string
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got an error when trying to apply this terraform

╷
│ Error: Invalid count argument
│
│   on .terraform/modules/datadog_agentless_scanner/gcp/modules/vpc/main.tf line 6, in resource "random_id" "deployment_suffix":
│    6:   count       = var.unique_suffix == "" ? 1 : 0
│
│ The "count" value depends on resource attributes that cannot be determined until apply, so Terraform cannot predict how many instances will be
│ created. To work around this, use the -target argument to first apply only the resources that the count depends on.

I fixed it by adding this here + passing the unique_suffix variable in main.tf (module datadog_agentless_scanner):

variable "unique_suffix" {
  description = "Unique suffix to append to resource names. Must be alphanumeric only and maximum 6 characters (will be appended with region suffix)."
  type        = string
  default     = "foobar"
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should fix the issue with TF plan
[K9VULN-8670] fix(gcp): fix gcp terraform plan

@mohamed-challal mohamed-challal merged commit 95598b0 into main Nov 7, 2025
3 checks passed
@mohamed-challal mohamed-challal deleted the mohamed.challal/add-gcp-tf-examples branch November 7, 2025 14:44
@mohamed-challal
Copy link
Collaborator Author

I merged the examples and the documentation.
We continue to iterate in other PRs.
Thanks for the reviews!

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.

4 participants