Change Terraform required provider attribute
ProprietaryChange the value of an attribute on an entry of a terraform { required_providers { ... } } block, for example to bump a provider version constraint or to point a source at a different registry. Since Terraform 0.13 this is where provider versions are declared, so use this recipe rather than ChangeProviderConfigurationAttribute to manage provider versions.
org. openrewrite. terraform. ChangeRequiredProviderAttributeRequired
The name of the attribute to change, typically version or source.
The new value to set. For quoted string attributes, provide the value without quotes.
Optional
A regular expression matched against the required provider's source value. Only providers with a matching source will be changed. If not provided, every entry of required_providers is considered.
A regular expression matched against the local name the provider is configured under, which is the key of the required_providers entry. If not provided, providers with any name are considered.
A regular expression to match the current attribute value. Only matching attributes will be changed. If not provided, all values will be changed. For quoted string values, match against the content without quotes.
mod run . --recipe= org. openrewrite. terraform. ChangeRequiredProviderAttribute \
-P attributeName= version \
-P newValue= '~> 5.0'Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.