Change Terraform provider configuration attribute

Proprietary

Change the value of an attribute on a Terraform provider block if it matches a given pattern, for example to move a provider configuration to another region. Provider version constraints belong in terraform { required_providers { ... } }, so use ChangeRequiredProviderAttribute to change those.

org.openrewrite.terraform.ChangeProviderConfigurationAttribute

Required

A Terraform provider name, without the quotes.

The name of the attribute to change.

The new value to set. For quoted string attributes, provide the value without quotes.

Optional

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.ChangeProviderConfigurationAttribute \ -P providerName=aws \ -P attributeName=region \ -P newValue=us-west-2

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.