Change Terraform resource attribute

Proprietary

Change the value of a Terraform resource attribute if it matches a given pattern.

org.openrewrite.terraform.ChangeResourceAttribute

Required

A Terraform resource type, 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.ChangeResourceAttribute \ -P resourceName=aws_db_instance \ -P attributeName=engine_version \ -P newValue=8.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.