GoogleCloudPlatform / terraformer

CLI tool to generate terraform files from existing infrastructure (reverse Terraform). Infrastructure to Code
Apache License 2.0
12.09k stars 1.6k forks source link

Add Support for Datadog Powerpacks #1875

Open cameres opened 1 month ago

cameres commented 1 month ago

Adds support for generating datadog_powerpack resources via. powerpack. datadog_powerpack is documented here.

I've had the best luck either filtering for a specific set of powerpack ids (visible in dashboard json) like the following...

terraformer import datadog \
  --resources=powerpack \
  --filter powerpack="<id1>:...:<idN>"

... or by filtering down using the "Search Categories". Example, if I configure search category "process", I can filter down to powerpacks with that search category with this filter...

terraformer import datadog --resources=powerpack --filter="Name=tags;Value='tag:<search category>'"

I chose to use ListPowerpacksWithPagination, as I noticed that ListPowerpacks appears to set a default to 25 records. I don't see where this is configured. ListPowerpacksWithPagination seemed cleaner to use to me, as it manages page offsets.

This feature was requested in https://github.com/GoogleCloudPlatform/terraformer/issues/1841.

cameres commented 1 month ago

👋 @sergeylanzman mind taking a look at this PR or redirect me?