Open nathanzanon opened 8 months ago
@nathanzanon we'll have to look into this in more detail, and may consider removing this environment variable. could you elaborate on your use case? Is it already met by GOOGLE_TERRAFORM_USERAGENT_EXTENSION?
I took a look about the origins of TF_APPEND_USER_AGENT:
This ENV has been here a long time and is currently in use for both SDK/plugin-framework parts of the provider.
Hi @melinath,
I didn't actually know about the GOOGLE_TERRAFORM_USERAGENT_EXTENSION
feature (I clearly need to RTFM ... again), I was only looking for the TF_APPEND_USER_AGENT
variable that I'd seen used before.
Using GOOGLE_TERRAFORM_USERAGENT_EXTENSION
would mostly satisfy our use case, noting that it appears this functionality was added in version 3.60.0
.
Although TF_APPEND_USER_AGENT
has the benefit that it's picked-up by Terraform and used in calls to a gcs
backend, but if set for the init
it has the potential downside that it's sent to registries.
@SarahFrench's investigation got me curious as to the exact releases the functionality was added. From my looking through the changelogs they don't mention them, so from my looking through history it appears:
TF_APPEND_USER_AGENT
was added in commit 5117943
, which was part of 1.15.0
on 25-Jun-2018.GOOGLE_TERRAFORM_USERAGENT_EXTENSION
was added in commit 13122c8
, which was part of 3.60.0
on 15-Mar-2021.A bit ashamed to admit we will have configs using providers older than 3.60.0
, so GOOGLE_TERRAFORM_USERAGENT_EXTENSION
wouldn't fully cover our usage.
From triage: we'll want to document using the newer environment variable GOOGLE_TERRAFORM_USERAGENT_EXTENSION
over the older TF_APPEND_USER_AGENT
variable.
Figure out how to add support for this into the GCS backend.
Community Note
Description
The provider appears to support including custom User Agent info through the use of the environment variable
TF_APPEND_USER_AGENT
-- current config, also as far back asv2.0.0
(I didn't look further back).This environment variable seems to be a defacto standard adopted by certain providers.
There is no documentation about it for the
google
provider(s) (or in Terraform itself), so it seems somewhat un-official.If this is "officially" supported, could use of the
TF_APPEND_USER_AGENT
environment variable please be documented.New or Affected Resource(s)
Potential Terraform Configuration
References