diff --git a/content/master/concepts/patch-and-transform.md b/content/master/concepts/patch-and-transform.md index d0c6051f..89fce938 100644 --- a/content/master/concepts/patch-and-transform.md +++ b/content/master/concepts/patch-and-transform.md @@ -1541,6 +1541,7 @@ String transforms support the following * [Regexp](#regular-expression-type) * [TrimPrefix](#trim-prefix) * [TrimSuffix](#trim-suffix) +* [Replace](#replace) #### String convert @@ -1663,6 +1664,26 @@ patches: trim: `-north-1' ``` +#### Replace + +The {{}}type: Replace{{}} replaces all occurrences of the {{}}search{{}} string with the {{}}replace{{}} string. If `replace` is an empty string, then the `search` string is removed. + + +```yaml {label="typeReplace"} +patches: + - type: FromCompositeFieldPath + fromFieldPath: spec.location + toFieldPath: spec.forProvider.region + transforms: + - type: string + string: + type: Replace + replace: + search: "europe" + replace: "eu" +``` + + ## Patch policies Crossplane supports two types of patch policies: