Change Terraform data source attribute
ProprietaryChange the value of an attribute on a Terraform data block if it matches a given pattern. Data sources are labelled with a type and a local name just like resources, and the two share type names, so this is a separate recipe from ChangeResourceAttribute.
org. openrewrite. terraform. ChangeDataSourceAttributeRequired
A Terraform data source type, without the quotes. This is the first label of the data block.
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 matched against the data source's local name (the second label). If not provided, all data sources of dataSourceType 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. ChangeDataSourceAttribute \
-P dataSourceType= aws_ami \
-P attributeName= most_recent \
-P newValue= trueInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.