terraform-provider-cloudflare icon indicating copy to clipboard operation
terraform-provider-cloudflare copied to clipboard

account_id/account data source

Open tguvdamm opened this issue 2 years ago • 1 comments

Current Terraform and Cloudflare provider version

v1.2.7

Description

A data source to fetch the provider's api token's account_id. Now that the provider's account_id is deprecated, we shouldn't have to explicitly look it up when we want to use it in a different resource.

Use cases

We need the account_id as part of logging in a cloudflare worker script, so we want to inject it as a variable. It's currently not possible (or at least I can't find a way) to fetch the account_id in Terraform config.

Potential Terraform configuration

similar to the aws provider

data "cloudflare_account" "current" {}

...

locals {
account_id = data.cloudflare_account.current.account_id
}

References

No response

tguvdamm avatar Sep 15 '22 09:09 tguvdamm

this is already started in #1902. please follow that PR for updates.

jacobbednarz avatar Sep 15 '22 12:09 jacobbednarz