Add content
Apache 2.0Add an attribute or a block to HCL blocks selected by a JSONPath expression, unless an attribute with the same name or a block with the same type and labels is already there. Existing values are left unchanged, use ChangeValue to change them.
org. openrewrite. hcl. AddContentRequired
A JSONPath expression selecting the blocks to add content to. $ selects the top level of the file, e.g. of a .tfvars file. A path selecting an attribute whose value is an object, such as $.resource.aws_instance.tags, adds content to that object.
The HCL source of exactly one attribute, or of one block with its body.
Optional
If true, content is added as the first element instead of the last one.
mod run . --recipe= org. openrewrite. hcl. AddContent \
-P blockPath= '$. resource. aws_db_instance' \
-P content= 'publicly_accessible = false'Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.