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

Use HCP provider metadata to track module usage #13

Merged
merged 2 commits into from
Oct 22, 2021
Merged

Conversation

crhino
Copy link
Contributor

@crhino crhino commented Oct 21, 2021

This uses the feature added in hashicorp/terraform-provider-hcp#197 to track module usage.

Also removes test code that was causing failures.

Apparently in the EKS module the "aws configmap" depends on the
variables passed in.
@crhino crhino requested a review from a team October 21, 2021 21:08
@crhino
Copy link
Contributor Author

crhino commented Oct 22, 2021

I ran the tests for both examples and they passed, plus validated that the metadata was sent correctly.

I did realize we should update the provider to add the metadata on the AWS peering connection as well: hashicorp/terraform-provider-hcp#213.

Copy link
Contributor

@chapmanc chapmanc left a comment

Choose a reason for hiding this comment

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

LGTM but just a minor question if we want to make it more fine grained.

}
}

provider_meta "hcp" {
module_name = "hcp-consul"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be even more fine grained? Like hcp-consul-ec2 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like source channel would be terraform-module/hcp-consul-ec2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question! I think for now using just hcp-consul is good enough, and is more consistent with the actual name of the module. If we wanted to track EC2-specific usage, I think a better way would be instrumenting the hcp-ec2-client submodule somehow.

@crhino crhino merged commit 6cb36da into main Oct 22, 2021
@crhino crhino deleted the crhino/provider-meta branch October 22, 2021 15:42
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.

2 participants