cloudflare-docs icon indicating copy to clipboard operation
cloudflare-docs copied to clipboard

Terraform: Email attribute conflicts with api_token attribute in example.

Open Arnall opened this issue 3 years ago • 0 comments

Which Cloudflare product does this pertain to?

Terraform

Existing documentation URL(s)

https://developers.cloudflare.com/terraform/tutorial/initialize-terraform/ https://developers.cloudflare.com/terraform/tutorial/track-history/

Section that requires update

https://developers.cloudflare.com/terraform/tutorial/initialize-terraform/#1-define-your-first-terraform-config-file

provider "cloudflare" {
  email = "[email protected]"
  api_token = "your-api-token"
}

What needs to change?

according to provider Cloudflare : https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs#email

email conflicts with api_token.

terraform plan with the example generates this error :

╷
│ Error: Missing required argument
│ 
│   with provider["registry.terraform.io/cloudflare/cloudflare"],
│   on cloudflare.tf line 12, in provider "cloudflare":
│   12:     email = "[email protected]"
│ 
│ "email": all of `api_key,email` must be specified

How should it change?

remove this line: email = "[email protected]" from the example. same error here : https://developers.cloudflare.com/terraform/tutorial/track-history/

Additional information

email is needed with api_key (now considered legacy by Cloudflare) not with api_token.

Arnall avatar Aug 09 '22 08:08 Arnall