Skip to content

Conversation

@jar-b
Copy link
Member

@jar-b jar-b commented Oct 29, 2025

Description

This PR will not be merged. It is only intended to record the attempted implementation of provider_meta with structural attributes, and document why this approach does not work within the current constraints of the AWS provider.

Background

The AWSCC provider already has a working implementation of provider_meta support in which the schema contains a single user_agent attribute that is a list of objects. This schema matches the existing provider-level configuration attribute of the same name. Notably, the AWSCC provider uses only Terraform Plugin Framework and operates with Terraform Protocol V6.

  provider_meta "awscc" {
    user_agent = [
      {
        product_name    = "jb-demo"
        product_version = "0.0.1"
        comment         = "a demo module"
      },
    ]
  }

In an ideal scenario, the standard provider would match the rough shape of the schema, but replace list attributes with blocks.

  provider_meta "aws" {
    user_agent {
      product_name    = "jb-demo"
      product_version = "0.0.1"
      comment         = "a demo module"
    }
  }

However, the schema cannot be written in this way as Terraform Protocol V5 doesn't support structural attributes, meaning an attribute with this shape can't be defined in the protocol at all.

│ Error: Failed to load plugin schemas
│
│ Error while loading schemas for plugin components: Failed to obtain provider schema: Could not load the schema for provider registry.terraform.io/hashicorp/aws: failed to retrieve
│ schema from provider "registry.terraform.io/hashicorp/aws": Error converting provider_meta schema: The provider_meta schema couldn't be converted into a usable type. This is always
│ a problem with the provider. Please report the following to the provider developer:
│
│ AttributeName("user_agent"): protocol version 5 cannot have Attributes set..

Additionally, even if the provider were upgraded to Terraform Protocol V6, Terraform Plugin Framework lacks support for blocks in the metaschema.Schema struct, making it impossible to match the schema shape between the Plugin SDK V2 and Plugin Framework providers as required by terraform-plugin-mux.1

Footnotes

  1. This particular limitation means that the standard provider will effectively never be able to implement a structural attribute in provider_meta. Eliminating muxing from the provider would require thousands of Plugin SDK V2 based resources to be migrated to Plugin Framework. There is no currently available tooling which makes this feasible at the scale of the AWS provider.

This will enable support for module-scoped User-Agent additions.
@jar-b jar-b closed this Oct 29, 2025
@github-actions
Copy link
Contributor

Community Guidelines

This 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

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Oct 29, 2025
@github-actions
Copy link
Contributor

Warning

This Issue has been closed, meaning that any additional comments are much easier for the maintainers to miss. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. client-connections Pertains to the AWS Client and service connections. size/L Managed by automation to categorize the size of a PR. labels Oct 29, 2025
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. 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. size/L Managed by automation to categorize the size of a PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant