Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identify module_name provider_meta for Equinix provider #70

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

displague
Copy link
Contributor

This change supplies metadata that reflects the adoption of this module by Equinix users.

@dnoland1
Copy link
Collaborator

dnoland1 commented Jun 1, 2024

This change supplies metadata that reflects the adoption of this module by Equinix users.
@displague
Copy link
Contributor Author

Thanks for catching this, @dnoland1

provider_meta's parent is the terraform block. fixed

terraform init

Initializing the backend...

Initializing provider plugins...
- Finding latest version of hashicorp/http...
- Finding rancher/rancher2 versions matching "4.1.0"...
- Finding equinix/equinix versions matching "1.34.1"...
- Finding latest version of hashicorp/random...
- Finding latest version of hashicorp/local...
- Installing hashicorp/http v3.4.2...
- Installed hashicorp/http v3.4.2 (signed by HashiCorp)
- Installing rancher/rancher2 v4.1.0...
- Installed rancher/rancher2 v4.1.0 (signed by a HashiCorp partner, key ID 2EEB0F9AD44A135C)
- Installing equinix/equinix v1.34.1...
- Installed equinix/equinix v1.34.1 (signed by a HashiCorp partner, key ID 1A65631C7288685E)
- Installing hashicorp/random v3.6.2...
- Installed hashicorp/random v3.6.2 (signed by HashiCorp)
- Installing hashicorp/local v2.5.1...
- Installed hashicorp/local v2.5.1 (signed by HashiCorp)

Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

@devenkulkarni
Copy link
Contributor

@displague I understand the use of provider_meta after reading the documentation here - https://developer.hashicorp.com/terraform/internals/provider-meta

Basically, it would parse in the metadata for the provider whenever Terraform calls the Equinix provider and it would be useful for you to get all the necessary details.

@devenkulkarni devenkulkarni self-requested a review June 22, 2024 05:48
@devenkulkarni
Copy link
Contributor

@displague Can you please share a screenshot of how you are using the metadata or how you are exactly processing the metadata?

Then I will approve the change and merge it.

@displague
Copy link
Contributor Author

displague commented Jul 1, 2024

@devenkulkarni The metadata can be surfaced in any tool that processes HTTP UserAgent, any web traffic analyizer.
Because these requests are from Equinix customers (otherwise they would not have valid user tokens), and the requests are currently being sent as "...Terraform... (along with the version of the equinix provider, equinix-sdk-go, and go", this information helps to understand how users are interacting with the service and identify where we may need to reach out to users about changes in the service or behavior. (If they are using a deprecated feature of the API or the Terraform provider, we can follow-up.)

This visualization represents an alphabetical list of specific API behaviors made by public Terraform modules on equinix-labs that include the module_name, scale and graphs omitted:

image

@displague
Copy link
Contributor Author

displague commented Jul 1, 2024

Two CI failures to address, although I'm not sure that this PR introduced them. Looks like #63.

Set output stderr = ╷
##[debug]│ Error: Attempt to get attribute from null value
##[debug]│ 
##[debug]│   on main.tf line 3, in locals:
##[debug]│    3:   metro      = var.use_cheapest_metro ? local.cheapest_metro_price.metro : lower(var.metro)
##[debug]│     ├────────────────
##[debug]│     │ local.cheapest_metro_price is null
##[debug]│ 
##[debug]│ This value is null, so it does not have any attributes.
##[debug]╵
##[debug]╷
##[debug]│ Error: Failed to load provider configuration
##[debug]│ 
##[debug]│   with provider["registry.terraform.io/equinix/equinix"],
##[debug]│   on provider.tf line 18, in provider "equinix":
##[debug]│   18: provider "equinix" {}
##[debug]│ 
##[debug]│ the provider needs to be configured with the proper credentials before it
##[debug]│ can be used.
##[debug]│ 
##[debug]│ One of pair "client_id" - "client_secret" or "token" must be set in the
##[debug]│ provider
##[debug]│ configuration to interact with Equinix Fabric and Network Edge services,
##[debug]│ and
##[debug]│ "auth_token" to interact with Equinix Metal. These can also be configured
##[debug]│ using
##[debug]│ environment variables.
##[debug]│ 
##[debug]│ Please note that while the authentication arguments are individually
##[debug]│ optional to allow
##[debug]│ interaction with the different services independently, trying to provision
##[debug]│ the resources
##[debug]│ of a service without the required credentials will return an API error
##[debug]│ referring to
##[debug]│ 'Invalid authentication token' or 'error when acquiring token'.
##[debug]│ 
##[debug]│ More information on the provider configuration can be found here:
##[debug]│ https://registry.terraform.io/providers/equinix/equinix/latest/docs
##[debug]╵

Copy link
Collaborator

@dnoland1 dnoland1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@devenkulkarni devenkulkarni merged commit 8546ca9 into rancherlabs:main Jul 8, 2024
1 check failed
@devenkulkarni
Copy link
Contributor

@displague approved and merged.
Ignore the CI failures those are expected since you forked the repo and created this PR and CI needs access to the repo directly and some specific perms. I am closing this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants