A simple addition to your already well made attempt is all you need. Replace the
| with the update assignment and optionally group into parenthesis
(..). The part after
|= recreates the object from
. and assigns to the path on the LHS
.Statement |= ( .Principal.AWS as $orig | .Principal.AWS = [$orig] + ["foo", "bar"] ) # ^^^
CLICK HERE to find out more related problems solutions.