Interview Prep/Terraform/Workflow and Providers

You want to manage Datadog monitors with Terraform. How do you add a third-party provider correctly?

BeginnerScenarioWorkflow and Providers
Answer

Situation read → Non-HashiCorp providers need an explicit source address.

What I'd do →

  1. Declare it in required_providers with the namespace.
  2. Configure credentials via environment variables.
  3. Run terraform init.
terraform {
  required_providers {
    datadog = {
      source  = "DataDog/datadog"
      version = "~> 3.0"
    }
  }
}
provider "datadog" {}   # reads DD_API_KEY and DD_APP_KEY

Why → Since 0.13, providers are namespaced (registry.terraform.io/DataDog/datadog); without a source, Terraform assumes hashicorp/.

Interview tip → Mention keeping API keys in env vars or a secrets store, never in .tf files.

All Terraform questions Roadmap: Terraform

More on Workflow and Providers