-
Notifications
You must be signed in to change notification settings - Fork 9.8k
provider: add provider_meta support
#45464
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
Open
jar-b
wants to merge
14
commits into
main
Choose a base branch
from
f-provider-meta-simple
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+487
−30
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Community GuidelinesThis comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀 Voting for Prioritization
Pull Request Authors
|
61765df to
80f7a5f
Compare
This was referenced Dec 5, 2025
This will enable support for module-scoped User-Agent additions. Also
introduces a `user_agent` provider argument for parity with the
arguments available in the AWSCC provider.
```terraform
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 6.0"
}
}
provider_meta "aws" {
user_agent = [
"example-demo/0.0.1 (a demo module)"
]
}
}
```
Plugin SDK V2 based resource: ```console % make t K=logs T=TestAccLogsLogGroup_providerMeta make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... make: Running acceptance tests on branch: 🌿 f-provider-meta-simple 🌿... TF_ACC=1 go1.24.11 test ./internal/service/logs/... -v -count 1 -parallel 20 -run='TestAccLogsLogGroup_providerMeta' -timeout 360m -vet=off 2025/12/08 13:31:36 Creating Terraform AWS Provider (SDKv2-style)... 2025/12/08 13:31:36 Initializing Terraform AWS Provider (SDKv2-style)... --- PASS: TestAccLogsLogGroup_providerMeta (14.83s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/logs 21.333s ``` Plugin Framework based resource: ```console % make t K=iot T=TestAccIoTBillingGroup_providerMeta make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... make: Running acceptance tests on branch: 🌿 f-provider-meta-simple 🌿... TF_ACC=1 go1.24.11 test ./internal/service/iot/... -v -count 1 -parallel 20 -run='TestAccIoTBillingGroup_providerMeta' -timeout 360m -vet=off 2025/12/08 13:26:38 Creating Terraform AWS Provider (SDKv2-style)... 2025/12/08 13:26:38 Initializing Terraform AWS Provider (SDKv2-style)... --- PASS: TestAccIoTBillingGroup_providerMeta (14.89s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/iot 21.397s ```
80f7a5f to
1173735
Compare
This was referenced Dec 9, 2025
Provider: Support module-scoped user-agents via
provider_meta
hashicorp/terraform-provider-awscc#474
Open
This function will format a User-Agent entry given a product name, product version, and optional comment. It can be paired with the `user_agent` argument in the `provider` and `provider_meta` blocks. ```console % TF_ACC=1 go test -v ./internal/function/... -run=TestUserAgentFunction_ 2025/12/10 15:06:44 Creating Terraform AWS Provider (SDKv2-style)... 2025/12/10 15:06:45 Initializing Terraform AWS Provider (SDKv2-style)... --- PASS: TestUserAgentFunction_missingName (1.01s) --- PASS: TestUserAgentFunction_basic (21.86s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/function 28.277s ```
```console % TF_ACC=1 go test -v ./internal/function/... -run=TestUserAgentFunction_ 2025/12/10 15:15:39 Creating Terraform AWS Provider (SDKv2-style)... 2025/12/10 15:15:39 Initializing Terraform AWS Provider (SDKv2-style)... --- PASS: TestUserAgentFunction_invalid (1.32s) --- PASS: TestUserAgentFunction_valid_name (7.90s) --- PASS: TestUserAgentFunction_valid (7.93s) --- PASS: TestUserAgentFunction_valid_nameVersion (7.98s) --- PASS: TestUserAgentFunction_valid_nameComment (8.00s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/function 14.469s ```
YakDriver
previously approved these changes
Dec 11, 2025
Member
YakDriver
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
This is pretty cool!
ewbankkit
reviewed
Dec 11, 2025
ewbankkit
reviewed
Dec 11, 2025
ewbankkit
reviewed
Dec 11, 2025
ewbankkit
reviewed
Dec 11, 2025
This brings together the provider-level and `provider_meta` module-scoped sections to provide a more complete picture of all the ways in which User-Agent headers can be extended.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
client-connections
Pertains to the AWS Client and service connections.
documentation
Introduces or discusses updates to documentation.
function
Pertains to provider functions.
prioritized
Part of the maintainer teams immediate focus. To be addressed within the current quarter.
provider
Pertains to the provider itself, rather than any interaction with AWS.
service/iot
Issues and PRs that pertain to the iot service.
service/logs
Issues and PRs that pertain to the logs service.
size/L
Managed by automation to categorize the size of a PR.
size/XL
Managed by automation to categorize the size of a PR.
tests
PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
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.
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the library.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
Description
This will enable support for module-scoped User-Agent additions.
User-Agent details can be scoped to modules by setting
provider_metain theterraformblock.Also,
user_agentprovider argument for parity with the arguments available in the AWSCC provider.user_agentprovider-defined function to assist with composing entries for theuser_agentargument from the constituent name, version, and comment parts.Relations
Depends on hashicorp/aws-sdk-go-base#1389
Relates #45493
Relates hashicorp/terraform-provider-awscc#474
Output from Acceptance Testing
Plugin SDK V2 based resource:
Plugin Framework based resource: