optionally specify additional user agent details #247
Merged
+165
−21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR enables Terraform configuration authors to optionally specify additional user-agent data that terraform passes on to AWS Cloud Control API's.
This is useful for discovery and compliance purposes, as the user-agent for each API call is available as a CloudTrail event. Teams can use this data to identify workloads running in their account such as 3rd party products, OU's, etc.
In addition to unit tests, functional tests were done by compiling the patched provider locally and running
apply
withTFLOG=TRACE
set to print the raw api calls. Using this tf module:Checking both the Terraform trace output and the resulting event in CloudTrail I was able to confirm that the User-Agent had the custom data in addition to the default Terraform user-agent data:
APN/1.0 HashiCorp/1.0 Terraform/1.0.8 (+https://www.terraform.io) terraform-provider-awscc/dev (+https://registry.terraform.io/providers/hashicorp/awscc) my-test-module/0.0.1 (testing user-agent comment) aws-sdk-go-v2/1.9.1 os/macos lang/go/1.17 md/GOOS/darwin md/GOARCH/amd64 api/cloudcontrol/1.0.0
Community Note