CINXE.COM
Function Patch and Transform · Crossplane v1.18
<!doctype html><html lang=en class=color-toggle-hidden color-theme=light><head><meta charset=utf-8><script type="text/javascript"> ;window.NREUM||(NREUM={});NREUM.init={distributed_tracing:{enabled:true},privacy:{cookies_enabled:true},ajax:{deny_list:["bam.nr-data.net"]}}; window.NREUM||(NREUM={}),__nr_require=function(t,e,n){function r(n){if(!e[n]){var o=e[n]={exports:{}};t[n][0].call(o.exports,function(e){var o=t[n][1][e];return r(o||e)},o,o.exports)}return e[n].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length;o++)r(n[o]);return r}({1:[function(t,e,n){function r(t){try{s.console&&console.log(t)}catch(e){}}var o,i=t("ee"),a=t(32),s={};try{o=localStorage.getItem("__nr_flags").split(","),console&&"function"==typeof console.log&&(s.console=!0,o.indexOf("dev")!==-1&&(s.dev=!0),o.indexOf("nr_dev")!==-1&&(s.nrDev=!0))}catch(c){}s.nrDev&&i.on("internal-error",function(t){r(t.stack)}),s.dev&&i.on("fn-err",function(t,e,n){r(n.stack)}),s.dev&&(r("NR AGENT IN DEVELOPMENT MODE"),r("flags: "+a(s,function(t,e){return t}).join(", ")))},{}],2:[function(t,e,n){function r(t,e,n,r,s){try{l?l-=1:o(s||new UncaughtException(t,e,n),!0)}catch(f){try{i("ierr",[f,c.now(),!0])}catch(d){}}return"function"==typeof u&&u.apply(this,a(arguments))}function UncaughtException(t,e,n){this.message=t||"Uncaught error with no additional information",this.sourceURL=e,this.line=n}function o(t,e){var n=e?null:c.now();i("err",[t,n])}var i=t("handle"),a=t(33),s=t("ee"),c=t("loader"),f=t("gos"),u=window.onerror,d=!1,p="nr@seenError";if(!c.disabled){var l=0;c.features.err=!0,t(1),window.onerror=r;try{throw new Error}catch(h){"stack"in h&&(t(14),t(13),"addEventListener"in window&&t(7),c.xhrWrappable&&t(15),d=!0)}s.on("fn-start",function(t,e,n){d&&(l+=1)}),s.on("fn-err",function(t,e,n){d&&!n[p]&&(f(n,p,function(){return!0}),this.thrown=!0,o(n))}),s.on("fn-end",function(){d&&!this.thrown&&l>0&&(l-=1)}),s.on("internal-error",function(t){i("ierr",[t,c.now(),!0])})}},{}],3:[function(t,e,n){var r=t("loader");r.disabled||(r.features.ins=!0)},{}],4:[function(t,e,n){function r(){U++,L=g.hash,this[u]=y.now()}function o(){U--,g.hash!==L&&i(0,!0);var t=y.now();this[h]=~~this[h]+t-this[u],this[d]=t}function i(t,e){E.emit("newURL",[""+g,e])}function a(t,e){t.on(e,function(){this[e]=y.now()})}var s="-start",c="-end",f="-body",u="fn"+s,d="fn"+c,p="cb"+s,l="cb"+c,h="jsTime",m="fetch",v="addEventListener",w=window,g=w.location,y=t("loader");if(w[v]&&y.xhrWrappable&&!y.disabled){var x=t(11),b=t(12),E=t(9),R=t(7),O=t(14),T=t(8),P=t(15),S=t(10),M=t("ee"),N=M.get("tracer"),C=t(23);t(17),y.features.spa=!0;var L,U=0;M.on(u,r),b.on(p,r),S.on(p,r),M.on(d,o),b.on(l,o),S.on(l,o),M.buffer([u,d,"xhr-resolved"]),R.buffer([u]),O.buffer(["setTimeout"+c,"clearTimeout"+s,u]),P.buffer([u,"new-xhr","send-xhr"+s]),T.buffer([m+s,m+"-done",m+f+s,m+f+c]),E.buffer(["newURL"]),x.buffer([u]),b.buffer(["propagate",p,l,"executor-err","resolve"+s]),N.buffer([u,"no-"+u]),S.buffer(["new-jsonp","cb-start","jsonp-error","jsonp-end"]),a(T,m+s),a(T,m+"-done"),a(S,"new-jsonp"),a(S,"jsonp-end"),a(S,"cb-start"),E.on("pushState-end",i),E.on("replaceState-end",i),w[v]("hashchange",i,C(!0)),w[v]("load",i,C(!0)),w[v]("popstate",function(){i(0,U>1)},C(!0))}},{}],5:[function(t,e,n){function r(){var t=new PerformanceObserver(function(t,e){var n=t.getEntries();s(v,[n])});try{t.observe({entryTypes:["resource"]})}catch(e){}}function o(t){if(s(v,[window.performance.getEntriesByType(w)]),window.performance["c"+p])try{window.performance[h](m,o,!1)}catch(t){}else try{window.performance[h]("webkit"+m,o,!1)}catch(t){}}function i(t){}if(window.performance&&window.performance.timing&&window.performance.getEntriesByType){var a=t("ee"),s=t("handle"),c=t(14),f=t(13),u=t(6),d=t(23),p="learResourceTimings",l="addEventListener",h="removeEventListener",m="resourcetimingbufferfull",v="bstResource",w="resource",g="-start",y="-end",x="fn"+g,b="fn"+y,E="bstTimer",R="pushState",O=t("loader");if(!O.disabled){O.features.stn=!0,t(9),"addEventListener"in window&&t(7);var T=NREUM.o.EV;a.on(x,function(t,e){var n=t[0];n instanceof T&&(this.bstStart=O.now())}),a.on(b,function(t,e){var n=t[0];n instanceof T&&s("bst",[n,e,this.bstStart,O.now()])}),c.on(x,function(t,e,n){this.bstStart=O.now(),this.bstType=n}),c.on(b,function(t,e){s(E,[e,this.bstStart,O.now(),this.bstType])}),f.on(x,function(){this.bstStart=O.now()}),f.on(b,function(t,e){s(E,[e,this.bstStart,O.now(),"requestAnimationFrame"])}),a.on(R+g,function(t){this.time=O.now(),this.startPath=location.pathname+location.hash}),a.on(R+y,function(t){s("bstHist",[location.pathname+location.hash,this.startPath,this.time])}),u()?(s(v,[window.performance.getEntriesByType("resource")]),r()):l in window.performance&&(window.performance["c"+p]?window.performance[l](m,o,d(!1)):window.performance[l]("webkit"+m,o,d(!1))),document[l]("scroll",i,d(!1)),document[l]("keypress",i,d(!1)),document[l]("click",i,d(!1))}}},{}],6:[function(t,e,n){e.exports=function(){return"PerformanceObserver"in window&&"function"==typeof window.PerformanceObserver}},{}],7:[function(t,e,n){function r(t){for(var e=t;e&&!e.hasOwnProperty(u);)e=Object.getPrototypeOf(e);e&&o(e)}function o(t){s.inPlace(t,[u,d],"-",i)}function i(t,e){return t[1]}var a=t("ee").get("events"),s=t("wrap-function")(a,!0),c=t("gos"),f=XMLHttpRequest,u="addEventListener",d="removeEventListener";e.exports=a,"getPrototypeOf"in Object?(r(document),r(window),r(f.prototype)):f.prototype.hasOwnProperty(u)&&(o(window),o(f.prototype)),a.on(u+"-start",function(t,e){var n=t[1];if(null!==n&&("function"==typeof n||"object"==typeof n)){var r=c(n,"nr@wrapped",function(){function t(){if("function"==typeof n.handleEvent)return n.handleEvent.apply(n,arguments)}var e={object:t,"function":n}[typeof n];return e?s(e,"fn-",null,e.name||"anonymous"):n});this.wrapped=t[1]=r}}),a.on(d+"-start",function(t){t[1]=this.wrapped||t[1]})},{}],8:[function(t,e,n){function r(t,e,n){var r=t[e];"function"==typeof r&&(t[e]=function(){var t=i(arguments),e={};o.emit(n+"before-start",[t],e);var a;e[m]&&e[m].dt&&(a=e[m].dt);var s=r.apply(this,t);return o.emit(n+"start",[t,a],s),s.then(function(t){return o.emit(n+"end",[null,t],s),t},function(t){throw o.emit(n+"end",[t],s),t})})}var o=t("ee").get("fetch"),i=t(33),a=t(32);e.exports=o;var s=window,c="fetch-",f=c+"body-",u=["arrayBuffer","blob","json","text","formData"],d=s.Request,p=s.Response,l=s.fetch,h="prototype",m="nr@context";d&&p&&l&&(a(u,function(t,e){r(d[h],e,f),r(p[h],e,f)}),r(s,"fetch",c),o.on(c+"end",function(t,e){var n=this;if(e){var r=e.headers.get("content-length");null!==r&&(n.rxSize=r),o.emit(c+"done",[null,e],n)}else o.emit(c+"done",[t],n)}))},{}],9:[function(t,e,n){var r=t("ee").get("history"),o=t("wrap-function")(r);e.exports=r;var i=window.history&&window.history.constructor&&window.history.constructor.prototype,a=window.history;i&&i.pushState&&i.replaceState&&(a=i),o.inPlace(a,["pushState","replaceState"],"-")},{}],10:[function(t,e,n){function r(t){function e(){f.emit("jsonp-end",[],l),t.removeEventListener("load",e,c(!1)),t.removeEventListener("error",n,c(!1))}function n(){f.emit("jsonp-error",[],l),f.emit("jsonp-end",[],l),t.removeEventListener("load",e,c(!1)),t.removeEventListener("error",n,c(!1))}var r=t&&"string"==typeof t.nodeName&&"script"===t.nodeName.toLowerCase();if(r){var o="function"==typeof t.addEventListener;if(o){var a=i(t.src);if(a){var d=s(a),p="function"==typeof d.parent[d.key];if(p){var l={};u.inPlace(d.parent,[d.key],"cb-",l),t.addEventListener("load",e,c(!1)),t.addEventListener("error",n,c(!1)),f.emit("new-jsonp",[t.src],l)}}}}}function o(){return"addEventListener"in window}function i(t){var e=t.match(d);return e?e[1]:null}function a(t,e){var n=t.match(l),r=n[1],o=n[3];return o?a(o,e[r]):e[r]}function s(t){var e=t.match(p);return e&&e.length>=3?{key:e[2],parent:a(e[1],window)}:{key:t,parent:window}}var c=t(23),f=t("ee").get("jsonp"),u=t("wrap-function")(f);if(e.exports=f,o()){var d=/[?&](?:callback|cb)=([^&#]+)/,p=/(.*)\.([^.]+)/,l=/^(\w+)(\.|$)(.*)$/,h=["appendChild","insertBefore","replaceChild"];Node&&Node.prototype&&Node.prototype.appendChild?u.inPlace(Node.prototype,h,"dom-"):(u.inPlace(HTMLElement.prototype,h,"dom-"),u.inPlace(HTMLHeadElement.prototype,h,"dom-"),u.inPlace(HTMLBodyElement.prototype,h,"dom-")),f.on("dom-start",function(t){r(t[0])})}},{}],11:[function(t,e,n){var r=t("ee").get("mutation"),o=t("wrap-function")(r),i=NREUM.o.MO;e.exports=r,i&&(window.MutationObserver=function(t){return this instanceof i?new i(o(t,"fn-")):i.apply(this,arguments)},MutationObserver.prototype=i.prototype)},{}],12:[function(t,e,n){function r(t){var e=i.context(),n=s(t,"executor-",e,null,!1),r=new f(n);return i.context(r).getCtx=function(){return e},r}var o=t("wrap-function"),i=t("ee").get("promise"),a=t("ee").getOrSetContext,s=o(i),c=t(32),f=NREUM.o.PR;e.exports=i,f&&(window.Promise=r,["all","race"].forEach(function(t){var e=f[t];f[t]=function(n){function r(t){return function(){i.emit("propagate",[null,!o],a,!1,!1),o=o||!t}}var o=!1;c(n,function(e,n){Promise.resolve(n).then(r("all"===t),r(!1))});var a=e.apply(f,arguments),s=f.resolve(a);return s}}),["resolve","reject"].forEach(function(t){var e=f[t];f[t]=function(t){var n=e.apply(f,arguments);return t!==n&&i.emit("propagate",[t,!0],n,!1,!1),n}}),f.prototype["catch"]=function(t){return this.then(null,t)},f.prototype=Object.create(f.prototype,{constructor:{value:r}}),c(Object.getOwnPropertyNames(f),function(t,e){try{r[e]=f[e]}catch(n){}}),o.wrapInPlace(f.prototype,"then",function(t){return function(){var e=this,n=o.argsToArray.apply(this,arguments),r=a(e);r.promise=e,n[0]=s(n[0],"cb-",r,null,!1),n[1]=s(n[1],"cb-",r,null,!1);var c=t.apply(this,n);return r.nextPromise=c,i.emit("propagate",[e,!0],c,!1,!1),c}}),i.on("executor-start",function(t){t[0]=s(t[0],"resolve-",this,null,!1),t[1]=s(t[1],"resolve-",this,null,!1)}),i.on("executor-err",function(t,e,n){t[1](n)}),i.on("cb-end",function(t,e,n){i.emit("propagate",[n,!0],this.nextPromise,!1,!1)}),i.on("propagate",function(t,e,n){this.getCtx&&!e||(this.getCtx=function(){if(t instanceof Promise)var e=i.context(t);return e&&e.getCtx?e.getCtx():this})}),r.toString=function(){return""+f})},{}],13:[function(t,e,n){var r=t("ee").get("raf"),o=t("wrap-function")(r),i="equestAnimationFrame";e.exports=r,o.inPlace(window,["r"+i,"mozR"+i,"webkitR"+i,"msR"+i],"raf-"),r.on("raf-start",function(t){t[0]=o(t[0],"fn-")})},{}],14:[function(t,e,n){function r(t,e,n){t[0]=a(t[0],"fn-",null,n)}function o(t,e,n){this.method=n,this.timerDuration=isNaN(t[1])?0:+t[1],t[0]=a(t[0],"fn-",this,n)}var i=t("ee").get("timer"),a=t("wrap-function")(i),s="setTimeout",c="setInterval",f="clearTimeout",u="-start",d="-";e.exports=i,a.inPlace(window,[s,"setImmediate"],s+d),a.inPlace(window,[c],c+d),a.inPlace(window,[f,"clearImmediate"],f+d),i.on(c+u,r),i.on(s+u,o)},{}],15:[function(t,e,n){function r(t,e){d.inPlace(e,["onreadystatechange"],"fn-",s)}function o(){var t=this,e=u.context(t);t.readyState>3&&!e.resolved&&(e.resolved=!0,u.emit("xhr-resolved",[],t)),d.inPlace(t,y,"fn-",s)}function i(t){x.push(t),m&&(E?E.then(a):w?w(a):(R=-R,O.data=R))}function a(){for(var t=0;t<x.length;t++)r([],x[t]);x.length&&(x=[])}function s(t,e){return e}function c(t,e){for(var n in t)e[n]=t[n];return e}t(7);var f=t("ee"),u=f.get("xhr"),d=t("wrap-function")(u),p=t(23),l=NREUM.o,h=l.XHR,m=l.MO,v=l.PR,w=l.SI,g="readystatechange",y=["onload","onerror","onabort","onloadstart","onloadend","onprogress","ontimeout"],x=[];e.exports=u;var b=window.XMLHttpRequest=function(t){var e=new h(t);try{u.emit("new-xhr",[e],e),e.addEventListener(g,o,p(!1))}catch(n){try{u.emit("internal-error",[n])}catch(r){}}return e};if(c(h,b),b.prototype=h.prototype,d.inPlace(b.prototype,["open","send"],"-xhr-",s),u.on("send-xhr-start",function(t,e){r(t,e),i(e)}),u.on("open-xhr-start",r),m){var E=v&&v.resolve();if(!w&&!v){var R=1,O=document.createTextNode(R);new m(a).observe(O,{characterData:!0})}}else f.on("fn-end",function(t){t[0]&&t[0].type===g||a()})},{}],16:[function(t,e,n){function r(t){if(!s(t))return null;var e=window.NREUM;if(!e.loader_config)return null;var n=(e.loader_config.accountID||"").toString()||null,r=(e.loader_config.agentID||"").toString()||null,f=(e.loader_config.trustKey||"").toString()||null;if(!n||!r)return null;var h=l.generateSpanId(),m=l.generateTraceId(),v=Date.now(),w={spanId:h,traceId:m,timestamp:v};return(t.sameOrigin||c(t)&&p())&&(w.traceContextParentHeader=o(h,m),w.traceContextStateHeader=i(h,v,n,r,f)),(t.sameOrigin&&!u()||!t.sameOrigin&&c(t)&&d())&&(w.newrelicHeader=a(h,m,v,n,r,f)),w}function o(t,e){return"00-"+e+"-"+t+"-01"}function i(t,e,n,r,o){var i=0,a="",s=1,c="",f="";return o+"@nr="+i+"-"+s+"-"+n+"-"+r+"-"+t+"-"+a+"-"+c+"-"+f+"-"+e}function a(t,e,n,r,o,i){var a="btoa"in window&&"function"==typeof window.btoa;if(!a)return null;var s={v:[0,1],d:{ty:"Browser",ac:r,ap:o,id:t,tr:e,ti:n}};return i&&r!==i&&(s.d.tk=i),btoa(JSON.stringify(s))}function s(t){return f()&&c(t)}function c(t){var e=!1,n={};if("init"in NREUM&&"distributed_tracing"in NREUM.init&&(n=NREUM.init.distributed_tracing),t.sameOrigin)e=!0;else if(n.allowed_origins instanceof Array)for(var r=0;r<n.allowed_origins.length;r++){var o=h(n.allowed_origins[r]);if(t.hostname===o.hostname&&t.protocol===o.protocol&&t.port===o.port){e=!0;break}}return e}function f(){return"init"in NREUM&&"distributed_tracing"in NREUM.init&&!!NREUM.init.distributed_tracing.enabled}function u(){return"init"in NREUM&&"distributed_tracing"in NREUM.init&&!!NREUM.init.distributed_tracing.exclude_newrelic_header}function d(){return"init"in NREUM&&"distributed_tracing"in NREUM.init&&NREUM.init.distributed_tracing.cors_use_newrelic_header!==!1}function p(){return"init"in NREUM&&"distributed_tracing"in NREUM.init&&!!NREUM.init.distributed_tracing.cors_use_tracecontext_headers}var l=t(29),h=t(18);e.exports={generateTracePayload:r,shouldGenerateTrace:s}},{}],17:[function(t,e,n){function r(t){var e=this.params,n=this.metrics;if(!this.ended){this.ended=!0;for(var r=0;r<p;r++)t.removeEventListener(d[r],this.listener,!1);e.aborted||(n.duration=a.now()-this.startTime,this.loadCaptureCalled||4!==t.readyState?null==e.status&&(e.status=0):i(this,t),n.cbTime=this.cbTime,s("xhr",[e,n,this.startTime,this.endTime,"xhr"],this))}}function o(t,e){var n=c(e),r=t.params;r.hostname=n.hostname,r.port=n.port,r.protocol=n.protocol,r.host=n.hostname+":"+n.port,r.pathname=n.pathname,t.parsedOrigin=n,t.sameOrigin=n.sameOrigin}function i(t,e){t.params.status=e.status;var n=v(e,t.lastSize);if(n&&(t.metrics.rxSize=n),t.sameOrigin){var r=e.getResponseHeader("X-NewRelic-App-Data");r&&(t.params.cat=r.split(", ").pop())}t.loadCaptureCalled=!0}var a=t("loader");if(a.xhrWrappable&&!a.disabled){var s=t("handle"),c=t(18),f=t(16).generateTracePayload,u=t("ee"),d=["load","error","abort","timeout"],p=d.length,l=t("id"),h=t(24),m=t(22),v=t(19),w=t(23),g=NREUM.o.REQ,y=window.XMLHttpRequest;a.features.xhr=!0,t(15),t(8),u.on("new-xhr",function(t){var e=this;e.totalCbs=0,e.called=0,e.cbTime=0,e.end=r,e.ended=!1,e.xhrGuids={},e.lastSize=null,e.loadCaptureCalled=!1,e.params=this.params||{},e.metrics=this.metrics||{},t.addEventListener("load",function(n){i(e,t)},w(!1)),h&&(h>34||h<10)||t.addEventListener("progress",function(t){e.lastSize=t.loaded},w(!1))}),u.on("open-xhr-start",function(t){this.params={method:t[0]},o(this,t[1]),this.metrics={}}),u.on("open-xhr-end",function(t,e){"loader_config"in NREUM&&"xpid"in NREUM.loader_config&&this.sameOrigin&&e.setRequestHeader("X-NewRelic-ID",NREUM.loader_config.xpid);var n=f(this.parsedOrigin);if(n){var r=!1;n.newrelicHeader&&(e.setRequestHeader("newrelic",n.newrelicHeader),r=!0),n.traceContextParentHeader&&(e.setRequestHeader("traceparent",n.traceContextParentHeader),n.traceContextStateHeader&&e.setRequestHeader("tracestate",n.traceContextStateHeader),r=!0),r&&(this.dt=n)}}),u.on("send-xhr-start",function(t,e){var n=this.metrics,r=t[0],o=this;if(n&&r){var i=m(r);i&&(n.txSize=i)}this.startTime=a.now(),this.listener=function(t){try{"abort"!==t.type||o.loadCaptureCalled||(o.params.aborted=!0),("load"!==t.type||o.called===o.totalCbs&&(o.onloadCalled||"function"!=typeof e.onload))&&o.end(e)}catch(n){try{u.emit("internal-error",[n])}catch(r){}}};for(var s=0;s<p;s++)e.addEventListener(d[s],this.listener,w(!1))}),u.on("xhr-cb-time",function(t,e,n){this.cbTime+=t,e?this.onloadCalled=!0:this.called+=1,this.called!==this.totalCbs||!this.onloadCalled&&"function"==typeof n.onload||this.end(n)}),u.on("xhr-load-added",function(t,e){var n=""+l(t)+!!e;this.xhrGuids&&!this.xhrGuids[n]&&(this.xhrGuids[n]=!0,this.totalCbs+=1)}),u.on("xhr-load-removed",function(t,e){var n=""+l(t)+!!e;this.xhrGuids&&this.xhrGuids[n]&&(delete this.xhrGuids[n],this.totalCbs-=1)}),u.on("xhr-resolved",function(){this.endTime=a.now()}),u.on("addEventListener-end",function(t,e){e instanceof y&&"load"===t[0]&&u.emit("xhr-load-added",[t[1],t[2]],e)}),u.on("removeEventListener-end",function(t,e){e instanceof y&&"load"===t[0]&&u.emit("xhr-load-removed",[t[1],t[2]],e)}),u.on("fn-start",function(t,e,n){e instanceof y&&("onload"===n&&(this.onload=!0),("load"===(t[0]&&t[0].type)||this.onload)&&(this.xhrCbStart=a.now()))}),u.on("fn-end",function(t,e){this.xhrCbStart&&u.emit("xhr-cb-time",[a.now()-this.xhrCbStart,this.onload,e],e)}),u.on("fetch-before-start",function(t){function e(t,e){var n=!1;return e.newrelicHeader&&(t.set("newrelic",e.newrelicHeader),n=!0),e.traceContextParentHeader&&(t.set("traceparent",e.traceContextParentHeader),e.traceContextStateHeader&&t.set("tracestate",e.traceContextStateHeader),n=!0),n}var n,r=t[1]||{};"string"==typeof t[0]?n=t[0]:t[0]&&t[0].url?n=t[0].url:window.URL&&t[0]&&t[0]instanceof URL&&(n=t[0].href),n&&(this.parsedOrigin=c(n),this.sameOrigin=this.parsedOrigin.sameOrigin);var o=f(this.parsedOrigin);if(o&&(o.newrelicHeader||o.traceContextParentHeader))if("string"==typeof t[0]||window.URL&&t[0]&&t[0]instanceof URL){var i={};for(var a in r)i[a]=r[a];i.headers=new Headers(r.headers||{}),e(i.headers,o)&&(this.dt=o),t.length>1?t[1]=i:t.push(i)}else t[0]&&t[0].headers&&e(t[0].headers,o)&&(this.dt=o)}),u.on("fetch-start",function(t,e){this.params={},this.metrics={},this.startTime=a.now(),this.dt=e,t.length>=1&&(this.target=t[0]),t.length>=2&&(this.opts=t[1]);var n,r=this.opts||{},i=this.target;"string"==typeof i?n=i:"object"==typeof i&&i instanceof g?n=i.url:window.URL&&"object"==typeof i&&i instanceof URL&&(n=i.href),o(this,n);var s=(""+(i&&i instanceof g&&i.method||r.method||"GET")).toUpperCase();this.params.method=s,this.txSize=m(r.body)||0}),u.on("fetch-done",function(t,e){this.endTime=a.now(),this.params||(this.params={}),this.params.status=e?e.status:0;var n;"string"==typeof this.rxSize&&this.rxSize.length>0&&(n=+this.rxSize);var r={txSize:this.txSize,rxSize:n,duration:a.now()-this.startTime};s("xhr",[this.params,r,this.startTime,this.endTime,"fetch"],this)})}},{}],18:[function(t,e,n){var r={};e.exports=function(t){if(t in r)return r[t];var e=document.createElement("a"),n=window.location,o={};e.href=t,o.port=e.port;var i=e.href.split("://");!o.port&&i[1]&&(o.port=i[1].split("/")[0].split("@").pop().split(":")[1]),o.port&&"0"!==o.port||(o.port="https"===i[0]?"443":"80"),o.hostname=e.hostname||n.hostname,o.pathname=e.pathname,o.protocol=i[0],"/"!==o.pathname.charAt(0)&&(o.pathname="/"+o.pathname);var a=!e.protocol||":"===e.protocol||e.protocol===n.protocol,s=e.hostname===document.domain&&e.port===n.port;return o.sameOrigin=a&&(!e.hostname||s),"/"===o.pathname&&(r[t]=o),o}},{}],19:[function(t,e,n){function r(t,e){var n=t.responseType;return"json"===n&&null!==e?e:"arraybuffer"===n||"blob"===n||"json"===n?o(t.response):"text"===n||""===n||void 0===n?o(t.responseText):void 0}var o=t(22);e.exports=r},{}],20:[function(t,e,n){function r(){}function o(t,e,n,r){return function(){return u.recordSupportability("API/"+e+"/called"),i(t+e,[f.now()].concat(s(arguments)),n?null:this,r),n?void 0:this}}var i=t("handle"),a=t(32),s=t(33),c=t("ee").get("tracer"),f=t("loader"),u=t(25),d=NREUM;"undefined"==typeof window.newrelic&&(newrelic=d);var p=["setPageViewName","setCustomAttribute","setErrorHandler","finished","addToTrace","inlineHit","addRelease"],l="api-",h=l+"ixn-";a(p,function(t,e){d[e]=o(l,e,!0,"api")}),d.addPageAction=o(l,"addPageAction",!0),d.setCurrentRouteName=o(l,"routeName",!0),e.exports=newrelic,d.interaction=function(){return(new r).get()};var m=r.prototype={createTracer:function(t,e){var n={},r=this,o="function"==typeof e;return i(h+"tracer",[f.now(),t,n],r),function(){if(c.emit((o?"":"no-")+"fn-start",[f.now(),r,o],n),o)try{return e.apply(this,arguments)}catch(t){throw c.emit("fn-err",[arguments,this,t],n),t}finally{c.emit("fn-end",[f.now()],n)}}}};a("actionText,setName,setAttribute,save,ignore,onEnd,getContext,end,get".split(","),function(t,e){m[e]=o(h,e)}),newrelic.noticeError=function(t,e){"string"==typeof t&&(t=new Error(t)),u.recordSupportability("API/noticeError/called"),i("err",[t,f.now(),!1,e])}},{}],21:[function(t,e,n){function r(t){if(NREUM.init){for(var e=NREUM.init,n=t.split("."),r=0;r<n.length-1;r++)if(e=e[n[r]],"object"!=typeof e)return;return e=e[n[n.length-1]]}}e.exports={getConfiguration:r}},{}],22:[function(t,e,n){e.exports=function(t){if("string"==typeof t&&t.length)return t.length;if("object"==typeof t){if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer&&t.byteLength)return t.byteLength;if("undefined"!=typeof Blob&&t instanceof Blob&&t.size)return t.size;if(!("undefined"!=typeof FormData&&t instanceof FormData))try{return JSON.stringify(t).length}catch(e){return}}}},{}],23:[function(t,e,n){var r=!1;try{var o=Object.defineProperty({},"passive",{get:function(){r=!0}});window.addEventListener("testPassive",null,o),window.removeEventListener("testPassive",null,o)}catch(i){}e.exports=function(t){return r?{passive:!0,capture:!!t}:!!t}},{}],24:[function(t,e,n){var r=0,o=navigator.userAgent.match(/Firefox[\/\s](\d+\.\d+)/);o&&(r=+o[1]),e.exports=r},{}],25:[function(t,e,n){function r(t,e){var n=[a,t,{name:t},e];return i("storeMetric",n,null,"api"),n}function o(t,e){var n=[s,t,{name:t},e];return i("storeEventMetrics",n,null,"api"),n}var i=t("handle"),a="sm",s="cm";e.exports={constants:{SUPPORTABILITY_METRIC:a,CUSTOM_METRIC:s},recordSupportability:r,recordCustom:o}},{}],26:[function(t,e,n){function r(){return s.exists&&performance.now?Math.round(performance.now()):(i=Math.max((new Date).getTime(),i))-a}function o(){return i}var i=(new Date).getTime(),a=i,s=t(34);e.exports=r,e.exports.offset=a,e.exports.getLastTimestamp=o},{}],27:[function(t,e,n){function r(t){return!(!t||!t.protocol||"file:"===t.protocol)}e.exports=r},{}],28:[function(t,e,n){function r(t,e){var n=t.getEntries();n.forEach(function(t){"first-paint"===t.name?p("timing",["fp",Math.floor(t.startTime)]):"first-contentful-paint"===t.name&&p("timing",["fcp",Math.floor(t.startTime)])})}function o(t,e){var n=t.getEntries();if(n.length>0){var r=n[n.length-1];if(c&&c<r.startTime)return;p("lcp",[r])}}function i(t){t.getEntries().forEach(function(t){t.hadRecentInput||p("cls",[t])})}function a(t){if(t instanceof v&&!g){var e=Math.round(t.timeStamp),n={type:t.type};e<=l.now()?n.fid=l.now()-e:e>l.offset&&e<=Date.now()?(e-=l.offset,n.fid=l.now()-e):e=l.now(),g=!0,p("timing",["fi",e,n])}}function s(t){"hidden"===t&&(c=l.now(),p("pageHide",[c]))}if(!("init"in NREUM&&"page_view_timing"in NREUM.init&&"enabled"in NREUM.init.page_view_timing&&NREUM.init.page_view_timing.enabled===!1)){var c,f,u,d,p=t("handle"),l=t("loader"),h=t(31),m=t(23),v=NREUM.o.EV;if("PerformanceObserver"in window&&"function"==typeof window.PerformanceObserver){f=new PerformanceObserver(r);try{f.observe({entryTypes:["paint"]})}catch(w){}u=new PerformanceObserver(o);try{u.observe({entryTypes:["largest-contentful-paint"]})}catch(w){}d=new PerformanceObserver(i);try{d.observe({type:"layout-shift",buffered:!0})}catch(w){}}if("addEventListener"in document){var g=!1,y=["click","keydown","mousedown","pointerdown","touchstart"];y.forEach(function(t){document.addEventListener(t,a,m(!1))})}h(s)}},{}],29:[function(t,e,n){function r(){function t(){return e?15&e[n++]:16*Math.random()|0}var e=null,n=0,r=window.crypto||window.msCrypto;r&&r.getRandomValues&&(e=r.getRandomValues(new Uint8Array(31)));for(var o,i="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",a="",s=0;s<i.length;s++)o=i[s],"x"===o?a+=t().toString(16):"y"===o?(o=3&t()|8,a+=o.toString(16)):a+=o;return a}function o(){return a(16)}function i(){return a(32)}function a(t){function e(){return n?15&n[r++]:16*Math.random()|0}var n=null,r=0,o=window.crypto||window.msCrypto;o&&o.getRandomValues&&Uint8Array&&(n=o.getRandomValues(new Uint8Array(31)));for(var i=[],a=0;a<t;a++)i.push(e().toString(16));return i.join("")}e.exports={generateUuid:r,generateSpanId:o,generateTraceId:i}},{}],30:[function(t,e,n){function r(t,e){if(!o)return!1;if(t!==o)return!1;if(!e)return!0;if(!i)return!1;for(var n=i.split("."),r=e.split("."),a=0;a<r.length;a++)if(r[a]!==n[a])return!1;return!0}var o=null,i=null,a=/Version\/(\S+)\s+Safari/;if(navigator.userAgent){var s=navigator.userAgent,c=s.match(a);c&&s.indexOf("Chrome")===-1&&s.indexOf("Chromium")===-1&&(o="Safari",i=c[1])}e.exports={agent:o,version:i,match:r}},{}],31:[function(t,e,n){function r(t){function e(){t(s&&document[s]?document[s]:document[i]?"hidden":"visible")}"addEventListener"in document&&a&&document.addEventListener(a,e,o(!1))}var o=t(23);e.exports=r;var i,a,s;"undefined"!=typeof document.hidden?(i="hidden",a="visibilitychange",s="visibilityState"):"undefined"!=typeof document.msHidden?(i="msHidden",a="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(i="webkitHidden",a="webkitvisibilitychange",s="webkitVisibilityState")},{}],32:[function(t,e,n){function r(t,e){var n=[],r="",i=0;for(r in t)o.call(t,r)&&(n[i]=e(r,t[r]),i+=1);return n}var o=Object.prototype.hasOwnProperty;e.exports=r},{}],33:[function(t,e,n){function r(t,e,n){e||(e=0),"undefined"==typeof n&&(n=t?t.length:0);for(var r=-1,o=n-e||0,i=Array(o<0?0:o);++r<o;)i[r]=t[e+r];return i}e.exports=r},{}],34:[function(t,e,n){e.exports={exists:"undefined"!=typeof window.performance&&window.performance.timing&&"undefined"!=typeof window.performance.timing.navigationStart}},{}],ee:[function(t,e,n){function r(){}function o(t){function e(t){return t&&t instanceof r?t:t?f(t,c,a):a()}function n(n,r,o,i,a){if(a!==!1&&(a=!0),!l.aborted||i){t&&a&&t(n,r,o);for(var s=e(o),c=m(n),f=c.length,u=0;u<f;u++)c[u].apply(s,r);var p=d[y[n]];return p&&p.push([x,n,r,s]),s}}function i(t,e){g[t]=m(t).concat(e)}function h(t,e){var n=g[t];if(n)for(var r=0;r<n.length;r++)n[r]===e&&n.splice(r,1)}function m(t){return g[t]||[]}function v(t){return p[t]=p[t]||o(n)}function w(t,e){l.aborted||u(t,function(t,n){e=e||"feature",y[n]=e,e in d||(d[e]=[])})}var g={},y={},x={on:i,addEventListener:i,removeEventListener:h,emit:n,get:v,listeners:m,context:e,buffer:w,abort:s,aborted:!1};return x}function i(t){return f(t,c,a)}function a(){return new r}function s(){(d.api||d.feature)&&(l.aborted=!0,d=l.backlog={})}var c="nr@context",f=t("gos"),u=t(32),d={},p={},l=e.exports=o();e.exports.getOrSetContext=i,l.backlog=d},{}],gos:[function(t,e,n){function r(t,e,n){if(o.call(t,e))return t[e];var r=n();if(Object.defineProperty&&Object.keys)try{return Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!1}),r}catch(i){}return t[e]=r,r}var o=Object.prototype.hasOwnProperty;e.exports=r},{}],handle:[function(t,e,n){function r(t,e,n,r){o.buffer([t],r),o.emit(t,e,n)}var o=t("ee").get("handle");e.exports=r,r.ee=o},{}],id:[function(t,e,n){function r(t){var e=typeof t;return!t||"object"!==e&&"function"!==e?-1:t===window?0:a(t,i,function(){return o++})}var o=1,i="nr@id",a=t("gos");e.exports=r},{}],loader:[function(t,e,n){function r(){if(!P++){var t=T.info=NREUM.info,e=v.getElementsByTagName("script")[0];if(setTimeout(f.abort,3e4),!(t&&t.licenseKey&&t.applicationID&&e))return f.abort();c(R,function(e,n){t[e]||(t[e]=n)});var n=a();s("mark",["onload",n+T.offset],null,"api"),s("timing",["load",n]);var r=v.createElement("script");0===t.agent.indexOf("http://")||0===t.agent.indexOf("https://")?r.src=t.agent:r.src=h+"://"+t.agent,e.parentNode.insertBefore(r,e)}}function o(){"complete"===v.readyState&&i()}function i(){s("mark",["domContent",a()+T.offset],null,"api")}var a=t(26),s=t("handle"),c=t(32),f=t("ee"),u=t(30),d=t(27),p=t(21),l=t(23),h=p.getConfiguration("ssl")===!1?"http":"https",m=window,v=m.document,w="addEventListener",g="attachEvent",y=m.XMLHttpRequest,x=y&&y.prototype,b=!d(m.location);NREUM.o={ST:setTimeout,SI:m.setImmediate,CT:clearTimeout,XHR:y,REQ:m.Request,EV:m.Event,PR:m.Promise,MO:m.MutationObserver};var E=""+location,R={beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net",agent:"js-agent.newrelic.com/nr-spa-1212.min.js"},O=y&&x&&x[w]&&!/CriOS/.test(navigator.userAgent),T=e.exports={offset:a.getLastTimestamp(),now:a,origin:E,features:{},xhrWrappable:O,userAgent:u,disabled:b};if(!b){t(20),t(28),v[w]?(v[w]("DOMContentLoaded",i,l(!1)),m[w]("load",r,l(!1))):(v[g]("onreadystatechange",o),m[g]("onload",r)),s("mark",["firstbyte",a.getLastTimestamp()],null,"api");var P=0}},{}],"wrap-function":[function(t,e,n){function r(t,e){function n(e,n,r,c,f){function nrWrapper(){var i,a,u,p;try{a=this,i=d(arguments),u="function"==typeof r?r(i,a):r||{}}catch(l){o([l,"",[i,a,c],u],t)}s(n+"start",[i,a,c],u,f);try{return p=e.apply(a,i)}catch(h){throw s(n+"err",[i,a,h],u,f),h}finally{s(n+"end",[i,a,p],u,f)}}return a(e)?e:(n||(n=""),nrWrapper[p]=e,i(e,nrWrapper,t),nrWrapper)}function r(t,e,r,o,i){r||(r="");var s,c,f,u="-"===r.charAt(0);for(f=0;f<e.length;f++)c=e[f],s=t[c],a(s)||(t[c]=n(s,u?c+r:r,o,c,i))}function s(n,r,i,a){if(!h||e){var s=h;h=!0;try{t.emit(n,r,i,e,a)}catch(c){o([c,n,r,i],t)}h=s}}return t||(t=u),n.inPlace=r,n.flag=p,n}function o(t,e){e||(e=u);try{e.emit("internal-error",t)}catch(n){}}function i(t,e,n){if(Object.defineProperty&&Object.keys)try{var r=Object.keys(t);return r.forEach(function(n){Object.defineProperty(e,n,{get:function(){return t[n]},set:function(e){return t[n]=e,e}})}),e}catch(i){o([i],n)}for(var a in t)l.call(t,a)&&(e[a]=t[a]);return e}function a(t){return!(t&&t instanceof Function&&t.apply&&!t[p])}function s(t,e){var n=e(t);return n[p]=t,i(t,n,u),n}function c(t,e,n){var r=t[e];t[e]=s(r,n)}function f(){for(var t=arguments.length,e=new Array(t),n=0;n<t;++n)e[n]=arguments[n];return e}var u=t("ee"),d=t(33),p="nr@original",l=Object.prototype.hasOwnProperty,h=!1;e.exports=r,e.exports.wrapFunction=s,e.exports.wrapInPlace=c,e.exports.argsToArray=f},{}]},{},["loader",2,17,5,3,4]); ;NREUM.loader_config={accountID:"3768898",trustKey:"3768898",agentID:"1134285132",licenseKey:"NRJS-2bc9f9fb1efc463f27c",applicationID:"1134285132"} ;NREUM.info={beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net",licenseKey:"NRJS-2bc9f9fb1efc463f27c",applicationID:"1134285132",sa:1} newrelic.addRelease("", "Remove-ControllerConfig-r-production-4dd74f6-17d951-17d94f"); </script><meta name=viewport content="width=device-width,initial-scale=1"><meta name=author content="Crossplane Community"><meta name=color-scheme content="light dark"><meta name=docsearch:language content="en"><meta name=generator content="Hugo 0.119.0"><link rel=preload href=/fonts/Avenir-Roman.woff2 as=font type=font/woff2 crossorigin><meta property="og:image" content="/img/crossplane-logo-og.webp"><meta property="twitter:card" content="/img/crossplane-logo-og.webp"><meta property="og:image:width" content="600"><meta property="og:image:height" content="199"><meta property="og:image:alt" content="Crossplane name and popsicle logo"><meta property="twitter:image:alt" content="Crossplane name and popsicle logo"><meta property="og:type" content="website"><meta name=twitter:site content="@crossplane_io"><meta property="og:site_name" content="Crossplane Documentation"><meta name=description content="A function that use patches and transforms to modify inputs from claims and composite resources before creating managed resources"><meta property="og:url" content="https://docs.crossplane.io/v1.18/guides/function-patch-and-transform/"><meta name=docsearch:modified content="November 14, 2024"><meta name=docsearch:version content="1.18"><title>Function Patch and Transform · Crossplane v1.18</title><link rel=canonical href=https://docs.crossplane.io/latest/guides/function-patch-and-transform/><script>(()=>{var e=window.matchMedia("(prefers-color-scheme: dark)").matches,t=localStorage.getItem("darkSwitch")!==null&&localStorage.getItem("darkSwitch")==="dark",n=localStorage.getItem("darkSwitch")!==null&&localStorage.getItem("darkSwitch")==="light";n&&(e=!1),t||e?document.documentElement.setAttribute("color-theme","dark"):document.documentElement.setAttribute("color-theme","light")})()</script><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@docsearch/css@3 media=print onload='this.media="all"'><link rel=preconnect href=https://9UXKYX61NK-dsn.algolia.net crossorigin data-proofer-ignore><link href="https://docs.crossplane.io/scss/docs.0346bfd4a8aeace526724de64ddada78a0e5122b3b0c83b1021770d6ddef1160.css" rel=stylesheet><link rel=apple-touch-icon sizes=180x180 href=/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/favicon-32x32.png><link rel=icon type=image/png sizes=192x192 href=/android-chrome-192x192.png><link rel=icon type=image/png sizes=16x16 href=/favicon-16x16.png><link rel=manifest href=/site.webmanifest><link rel=mask-icon href=/safari-pinned-tab.svg color=#f87c44><meta name=apple-mobile-web-app-title content="Crossplane Docs"><meta name=application-name content="Crossplane Docs"><meta name=msapplication-TileColor content="#333f5b"><meta name=theme-color content="#ffffff"><meta property="og:title" content="Crossplane Docs · v1.18 · Function Patch and Transform"><meta property="og:description" content="Function Patch and Transform allows you to write a Composition that specifies managed resource (MR) templates, and uses “patch and transform” operations to fill them out. Crossplane fills …"></head><body><svg xmlns="http://www.w3.org/2000/svg" style="display:none"><symbol id="check2" viewBox="0 0 16 16"><path d="M13.854 3.646a.5.5.0 010 .708l-7 7a.5.5.0 01-.708.0l-3.5-3.5a.5.5.0 11.708-.708L6.5 10.293l6.646-6.647a.5.5.0 01.708.0z"/></symbol><symbol id="x" viewBox="0 0 16 16"><path d="M2.146 2.854a.5.5.0 11.708-.708L8 7.293l5.146-5.147a.5.5.0 01.708.708L8.707 8l5.147 5.146a.5.5.0 01-.708.708L8 8.707l-5.146 5.147a.5.5.0 01-.708-.708L7.293 8 2.146 2.854z"/></symbol><symbol id="chevron-expand" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M3.646 9.146a.5.5.0 01.708.0L8 12.793l3.646-3.647a.5.5.0 01.708.708l-4 4a.5.5.0 01-.708.0l-4-4a.5.5.0 010-.708zm0-2.292a.5.5.0 00.708.0L8 3.207l3.646 3.647a.5.5.0 00.708-.708l-4-4a.5.5.0 00-.708.0l-4 4a.5.5.0 000 .708z"/></symbol><symbol id="clipboard" viewBox="0 0 16 16"><path d="M4 1.5H3a2 2 0 00-2 2V14a2 2 0 002 2h10a2 2 0 002-2V3.5a2 2 0 00-2-2h-1v1h1a1 1 0 011 1V14a1 1 0 01-1 1H3a1 1 0 01-1-1V3.5a1 1 0 011-1h1v-1z"/><path d="M9.5 1a.5.5.0 01.5.5v1a.5.5.0 01-.5.5h-3A.5.5.0 016 2.5v-1a.5.5.0 01.5-.5h3zm-3-1A1.5 1.5.0 005 1.5v1A1.5 1.5.0 006.5 4h3A1.5 1.5.0 0011 2.5v-1A1.5 1.5.0 009.5.0h-3z"/></symbol><symbol id="plus" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8 2a.5.5.0 01.5.5v5h5a.5.5.0 010 1h-5v5a.5.5.0 01-1 0v-5h-5a.5.5.0 010-1h5v-5A.5.5.0 018 2z"/></symbol><symbol id="three-dots" viewBox="0 0 16 16"><path d="M3 9.5a1.5 1.5.0 110-3 1.5 1.5.0 010 3zm5 0a1.5 1.5.0 110-3 1.5 1.5.0 010 3zm5 0a1.5 1.5.0 110-3 1.5 1.5.0 010 3z"/></symbol><symbol id="info" viewBox="0 0 16 16"><path d="M8 15A7 7 0 118 1a7 7 0 010 14zm0 1A8 8 0 108 0a8 8 0 000 16z"/><path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545.0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275.0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 11-2 0 1 1 0 012 0z"/></symbol><symbol id="check" viewBox="0 0 16 16"><path d="M8 15A7 7 0 118 1a7 7 0 010 14zm0 1A8 8 0 108 0a8 8 0 000 16z"/><path d="M10.97 4.97a.235.235.0 00-.02.022L7.477 9.417 5.384 7.323a.75.75.0 00-1.06 1.06L6.97 11.03a.75.75.0 001.079-.02l3.992-4.99A.75.75.0 0010.97 4.97z"/></symbol><symbol id="exclamation" viewBox="0 0 16 16"><path d="M8 15A7 7 0 118 1a7 7 0 010 14zm0 1A8 8 0 108 0a8 8 0 000 16z"/><path d="M7.002 11a1 1 0 112 0 1 1 0 01-2 0zM7.1 4.995a.905.905.0 111.8.0l-.35 3.507a.552.552.0 01-1.1.0L7.1 4.995z"/></symbol><symbol id="x-circle" viewBox="0 0 16 16"><path d="M8 15A7 7 0 118 1a7 7 0 010 14zm0 1A8 8 0 108 0a8 8 0 000 16z"/><path d="M4.646 4.646a.5.5.0 01.708.0L8 7.293l2.646-2.647a.5.5.0 01.708.708L8.707 8l2.647 2.646a.5.5.0 01-.708.708L8 8.707l-2.646 2.647a.5.5.0 01-.708-.708L7.293 8 4.646 5.354a.5.5.0 010-.708z"/></symbol><symbol id="fire" viewBox="0 0 16 16"><path d="M8 16c3.314.0 6-2 6-5.5.0-1.5-.5-4-2.5-6 .25 1.5-1.25 2-1.25 2C11 4 9 .5 6 0c.357 2 .5 4-2 6-1.25 1-2 2.729-2 4.5C2 14 4.686 16 8 16zm0-1c-1.657.0-3-1-3-2.75.0-.75.25-2 1.25-3C6.125 10 7 10.5 7 10.5c-.375-1.25.5-3.25 2-3.5-.179 1-.25 2 1 3 .625.5 1 1.364 1 2.25C11 14 9.657 15 8 15z"/></symbol><symbol id="search" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5.0 10-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 001.415-1.414l-3.85-3.85a1.007 1.007.0 00-.115-.1zM12 6.5a5.5 5.5.0 11-11 0 5.5 5.5.0 0111 0z"/></symbol><symbol id="clipboard-check" viewBox="0 0 16 16"><path d="M6.5.0A1.5 1.5.0 005 1.5v1A1.5 1.5.0 006.5 4h3A1.5 1.5.0 0011 2.5v-1A1.5 1.5.0 009.5.0h-3zm3 1a.5.5.0 01.5.5v1a.5.5.0 01-.5.5h-3A.5.5.0 016 2.5v-1a.5.5.0 01.5-.5h3z"/><path d="M4 1.5H3a2 2 0 00-2 2V14a2 2 0 002 2h10a2 2 0 002-2V3.5a2 2 0 00-2-2h-1v1A2.5 2.5.0 019.5 5h-3A2.5 2.5.0 014 2.5v-1zm6.854 7.354-3 3a.5.5.0 01-.708.0l-1.5-1.5a.5.5.0 01.708-.708L7.5 10.793l2.646-2.647a.5.5.0 01.708.708z"/></symbol><symbol id="pencil-square" viewBox="0 0 16 16"><path d="M15.502 1.94a.5.5.0 010 .706L14.459 3.69l-2-2L13.502.646a.5.5.0 01.707.0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5.0 00-.121.196l-.805 2.414a.25.25.0 00.316.316l2.414-.805a.5.5.0 00.196-.12l6.813-6.814z"/><path fill-rule="evenodd" d="M1 13.5A1.5 1.5.0 002.5 15h11a1.5 1.5.0 001.5-1.5v-6a.5.5.0 00-1 0v6a.5.5.0 01-.5.5h-11a.5.5.0 01-.5-.5v-11a.5.5.0 01.5-.5H9a.5.5.0 000-1H2.5A1.5 1.5.0 001 2.5v11z"/></symbol><symbol id="github" viewBox="0 0 16 16"><path d="M8 0C3.58.0.0 3.58.0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38.0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95.0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12.0.0.67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15.0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48.0 1.07-.01 1.93-.01 2.2.0.21.15.46.55.38A8.012 8.012.0 0016 8c0-4.42-3.58-8-8-8z"/></symbol><symbol id="box-arrow-up-right" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.636 3.5a.5.5.0 00-.5-.5H1.5A1.5 1.5.0 000 4.5v10A1.5 1.5.0 001.5 16h10a1.5 1.5.0 001.5-1.5V7.864a.5.5.0 00-1 0V14.5a.5.5.0 01-.5.5h-10a.5.5.0 01-.5-.5v-10a.5.5.0 01.5-.5h6.636a.5.5.0 00.5-.5z"/><path fill-rule="evenodd" d="M16 .5a.5.5.0 00-.5-.5h-5a.5.5.0 000 1h3.793L6.146 9.146a.5.5.0 10.708.708L15 1.707V5.5a.5.5.0 001 0v-5z"/></symbol></svg><header class="navbar docs-navbar navbar-expand-lg py-0 align-items-center"><div class=docs-left-toggle><button class=navbar-toggler type=button data-bs-toggle=offcanvas data-bs-target=#bdSidebar aria-controls=bdSidebar aria-label="Toggle docs content"><svg xmlns="http://www.w3.org/2000/svg" width="1.5rem" height="1.5rem" fill="currentcolor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2.5 11.5A.5.5.0 013 11h10a.5.5.0 010 1H3a.5.5.0 01-.5-.5zm0-4A.5.5.0 013 7h10a.5.5.0 010 1H3a.5.5.0 01-.5-.5zm0-4A.5.5.0 013 3h10a.5.5.0 010 1H3a.5.5.0 01-.5-.5z"/></svg> <span class="d-none fs-6 pe-1">Browse</span></button></div><div class="docs-right-toggle order-3"><button class=navbar-toggler type=button data-bs-toggle=offcanvas data-bs-target=#offcanvas aria-controls=offcanvas aria-label="Toggle Crossplane navigation"><svg class="bi white" aria-hidden="true"><use xlink:href="#three-dots"/></svg></button></div><div class=navbar-brand><a href=https://www.crossplane.io aria-label=Crossplane><img src=/img/crossplane-logo.svg alt="Crossplane logo" srcset="/img/crossplane-logo.svg 1x, /img/crossplane-logo.svg 2x" width=152px decoding=async data-nimg=future loading=lazy></a></div><div class="w-100 offcanvas-lg offcanvas-end" tabindex=-1 id=offcanvas aria-labelledby=offcanvasLabel><div class="offcanvas-body p-0"><div class="offcanvas-header p-0"><div class=navbar-brand><a href=https://www.crossplane.io aria-label=Crossplane><img src=/img/crossplane-logo.svg alt="Crossplane logo" srcset="/img/crossplane-logo.svg 1x, /img/crossplane-logo.svg 2x" width=152px decoding=async data-nimg=future loading=lazy></a></div><button type=button class="btn-close btn-close-white" data-bs-dismiss=offcanvas aria-label=Close data-bs-target=#offcanvas></button></div><div class="navbar-center-links collapse navbar-collapse justify-content-evenly show"><ul class="navbar-nav align-items-center"><li class=nav-item><a class=navbar-link href=https://www.crossplane.io/why-control-planes>Why Control Planes?</a></li><li class=nav-item><a class=navbar-link aria-current=page href=https://docs.crossplane.io/>Documentation</a></li><li class=nav-item><a class=navbar-link href=https://www.crossplane.io/community>Community</a></li><li class=nav-item><a class=navbar-link href=https://blog.crossplane.io/>Blog</a></li></ul></div><div class="navbar-icons flex-shrink-1 show"><ul class=navbar-nav><li class="nav-item col-xs p-2"><a class=navbar-link href=https://github.com/crossplane title="Crossplane Github Repository" target=_blank rel=noopener><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentcolor" class="icon-github" viewBox="0 0 16 16"><path d="M8 0C3.58.0.0 3.58.0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38.0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95.0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12.0.0.67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15.0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48.0 1.07-.01 1.93-.01 2.2.0.21.15.46.55.38A8.012 8.012.0 0016 8c0-4.42-3.58-8-8-8z"/></svg><span class=icon-label>Crossplane GitHub</span></a></li><li class="nav-item col-xs p-2"><div id=slack><a class=navbar-link href=https://slack.crossplane.io title="Join the Crossplane Slack" target=_blank rel=noopener><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentcolor" class="icon-slack" viewBox="0 0 16 16"><path d="M3.362 10.11c0 .926-.756 1.681-1.681 1.681S0 11.036.0 10.111C0 9.186.756 8.43 1.68 8.43h1.682v1.68zm.846.0c0-.924.756-1.68 1.681-1.68s1.681.756 1.681 1.68v4.21c0 .924-.756 1.68-1.68 1.68a1.685 1.685.0 01-1.682-1.68v-4.21zM5.89 3.362c-.926.0-1.682-.756-1.682-1.681S4.964.0 5.89.0s1.68.756 1.68 1.68v1.682H5.89zm0 .846c.924.0 1.68.756 1.68 1.681S6.814 7.57 5.89 7.57H1.68C.757 7.57.0 6.814.0 5.89c0-.926.756-1.682 1.68-1.682h4.21zm6.749 1.682c0-.926.755-1.682 1.68-1.682.925.0 1.681.756 1.681 1.681s-.756 1.681-1.68 1.681h-1.681V5.89zm-.848.0c0 .924-.755 1.68-1.68 1.68A1.685 1.685.0 018.43 5.89V1.68C8.43.757 9.186.0 10.11.0c.926.0 1.681.756 1.681 1.68v4.21zm-1.681 6.748c.926.0 1.682.756 1.682 1.681S11.036 16 10.11 16s-1.681-.756-1.681-1.68v-1.682h1.68zm0-.847c-.924.0-1.68-.755-1.68-1.68.0-.925.756-1.681 1.68-1.681h4.21c.924.0 1.68.756 1.68 1.68.0.926-.756 1.681-1.68 1.681h-4.21z"/></svg><span class=icon-label>Crossplane Slack</span></a></div></li><li class="nav-item col-x p-2"><div class="vr d-lg-flex mx-lg-2 text-white"></div></li><li class="nav-item col-xs p-2"><div class="form-check form-switch color-switcher"><input class="d-flex form-check-input" type=checkbox id=darkSwitch> <label class="d-flex navbar-link form-check-label" for=darkSwitch>Dark Mode</label></div></li></ul></div></div></div></header><div class="bd-layout docs-container" data-bs-spy=scroll data-bs-target=#TableOfContents data-bs-threshold=0,1 data-bs-root-margin="0% 0% -75%"><aside class=bd-sidebar><div class="offcanvas-lg offcanvas-start bd-sidebar-container" tabindex=-1 id=bdSidebar aria-labelledby=bdSidebarOffcanvasLabel><div class="offcanvas-header pb-4 border-bottom"><div class="d-flex offcanvas-title fw-bold" id=bdNavbarOffcanvasLabel>Crossplane Documentation - v1.18</div><div class=d-flex><button type=button class="btn-close bi align-self-center p-0" data-bs-dismiss=offcanvas aria-label=Close data-bs-target=#bdSidebar></button></div></div><div class=offcanvas-body><div class="container-fluid p-0"><div class="search-container d-flex row pt-3 ps-4 docsearch opacity-50" data-bs-target=#bdSidebar data-bs-dismiss=offcanvas aria-label="Docs navigation"><div class=p-0 id=docSearch></div></div><nav class="bd-links-nav w-100" aria-label="Docs navigation"><div class="section-container container pe-0 pt-1"><div class="container nav-container pe-0 d-flex w-100"><a class="d-flex w-100 border-0" href=https://docs.crossplane.io/v1.18/>Overview</a></div></div><div class="section-container container pe-0 pt-1"><div class="container nav-container pe-0 d-flex w-100"><a class="d-flex w-100 border-0" href=https://docs.crossplane.io/v1.18/getting-started/>Getting Started</a><div class="d-flex flex-shrink-1 sidebar-control-container align-self-center"><input type=checkbox class="d-flex sidebar-checkbox" aria-label="Close or Expand Getting Started Section"> <label for=collapse-83678735 class="sidebar-label collapsed" data-bs-toggle=collapse data-bs-target=#collapse-83678735 aria-expanded=false aria-label="Close or Expand Getting Started Section"><svg class="flex bi sidebar-icon plus"><use xlink:href="#plus"/></svg><svg class="flex bi sidebar-icon x"><use xlink:href="#x"/></svg></label></div></div><div class="container flex-row collapse" id=collapse-83678735><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/getting-started/introduction/>Crossplane Introduction</a></div></div><div class="container flex-row collapse" id=collapse-83678735><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/getting-started/provider-aws/>AWS Quickstart</a></div></div><div class="container flex-row collapse" id=collapse-83678735><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/getting-started/provider-azure/>Azure Quickstart</a></div></div><div class="container flex-row collapse" id=collapse-83678735><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/getting-started/provider-gcp/>GCP Quickstart</a></div></div></div><div class="section-container container pe-0 pt-1"><div class="container nav-container pe-0 d-flex w-100"><a class="d-flex w-100 border-0" href=https://docs.crossplane.io/v1.18/software/>Install, Upgrade and Uninstall</a><div class="d-flex flex-shrink-1 sidebar-control-container align-self-center"><input type=checkbox class="d-flex sidebar-checkbox" aria-label="Close or Expand Install, Upgrade and Uninstall Section"> <label for=collapse-2ea344ac class="sidebar-label collapsed" data-bs-toggle=collapse data-bs-target=#collapse-2ea344ac aria-expanded=false aria-label="Close or Expand Install, Upgrade and Uninstall Section"><svg class="flex bi sidebar-icon plus"><use xlink:href="#plus"/></svg><svg class="flex bi sidebar-icon x"><use xlink:href="#x"/></svg></label></div></div><div class="container flex-row collapse" id=collapse-2ea344ac><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/software/install/>Install Crossplane</a></div></div><div class="container flex-row collapse" id=collapse-2ea344ac><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/software/upgrade/>Upgrade Crossplane</a></div></div><div class="container flex-row collapse" id=collapse-2ea344ac><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/software/uninstall/>Uninstall Crossplane</a></div></div></div><div class="section-container container pe-0 pt-1"><div class="container nav-container pe-0 d-flex w-100"><a class="d-flex w-100 border-0" href=https://docs.crossplane.io/v1.18/concepts/>Concepts</a><div class="d-flex flex-shrink-1 sidebar-control-container align-self-center"><input type=checkbox class="d-flex sidebar-checkbox" aria-label="Close or Expand Concepts Section"> <label for=collapse-4c9a67bb class="sidebar-label collapsed" data-bs-toggle=collapse data-bs-target=#collapse-4c9a67bb aria-expanded=false aria-label="Close or Expand Concepts Section"><svg class="flex bi sidebar-icon plus"><use xlink:href="#plus"/></svg><svg class="flex bi sidebar-icon x"><use xlink:href="#x"/></svg></label></div></div><div class="container flex-row collapse" id=collapse-4c9a67bb><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/concepts/pods/>Crossplane Pods</a></div></div><div class="container flex-row collapse" id=collapse-4c9a67bb><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/concepts/providers/>Providers</a></div></div><div class="container flex-row collapse" id=collapse-4c9a67bb><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/concepts/managed-resources/>Managed Resources</a></div></div><div class="container flex-row collapse" id=collapse-4c9a67bb><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/concepts/compositions/>Compositions</a></div></div><div class="container flex-row collapse" id=collapse-4c9a67bb><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/concepts/composition-revisions/>Composition Revisions</a></div></div><div class="container flex-row collapse" id=collapse-4c9a67bb><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/concepts/composite-resource-definitions/>Composite Resource Definitions</a></div></div><div class="container flex-row collapse" id=collapse-4c9a67bb><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/concepts/composite-resources/>Composite Resources</a></div></div><div class="container flex-row collapse" id=collapse-4c9a67bb><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/concepts/claims/>Claims</a></div></div><div class="container flex-row collapse" id=collapse-4c9a67bb><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/concepts/environment-configs/>Environment Configurations</a></div></div><div class="container flex-row collapse" id=collapse-4c9a67bb><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/concepts/usages/>Usages</a></div></div><div class="container flex-row collapse" id=collapse-4c9a67bb><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/concepts/connection-details/>Connection Details</a></div></div><div class="container flex-row collapse" id=collapse-4c9a67bb><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/concepts/packages/>Configuration Packages</a></div></div><div class="container flex-row collapse" id=collapse-4c9a67bb><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/concepts/server-side-apply/>Server-Side Apply</a></div></div><div class="container flex-row collapse" id=collapse-4c9a67bb><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/concepts/image-configs/>Image Configs</a></div></div></div><div class="section-container container pe-0 pt-1"><div class="container nav-container pe-0 d-flex w-100 active-parent"><a class="d-flex w-100 border-0" href=https://docs.crossplane.io/v1.18/guides/>Guides</a><div class="d-flex flex-shrink-1 sidebar-control-container align-self-center"><input type=checkbox class="d-flex sidebar-checkbox" checked aria-label="Close or Expand Guides Section"> <label for=collapse-0092279e class=sidebar-label data-bs-toggle=collapse data-bs-target=#collapse-0092279e aria-expanded=false aria-label="Close or Expand Guides Section"><svg class="flex bi sidebar-icon plus"><use xlink:href="#plus"/></svg><svg class="flex bi sidebar-icon x"><use xlink:href="#x"/></svg></label></div></div><div class="container flex-row collapse show" id=collapse-0092279e><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/guides/disaster-recovery/>Disaster Recovery with Crossplane</a></div></div><div class="container flex-row collapse show" id=collapse-0092279e><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/guides/metrics/>Metrics</a></div></div><div class="container flex-row collapse show" id=collapse-0092279e><div class="d-flex flex-column"><a class="bd-links d-flex active" href=https://docs.crossplane.io/v1.18/guides/function-patch-and-transform/>Function Patch and Transform</a></div></div><div class="container flex-row collapse show" id=collapse-0092279e><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/guides/write-a-composition-function-in-go/>Write a Composition Function in Go</a></div></div><div class="container flex-row collapse show" id=collapse-0092279e><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/guides/write-a-composition-function-in-python/>Write a Composition Function in Python</a></div></div><div class="container flex-row collapse show" id=collapse-0092279e><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/guides/import-existing-resources/>Import Existing Resources</a></div></div><div class="container flex-row collapse show" id=collapse-0092279e><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/guides/vault-as-secret-store/>Vault as an External Secret Store</a></div></div><div class="container flex-row collapse show" id=collapse-0092279e><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/guides/vault-injection/>Vault Credential Injection</a></div></div><div class="container flex-row collapse show" id=collapse-0092279e><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/guides/multi-tenant/>Multi-Tenant Crossplane</a></div></div><div class="container flex-row collapse show" id=collapse-0092279e><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/guides/crossplane-with-argo-cd/>Configuring Crossplane with Argo CD</a></div></div><div class="container flex-row collapse show" id=collapse-0092279e><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/guides/self-signed-ca-certs/>Self-Signed CA Certs</a></div></div><div class="container flex-row collapse show" id=collapse-0092279e><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/guides/troubleshoot-crossplane/>Troubleshoot Crossplane</a></div></div></div><div class="section-container container pe-0 pt-1"><div class="container nav-container pe-0 d-flex w-100"><a class="d-flex w-100 border-0" href=https://docs.crossplane.io/v1.18/cli/>CLI Reference</a><div class="d-flex flex-shrink-1 sidebar-control-container align-self-center"><input type=checkbox class="d-flex sidebar-checkbox" aria-label="Close or Expand CLI Reference Section"> <label for=collapse-ffd26267 class="sidebar-label collapsed" data-bs-toggle=collapse data-bs-target=#collapse-ffd26267 aria-expanded=false aria-label="Close or Expand CLI Reference Section"><svg class="flex bi sidebar-icon plus"><use xlink:href="#plus"/></svg><svg class="flex bi sidebar-icon x"><use xlink:href="#x"/></svg></label></div></div><div class="container flex-row collapse" id=collapse-ffd26267><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/cli/command-reference/>Command Reference</a></div></div></div><div class="section-container container pe-0 pt-1"><div class="container nav-container pe-0 d-flex w-100"><a class="d-flex w-100 border-0" href=https://docs.crossplane.io/v1.18/api/>API Reference</a><div class="d-flex flex-shrink-1 sidebar-control-container align-self-center"><input type=checkbox class="d-flex sidebar-checkbox" aria-label="Close or Expand API Reference Section"> <label for=collapse-6144acbe class="sidebar-label collapsed" data-bs-toggle=collapse data-bs-target=#collapse-6144acbe aria-expanded=false aria-label="Close or Expand API Reference Section"><svg class="flex bi sidebar-icon plus"><use xlink:href="#plus"/></svg><svg class="flex bi sidebar-icon x"><use xlink:href="#x"/></svg></label></div></div></div><div class="section-container container pe-0 pt-1"><div class="container nav-container pe-0 d-flex w-100"><a class="d-flex w-100 border-0" href=https://docs.crossplane.io/v1.18/learn/>Learn More</a><div class="d-flex flex-shrink-1 sidebar-control-container align-self-center"><input type=checkbox class="d-flex sidebar-checkbox" aria-label="Close or Expand Learn More Section"> <label for=collapse-a721e305 class="sidebar-label collapsed" data-bs-toggle=collapse data-bs-target=#collapse-a721e305 aria-expanded=false aria-label="Close or Expand Learn More Section"><svg class="flex bi sidebar-icon plus"><use xlink:href="#plus"/></svg><svg class="flex bi sidebar-icon x"><use xlink:href="#x"/></svg></label></div></div><div class="container flex-row collapse" id=collapse-a721e305><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/learn/release-cycle/>Release Cycle</a></div></div><div class="container flex-row collapse" id=collapse-a721e305><div class="d-flex flex-column"><a class="bd-links d-flex" href=https://docs.crossplane.io/v1.18/learn/feature-lifecycle/>Feature Lifecycle</a></div></div></div><div class="section-container container pe-0 pt-1"><div class=nav-container><a href=https://docs.crossplane.io/contribute/ class="d-inline-flex align-items-center">Contributing Guide</a></div></div><div class="section-container container pe-0 pt-1"><div class="container nav-container pe-0 d-flex w-100"><a class="d-flex w-100 border-0" href="https://github.com/orgs/crossplane/projects/20/views/9?pane=info" target=_blank>Crossplane Roadmap</a><div class="d-flex flex-shrink-1 sidebar-control-container align-self-center"><a href="https://github.com/orgs/crossplane/projects/20/views/9?pane=info"><svg class="flex bi"><use xlink:href="#box-arrow-up-right"/></svg></a></div></div></div></nav></div></div></aside><main class="bd-main order-1"><div class="bd-intro pt-2 ps-lg-2"><div class="d-md-flex flex-md-row-reverse align-items-center justify-content-between"><div class="mb-3 mb-md-0 d-flex"><div class="dropdown float-end bd-dropdown"><a class="btn btn-outline-secondary dropdown-toggle bd-dropdown-item text-reset" href=# role=button id=dropdownMenuLink data-bs-toggle=dropdown aria-haspopup=true aria-expanded=false>v1.18<div class="badge rounded-pill latest">Latest</div></a><div class="dropdown-menu bd-border-color bd-dropdown" aria-labelledby=dropdownMenuLink><a class="dropdown-item bd-dropdown-item" href=https://docs.crossplane.io/master/guides/function-patch-and-transform/>master</a> <a class="dropdown-item bd-dropdown-item active" aria-current=true href=https://docs.crossplane.io/v1.18/guides/function-patch-and-transform/>v1.18<div class="badge rounded-pill latest">Latest</div></a><a class="dropdown-item bd-dropdown-item" href=https://docs.crossplane.io/v1.17/guides/function-patch-and-transform/>v1.17</a> <a class="dropdown-item bd-dropdown-item" href=https://docs.crossplane.io/v1.16/>v1.16</a></div></div></div><h1 class="bd-title mb-0" id=content>Function Patch and Transform</h1></div></div><div class="bd-toc mt-3 mb-5 my-lg-0 ps-xl-3 mb-lg-5"><button class="btn btn-link p-md-0 mb-2 mb-md-0 text-decoration-none bd-toc-toggle d-md-none" type=button data-bs-toggle=collapse data-bs-target=#tocContents aria-expanded=false aria-controls=tocContents> On this page<svg class="bi d-md-none ms-2" aria-hidden="true"><use xlink:href="#chevron-expand"/></svg></button> <strong class="d-none d-md-block h6 my-2">On this page</strong><hr class="d-none d-md-block my-2"><div class="collapse bd-toc-collapse" id=tocContents><nav id=TableOfContents><ul class=nav><li class=nav-item><a class=nav-link href=#install-the-function>Install the function</a></li><li class=nav-item><a class=nav-link href=#resource-templates>Resource templates</a></li><li class=nav-item><a class=nav-link href=#create-a-patch>Create a patch</a><ul class=nav><li class=nav-item><a class=nav-link href=#selecting-fields>Selecting fields</a><ul class=nav><li class=nav-item><a class=nav-link href=#example-field-paths>Example field paths</a></li></ul></li></ul></li><li class=nav-item><a class=nav-link href=#reuse-a-patch>Reuse a patch</a></li><li class=nav-item><a class=nav-link href=#patching-between-resources>Patching between resources</a></li><li class=nav-item><a class=nav-link href=#patch-with-environmentconfigs>Patch with EnvironmentConfigs</a><ul class=nav><li class=nav-item><a class=nav-link href=#patch-a-composite-resource>Patch a composite resource</a></li><li class=nav-item><a class=nav-link href=#patch-an-individual-resource>Patch an individual resource</a></li></ul></li><li class=nav-item><a class=nav-link href=#types-of-patches>Types of patches</a><ul class=nav><li class=nav-item><a class=nav-link href=#fromcompositefieldpath>FromCompositeFieldPath</a></li><li class=nav-item><a class=nav-link href=#tocompositefieldpath>ToCompositeFieldPath</a></li><li class=nav-item><a class=nav-link href=#combinefromcomposite>CombineFromComposite</a></li><li class=nav-item><a class=nav-link href=#combinetocomposite>CombineToComposite</a></li><li class=nav-item><a class=nav-link href=#fromenvironmentfieldpath>FromEnvironmentFieldPath</a></li><li class=nav-item><a class=nav-link href=#toenvironmentfieldpath>ToEnvironmentFieldPath</a></li><li class=nav-item><a class=nav-link href=#combinefromenvironment>CombineFromEnvironment</a></li><li class=nav-item><a class=nav-link href=#combinetoenvironment>CombineToEnvironment</a></li></ul></li><li class=nav-item><a class=nav-link href=#transform-a-patch>Transform a patch</a><ul class=nav><li class=nav-item><a class=nav-link href=#convert-transforms>Convert transforms</a><ul class=nav><li class=nav-item><a class=nav-link href=#converting-strings-to-booleans>Converting strings to booleans</a></li><li class=nav-item><a class=nav-link href=#converting-numbers-to-booleans>Converting numbers to booleans</a></li><li class=nav-item><a class=nav-link href=#converting-booleans-to-numbers>Converting booleans to numbers</a></li><li class=nav-item><a class=nav-link href=#converting-strings-to-float64>Converting strings to float64</a></li><li class=nav-item><a class=nav-link href=#converting-strings-to-objects>Converting strings to objects</a></li><li class=nav-item><a class=nav-link href=#converting-strings-to-arrays>Converting strings to arrays</a></li></ul></li><li class=nav-item><a class=nav-link href=#map-transforms>Map transforms</a></li><li class=nav-item><a class=nav-link href=#match-transform>Match transform</a><ul class=nav><li class=nav-item><a class=nav-link href=#match-an-exact-string>Match an exact string</a></li><li class=nav-item><a class=nav-link href=#match-a-regular-expression>Match a regular expression</a></li><li class=nav-item><a class=nav-link href=#using-default-values>Using default values</a></li></ul></li><li class=nav-item><a class=nav-link href=#math-transforms>Math transforms</a><ul class=nav><li class=nav-item><a class=nav-link href=#clampmin>clampMin</a></li><li class=nav-item><a class=nav-link href=#clampmax>clampMax</a></li><li class=nav-item><a class=nav-link href=#multiply>Multiply</a></li></ul></li><li class=nav-item><a class=nav-link href=#string-transforms>String transforms</a><ul class=nav><li class=nav-item><a class=nav-link href=#string-convert>String convert</a></li><li class=nav-item><a class=nav-link href=#string-format>String format</a></li><li class=nav-item><a class=nav-link href=#join>Join</a></li><li class=nav-item><a class=nav-link href=#regular-expression-type>Regular expression type</a></li><li class=nav-item><a class=nav-link href=#trim-prefix>Trim prefix</a></li><li class=nav-item><a class=nav-link href=#trim-suffix>Trim suffix</a></li></ul></li></ul></li><li class=nav-item><a class=nav-link href=#patch-policies>Patch policies</a><ul class=nav><li class=nav-item><a class=nav-link href=#fromfieldpath-policy>fromFieldPath policy</a></li><li class=nav-item><a class=nav-link href=#tofieldpath-policy>toFieldPath policy</a></li></ul></li><li class=nav-item><a class=nav-link href=#composite-resource-connection-details>Composite resource connection details</a></li><li class=nav-item><a class=nav-link href=#resource-readiness-checks>Resource readiness checks</a><ul class=nav><li class=nav-item><a class=nav-link href=#match-a-string>Match a string</a></li><li class=nav-item><a class=nav-link href=#match-an-integer>Match an integer</a></li><li class=nav-item><a class=nav-link href=#match-that-a-field-exists>Match that a field exists</a></li><li class=nav-item><a class=nav-link href=#always-consider-a-resource-ready>Always consider a resource ready</a></li><li class=nav-item><a class=nav-link href=#match-a-condition>Match a condition</a></li><li class=nav-item><a class=nav-link href=#match-a-boolean>Match a boolean</a></li></ul></li></ul></li></ul></nav><nav class=pt-3><div class=pb-2><svg class="bi" width="1em" height="1em"><use xlink:href="#pencil-square"/></svg><span class=ps-1><a target=_blank href="https://github.com/crossplane/docs/issues/new?title=[Web%20Bug]%20-%20Function%20Patch%20and%20Transform&body=%3c!--%20What%27s%20the%20problem?%20--%3e%0a%0a%0aURL:%20https://docs.crossplane.io/v1.18/guides/function-patch-and-transform/">Report a problem</a></span></div><div><svg class="bi" width="1em" height="1em"><use xlink:href="#github"/></svg><span class=ps-1><a href=https://github.com/crossplane/docs/tree/master/content/v1.18/guides/function-patch-and-transform.md>View page source</a></span></div></div></nav></div><div class="bd-content ps-lg-2 DocSearch-content"><p>Function Patch and Transform allows you to write a Composition that specifies managed resource (MR) templates, and uses “patch and transform” operations to fill them out. Crossplane fills the templates out with values copied from a claim or composite resource (XR).</p><p>A <a href=#create-a-patch>patch</a> copies a value from one resource and <em>patches</em> it onto another resource. A <a href=#transform-a-patch>transform</a> modifies the values before applying the patch.</p><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content><p>All Compositions used Patch and Transform before Crossplane added support for composition functions.</p><p>Function Patch and Transform works like legacy <code>mode: Resources</code> Compositions, which Crossplane deprecated in v1.17. The difference is that it uses a <code>mode: Pipeline</code> Composition and a function instead of a <code>mode: Resources</code> Composition.</p></div></div><p>Here’s an example Composition that uses Function Patch and Transform. When you create an <code>AcmeBucket</code> XR that uses this Composition, Crossplane uses the template to create the Amazon S3 <code>Bucket</code> MR.</p><p>Crossplane copies the value from the <code>AcmeBucket</code> XR’s <code>spec.desiredRegion</code> field and patch it onto the <code>Bucket</code> managed resource’s <code>spec.forProvider.region</code> field.</p><div class=highlight label=intro><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-0-1><a class=lnlinks href=#hl-0-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>apiextensions.crossplane.io/v1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-2><a class=lnlinks href=#hl-0-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Composition</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-3><a class=lnlinks href=#hl-0-3> 3</a></span><span class=cl><span class=w></span><span class=nt>metadata</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-4><a class=lnlinks href=#hl-0-4> 4</a></span><span class=cl><span class=w> </span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>example</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-5><a class=lnlinks href=#hl-0-5> 5</a></span><span class=cl><span class=w></span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-6><a class=lnlinks href=#hl-0-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>compositeTypeRef</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-7><a class=lnlinks href=#hl-0-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>custom-api.example.org/v1alpha1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-8><a class=lnlinks href=#hl-0-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>AcmeBucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-9><a class=lnlinks href=#hl-0-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>mode</span><span class=p>:</span><span class=w> </span><span class=l>Pipeline</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-10><a class=lnlinks href=#hl-0-10>10</a></span><span class=cl><span class=w> </span><span class=nt>pipeline</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-11><a class=lnlinks href=#hl-0-11>11</a></span><span class=cl><span class=w> </span>- <span class=nt>step</span><span class=p>:</span><span class=w> </span><span class=l>patch-and-transform</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-12><a class=lnlinks href=#hl-0-12>12</a></span><span class=cl><span class=w> </span><span class=nt>functionRef</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-13><a class=lnlinks href=#hl-0-13>13</a></span><span class=cl><span class=w> </span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>function-patch-and-transform</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-14><a class=lnlinks href=#hl-0-14>14</a></span><span class=cl><span class=w> </span><span class=nt>input</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-15><a class=lnlinks href=#hl-0-15>15</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-16><a class=lnlinks href=#hl-0-16>16</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-17><a class=lnlinks href=#hl-0-17>17</a></span><span class=cl><span class=w> </span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-18><a class=lnlinks href=#hl-0-18>18</a></span><span class=cl><span class=w> </span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>storage-bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-19><a class=lnlinks href=#hl-0-19>19</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-20><a class=lnlinks href=#hl-0-20>20</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-21><a class=lnlinks href=#hl-0-21>21</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-22><a class=lnlinks href=#hl-0-22>22</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-23><a class=lnlinks href=#hl-0-23>23</a></span><span class=cl><span class=w> </span><span class=nt>forProvider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-24><a class=lnlinks href=#hl-0-24>24</a></span><span class=cl><span class=w> </span><span class=nt>region</span><span class=p>:</span><span class=w> </span><span class=s2>"us-east-2"</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-25><a class=lnlinks href=#hl-0-25>25</a></span><span class=cl><span class=w> </span><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-26><a class=lnlinks href=#hl-0-26>26</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-27><a class=lnlinks href=#hl-0-27>27</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.desiredRegion</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-28><a class=lnlinks href=#hl-0-28>28</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.forProvider.region</span><span class=w> </span></span></span></code></pre></div><div class="admonition note d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="note:"><use xlink:href="#info"/></svg><span class=ps-1>Note</span></div><div class=admonition-content>Patch and transform is best for simpler compositions. It intentionally doesn’t support features like loops and conditionals.</div></div><div class="accordion mb-3" id=confused-about-compositions-xrds-xrs-and-claims-1859-Parent><div class=accordion-item><h2 class=accordion-header id=confused-about-compositions-xrds-xrs-and-claims-1859><button class="accordion-button collapsed" type=button data-bs-toggle=collapse data-bs-target=#confused-about-compositions-xrds-xrs-and-claims-1859-Content aria-expanded=false aria-controls=confused-about-compositions-xrds-xrs-and-claims-1859-Content> Confused about Compositions, XRDs, XRs and Claims?</button></h2><div id=confused-about-compositions-xrds-xrs-and-claims-1859-Content class="accordion-collapse collapse" aria-labelledby=confused-about-compositions-xrds-xrs-and-claims-1859 data-bs-parent=#confused-about-compositions-xrds-xrs-and-claims-1859-Parent><div class="accordion-body rounded-bottom"><p>Crossplane has four core components that users commonly mix up:</p><ul><li><a href=https://docs.crossplane.io/v1.18/concepts/compositions/>Composition</a> - A template to define how to create resources.</li><li><a href=https://docs.crossplane.io/v1.18/concepts/composite-resource-definitions/>composite resource Definition</a> (<code>XRD</code>) - A custom API specification.</li><li><a href=https://docs.crossplane.io/v1.18/concepts/composite-resources/>composite resource</a> (<code>XR</code>) - Created by using the custom API defined in a composite resource Definition. XRs use the Composition template to create new managed resources.</li><li><a href=https://docs.crossplane.io/v1.18/concepts/claims/>Claim</a> (<code>XRC</code>) - Like a composite resource, but with namespace scoping.</li></ul></div></div></div></div><h2 id=install-the-function>Install the function <a class=anchor-link id=install-the-function href=#install-the-function aria-label="Link to this section: Install the function"></a></h2><p>You must install Function Patch and Transform before you can use it in a Composition. Apply this manifest to install Function Patch and Transform:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-1-1><a class=lnlinks href=#hl-1-1>1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pkg.crossplane.io/v1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-1-2><a class=lnlinks href=#hl-1-2>2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Function</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-1-3><a class=lnlinks href=#hl-1-3>3</a></span><span class=cl><span class=w></span><span class=nt>metadata</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-1-4><a class=lnlinks href=#hl-1-4>4</a></span><span class=cl><span class=w> </span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>function-patch-and-transform</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-1-5><a class=lnlinks href=#hl-1-5>5</a></span><span class=cl><span class=w></span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-1-6><a class=lnlinks href=#hl-1-6>6</a></span><span class=cl><span class=w> </span><span class=nt>package</span><span class=p>:</span><span class=w> </span><span class=l>xpkg.upbound.io/crossplane-contrib/function-patch-and-transform:v0.1.4</span><span class=w> </span></span></span></code></pre></div><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content>Read the <a href=https://docs.crossplane.io/v1.18/concepts/compositions/>Composition page</a> to learn more about Compositions and composition functions.</div></div><h2 id=resource-templates>Resource templates <a class=anchor-link id=resource-templates href=#resource-templates aria-label="Link to this section: Resource templates"></a></h2><p>The <code>resources</code> field the function’s input defines the set of things that a composite resource creates when it uses this function.</p><p>For example, the input can define a template to create a virtual machine and an associated storage bucket at the same time.</p><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content>Crossplane calls the resources a composite resource creates <em>composed resources</em>.</div></div><p>The <code>resources</code> field lists the individual resources with a <code>name</code>. This name identifies the resource inside the Composition. It isn’t related to the external name used with the Provider.</p><p>The contents of the <code>base</code> are identical to creating a standalone <a href=https://docs.crossplane.io/v1.18/concepts/managed-resources/>managed resource</a>.</p><p>This example uses <a href=https://marketplace.upbound.io/providers/upbound/provider-family-aws/v1.17.0>Upbound’s Provider AWS</a> to define a S3 storage <code>Bucket</code> and EC2 compute <code>Instance</code>.</p><p>After defining the <code>apiVersion</code> and <code>kind</code>, define the <code>spec.forProvider</code> fields defining the settings of the resource.</p><div class=highlight copy-lines=none label=resources><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-2-1><a class=lnlinks href=#hl-2-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-2-2><a class=lnlinks href=#hl-2-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-2-3><a class=lnlinks href=#hl-2-3> 3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-2-4><a class=lnlinks href=#hl-2-4> 4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>storage-bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-2-5><a class=lnlinks href=#hl-2-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-2-6><a class=lnlinks href=#hl-2-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-2-7><a class=lnlinks href=#hl-2-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-2-8><a class=lnlinks href=#hl-2-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-2-9><a class=lnlinks href=#hl-2-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>forProvider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-2-10><a class=lnlinks href=#hl-2-10>10</a></span><span class=cl><span class=w> </span><span class=nt>region</span><span class=p>:</span><span class=w> </span><span class=s2>"us-east-2"</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-2-11><a class=lnlinks href=#hl-2-11>11</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>vm</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-2-12><a class=lnlinks href=#hl-2-12>12</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-2-13><a class=lnlinks href=#hl-2-13>13</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>ec2.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-2-14><a class=lnlinks href=#hl-2-14>14</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Instance</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-2-15><a class=lnlinks href=#hl-2-15>15</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-2-16><a class=lnlinks href=#hl-2-16>16</a></span><span class=cl><span class=w> </span><span class=nt>forProvider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-2-17><a class=lnlinks href=#hl-2-17>17</a></span><span class=cl><span class=w> </span><span class=nt>ami</span><span class=p>:</span><span class=w> </span><span class=l>ami-0d9858aa3c6322f73</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-2-18><a class=lnlinks href=#hl-2-18>18</a></span><span class=cl><span class=w> </span><span class=nt>instanceType</span><span class=p>:</span><span class=w> </span><span class=l>t2.micro</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-2-19><a class=lnlinks href=#hl-2-19>19</a></span><span class=cl><span class=w> </span><span class=nt>region</span><span class=p>:</span><span class=w> </span><span class=s2>"us-east-2"</span><span class=w> </span></span></span></code></pre></div><p>When a <a href=https://docs.crossplane.io/v1.18/concepts/composite-resources/>composite resource</a> uses this function, the composite resource creates two new managed resources with all the provided <code>spec.forProvider</code> settings.</p><p>The <code>spec</code> supports any settings used in a managed resource, including applying <code>annotations</code> and <code>labels</code> or using a specific <code>providerConfigRef</code>.</p><div class="admonition note d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="note:"><use xlink:href="#info"/></svg><span class=ps-1>Note</span></div><div class=admonition-content>Use the <code>crossplane.io/external-name</code> annotation on the resource to set the resource’s name in the external system (like AWS).</div></div><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content><p>You can use Function Patch and Transform to template other kinds of Crossplane resources, like ProviderConfigs.</p><p>You can also template other kinds of composite resource (XR).</p><p>You can’t template namespaced resources.</p></div></div><h2 id=create-a-patch>Create a patch <a class=anchor-link id=create-a-patch href=#create-a-patch aria-label="Link to this section: Create a patch"></a></h2><p>Each entry in the <code>resources</code> list can include a list of patches. The <code>patches</code> field takes a list of patches to apply to the individual resource.</p><p>Each patch has a <code>type</code>, which defines what kind of patch action Crossplane applies.</p><p>Patches reference fields inside different resources depending on the patch type, but all patches reference a <code>fromFieldPath</code> and <code>toFieldPath</code>.</p><p>The <code>fromFieldPath</code> is the path to the patch’s input values. The <code>toFieldPath</code> is the path the patch applies to.</p><p>Here’s an example of a patch that copies a value from the composite resource’s <code>spec.field1</code> field to the composed Bucket’s labels.</p><div class=highlight label=createComp copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-3-1><a class=lnlinks href=#hl-3-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-3-2><a class=lnlinks href=#hl-3-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-3-3><a class=lnlinks href=#hl-3-3> 3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-3-4><a class=lnlinks href=#hl-3-4> 4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>storage-bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-3-5><a class=lnlinks href=#hl-3-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-3-6><a class=lnlinks href=#hl-3-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-3-7><a class=lnlinks href=#hl-3-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-3-8><a class=lnlinks href=#hl-3-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-3-9><a class=lnlinks href=#hl-3-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>forProvider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-3-10><a class=lnlinks href=#hl-3-10>10</a></span><span class=cl><span class=w> </span><span class=nt>region</span><span class=p>:</span><span class=w> </span><span class=s2>"us-east-2"</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-3-11><a class=lnlinks href=#hl-3-11>11</a></span><span class=cl><span class=w> </span><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-3-12><a class=lnlinks href=#hl-3-12>12</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-3-13><a class=lnlinks href=#hl-3-13>13</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.field1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-3-14><a class=lnlinks href=#hl-3-14>14</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.labels["patchLabel"]</span><span class=w> </span></span></span></code></pre></div><h3 id=selecting-fields>Selecting fields <a class=anchor-link id=selecting-fields href=#selecting-fields aria-label="Link to this section: Selecting fields"></a></h3><p>Crossplane selects fields in a composite resource or managed resource with a subset of <a href=https://kubernetes.io/docs/reference/kubectl/jsonpath/>JSONPath selectors</a>, called “field paths.”</p><p>Field paths can select any field in a composite resource or managed resource object, including the <code>metadata</code>, <code>spec</code> or <code>status</code> fields.</p><p>Field paths can be a string matching a field name or an array index, in brackets. Field names may use a <code>.</code> character to select child elements.</p><h4 id=example-field-paths>Example field paths <a class=anchor-link id=example-field-paths href=#example-field-paths aria-label="Link to this section: Example field paths"></a></h4><p>Here are some example selectors from a composite resource object.<div class="table-responsive border rounded"><table class=table><thead><tr><th>Selector</th><th>Selected element</th></tr></thead><tbody><tr><td><code>kind</code></td><td><code>kind</code></td></tr><tr><td><code>metadata.labels['crossplane.io/claim-name']</code></td><td><code>my-example-claim</code></td></tr><tr><td><code>spec.desiredRegion</code></td><td><code>eu-north-1</code></td></tr><tr><td><code>spec.resourceRefs[0].name</code></td><td><code>my-example-claim-978mh-r6z64</code></td></tr></tbody></table></div></p><div class=highlight label=select copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-4-1><a class=lnlinks href=#hl-4-1> 1</a></span><span class=cl><span class=l>$ kubectl get composite -o yaml</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-2><a class=lnlinks href=#hl-4-2> 2</a></span><span class=cl><span class=w></span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>example.org/v1alpha1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-3><a class=lnlinks href=#hl-4-3> 3</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>XExample</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-4><a class=lnlinks href=#hl-4-4> 4</a></span><span class=cl><span class=w></span><span class=nt>metadata</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-5><a class=lnlinks href=#hl-4-5> 5</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-6><a class=lnlinks href=#hl-4-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>labels</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-7><a class=lnlinks href=#hl-4-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>crossplane.io/claim-name</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-8><a class=lnlinks href=#hl-4-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>crossplane.io/claim-namespace</span><span class=p>:</span><span class=w> </span><span class=l>default</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-9><a class=lnlinks href=#hl-4-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>crossplane.io/composite</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim-978mh</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-10><a class=lnlinks href=#hl-4-10>10</a></span><span class=cl><span class=w></span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-11><a class=lnlinks href=#hl-4-11>11</a></span><span class=cl><span class=w> </span><span class=nt>desiredRegion</span><span class=p>:</span><span class=w> </span><span class=l>eu-north-1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-12><a class=lnlinks href=#hl-4-12>12</a></span><span class=cl><span class=w> </span><span class=nt>field1</span><span class=p>:</span><span class=w> </span><span class=l>field1-text</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-13><a class=lnlinks href=#hl-4-13>13</a></span><span class=cl><span class=w> </span><span class=nt>resourceRefs</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-14><a class=lnlinks href=#hl-4-14>14</a></span><span class=cl><span class=w> </span>- <span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-15><a class=lnlinks href=#hl-4-15>15</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-16><a class=lnlinks href=#hl-4-16>16</a></span><span class=cl><span class=w> </span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim-978mh-r6z64</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-17><a class=lnlinks href=#hl-4-17>17</a></span><span class=cl><span class=w> </span>- <span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-18><a class=lnlinks href=#hl-4-18>18</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-19><a class=lnlinks href=#hl-4-19>19</a></span><span class=cl><span class=w> </span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim-978mh-cnlhj</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-20><a class=lnlinks href=#hl-4-20>20</a></span><span class=cl><span class=w> </span>- <span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-21><a class=lnlinks href=#hl-4-21>21</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-4-22><a class=lnlinks href=#hl-4-22>22</a></span><span class=cl><span class=w> </span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim-978mh-rv5nm</span><span class=w> </span></span></span></code></pre></div><h2 id=reuse-a-patch>Reuse a patch <a class=anchor-link id=reuse-a-patch href=#reuse-a-patch aria-label="Link to this section: Reuse a patch"></a></h2><p>You can reuse a patch object on multiple resources by using a PatchSet.</p><p>To create a PatchSet, define a <code>patchSets</code> object in the function’s input.</p><p>Each patch inside a PatchSet has a <code>name</code> and a list of <code>patches</code>.</p><p>Apply the PatchSet to a resource with a patch <code>type: PatchSet</code>. Set the <code>patchSetName</code> to the <code>name</code> of the PatchSet.</p><div class=highlight label=patchset><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-5-1><a class=lnlinks href=#hl-5-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-2><a class=lnlinks href=#hl-5-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-3><a class=lnlinks href=#hl-5-3> 3</a></span><span class=cl><span class=w></span><span class=nt>patchSets</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-4><a class=lnlinks href=#hl-5-4> 4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>my-patchset</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-5><a class=lnlinks href=#hl-5-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-6><a class=lnlinks href=#hl-5-6> 6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-7><a class=lnlinks href=#hl-5-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.desiredRegion</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-8><a class=lnlinks href=#hl-5-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.forProvider.region</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-9><a class=lnlinks href=#hl-5-9> 9</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-10><a class=lnlinks href=#hl-5-10>10</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>bucket1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-11><a class=lnlinks href=#hl-5-11>11</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-12><a class=lnlinks href=#hl-5-12>12</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-13><a class=lnlinks href=#hl-5-13>13</a></span><span class=cl><span class=w> </span><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-14><a class=lnlinks href=#hl-5-14>14</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>PatchSet</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-15><a class=lnlinks href=#hl-5-15>15</a></span><span class=cl><span class=w> </span><span class=nt>patchSetName</span><span class=p>:</span><span class=w> </span><span class=l>my-patchset</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-16><a class=lnlinks href=#hl-5-16>16</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>bucket2</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-17><a class=lnlinks href=#hl-5-17>17</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-18><a class=lnlinks href=#hl-5-18>18</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-19><a class=lnlinks href=#hl-5-19>19</a></span><span class=cl><span class=w> </span><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-20><a class=lnlinks href=#hl-5-20>20</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>PatchSet</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-5-21><a class=lnlinks href=#hl-5-21>21</a></span><span class=cl><span class=w> </span><span class=nt>patchSetName</span><span class=p>:</span><span class=w> </span><span class=l>my-patchset</span><span class=w> </span></span></span></code></pre></div><div class="admonition important d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="important:"><use xlink:href="#exclamation"/></svg><span class=ps-1>Important</span></div><div class=admonition-content><p>A PatchSet can’t contain other PatchSets.</p><p>Crossplane ignores any <a href=#transform-a-patch>transforms</a> or <a href=#patch-policies>policies</a> in a PatchSet.</p></div></div><h2 id=patching-between-resources>Patching between resources <a class=anchor-link id=patching-between-resources href=#patching-between-resources aria-label="Link to this section: Patching between resources"></a></h2><p>Function Patch and Transform can’t directly patch between two composed resources. For example, generating a network resource and patching the resource name to a compute resource.</p><p>A resource can patch to a user-defined <code>status</code> field in the composite resource. Another resource can then read from that <code>Status</code> field to patch a field.</p><p>First, define a custom <code>status</code> in the composite resource Definition and a custom field, for example <code>secondResource</code></p><div class=highlight label=xrdPatch copy-lines=13-17><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-6-1><a class=lnlinks href=#hl-6-1> 1</a></span><span class=cl><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>CompositeResourceDefinition</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-6-2><a class=lnlinks href=#hl-6-2> 2</a></span><span class=cl><span class=w></span><span class=c># Removed for brevity.</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-6-3><a class=lnlinks href=#hl-6-3> 3</a></span><span class=cl><span class=w></span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-6-4><a class=lnlinks href=#hl-6-4> 4</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity.</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-6-5><a class=lnlinks href=#hl-6-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>versions</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-6-6><a class=lnlinks href=#hl-6-6> 6</a></span><span class=cl><span class=w> </span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>v1alpha1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-6-7><a class=lnlinks href=#hl-6-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>schema</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-6-8><a class=lnlinks href=#hl-6-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>openAPIV3Schema</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-6-9><a class=lnlinks href=#hl-6-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>object</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-6-10><a class=lnlinks href=#hl-6-10>10</a></span><span class=cl><span class=w> </span><span class=nt>properties</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-6-11><a class=lnlinks href=#hl-6-11>11</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-6-12><a class=lnlinks href=#hl-6-12>12</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity.</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-6-13><a class=lnlinks href=#hl-6-13>13</a></span><span class=cl><span class=w> </span><span class=nt>status</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-6-14><a class=lnlinks href=#hl-6-14>14</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>object</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-6-15><a class=lnlinks href=#hl-6-15>15</a></span><span class=cl><span class=w> </span><span class=nt>properties</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-6-16><a class=lnlinks href=#hl-6-16>16</a></span><span class=cl><span class=w> </span><span class=nt>secondResource</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-6-17><a class=lnlinks href=#hl-6-17>17</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span></code></pre></div><p>Inside the function input the resource with the source data uses a <code>ToCompositeFieldPath</code> patch to write data to the <code>status.secondResource</code> field in the composite resource.</p><p>The destination resource uses a <code>FromCompositeFieldPath</code> patch to read data from the composite resource <code>status.secondResource</code> field in the composite resource and write it to a label named <code>secondResource</code> in the managed resource.</p><div class=highlight label=patchBetween copy-lines=9-11><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-7-1><a class=lnlinks href=#hl-7-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-2><a class=lnlinks href=#hl-7-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-3><a class=lnlinks href=#hl-7-3> 3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-4><a class=lnlinks href=#hl-7-4> 4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>bucket1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-5><a class=lnlinks href=#hl-7-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-6><a class=lnlinks href=#hl-7-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-7><a class=lnlinks href=#hl-7-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-8><a class=lnlinks href=#hl-7-8> 8</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-9><a class=lnlinks href=#hl-7-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-10><a class=lnlinks href=#hl-7-10>10</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>ToCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-11><a class=lnlinks href=#hl-7-11>11</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.name</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-12><a class=lnlinks href=#hl-7-12>12</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>status.secondResource</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-13><a class=lnlinks href=#hl-7-13>13</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>bucket2</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-14><a class=lnlinks href=#hl-7-14>14</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-15><a class=lnlinks href=#hl-7-15>15</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-16><a class=lnlinks href=#hl-7-16>16</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-17><a class=lnlinks href=#hl-7-17>17</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-18><a class=lnlinks href=#hl-7-18>18</a></span><span class=cl><span class=w> </span><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-19><a class=lnlinks href=#hl-7-19>19</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-20><a class=lnlinks href=#hl-7-20>20</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>status.secondResource</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-7-21><a class=lnlinks href=#hl-7-21>21</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.labels['secondResource']</span><span class=w> </span></span></span></code></pre></div><p>Describe the composite resource to view the <code>resources</code> and the <code>status.secondResource</code> value.</p><div class=highlight label=descCompPatch copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-8-1><a class=lnlinks href=#hl-8-1> 1</a></span><span class=cl><span class=l>$ kubectl describe composite</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-8-2><a class=lnlinks href=#hl-8-2> 2</a></span><span class=cl><span class=w></span><span class=nt>Name</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim-jp7rx</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-8-3><a class=lnlinks href=#hl-8-3> 3</a></span><span class=cl><span class=w></span><span class=nt>Spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-8-4><a class=lnlinks href=#hl-8-4> 4</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-8-5><a class=lnlinks href=#hl-8-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>Resource Refs</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-8-6><a class=lnlinks href=#hl-8-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>Name</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim-jp7rx-gfg4m</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-8-7><a class=lnlinks href=#hl-8-7> 7</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-8-8><a class=lnlinks href=#hl-8-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>Name</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim-jp7rx-fttpj</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-8-9><a class=lnlinks href=#hl-8-9> 9</a></span><span class=cl><span class=w></span><span class=nt>Status</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-8-10><a class=lnlinks href=#hl-8-10>10</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-8-11><a class=lnlinks href=#hl-8-11>11</a></span><span class=cl><span class=w> </span><span class=nt>Second Resource</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim-jp7rx-gfg4m</span><span class=w> </span></span></span></code></pre></div><p>Describe the destination managed resource to see the label <code>secondResource</code>.</p><div class=highlight label=bucketlabel copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-9-1><a class=lnlinks href=#hl-9-1>1</a></span><span class=cl><span class=l>$ kubectl describe bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-9-2><a class=lnlinks href=#hl-9-2>2</a></span><span class=cl><span class=w></span><span class=l>kubectl describe bucket my-example-claim-jp7rx-fttpj</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-9-3><a class=lnlinks href=#hl-9-3>3</a></span><span class=cl><span class=w></span><span class=nt>Name</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim-jp7rx-fttpj</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-9-4><a class=lnlinks href=#hl-9-4>4</a></span><span class=cl><span class=w></span><span class=nt>Labels</span><span class=p>:</span><span class=w> </span><span class=l>crossplane.io/composite=my-example-claim-jp7rx</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-9-5><a class=lnlinks href=#hl-9-5>5</a></span><span class=cl><span class=w> </span><span class=l>secondResource=my-example-claim-jp7rx-gfg4m</span><span class=w> </span></span></span></code></pre></div><h2 id=patch-with-environmentconfigs>Patch with EnvironmentConfigs <a class=anchor-link id=patch-with-environmentconfigs href=#patch-with-environmentconfigs aria-label="Link to this section: Patch with EnvironmentConfigs"></a></h2><p>Crossplane uses EnvironmentConfigs to create in-memory data stores. Compositions can read and write from this data store as part of the patch process.</p><p>EnvironmentConfigs can predefine data that Compositions can use or a composite resource can write data to their in-memory environment for other resources to read.</p><div class="admonition note d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="note:"><use xlink:href="#info"/></svg><span class=ps-1>Note</span></div><div class=admonition-content><p>Read the <a href=https://docs.crossplane.io/v1.18/concepts/environment-configs/>EnvironmentConfigs</a> page for more information on using EnvironmentConfigs.</div></div><p>To apply a patch using EnvironmentConfigs, first define which EnvironmentConfigs to use with <code>environment.environmentConfigs</code>.</p><p>Use either a <a href=https://docs.crossplane.io/v1.18/concepts/managed-resources/#matching-by-name-reference>reference</a> or a <a href=https://docs.crossplane.io/v1.18/concepts/managed-resources/#matching-by-selector>selector</a> to identify the EnvironmentConfigs to use.</p><div class=highlight label=envselect copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-10-1><a class=lnlinks href=#hl-10-1>1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>apiextensions.crossplane.io/v1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-10-2><a class=lnlinks href=#hl-10-2>2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Composition</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-10-3><a class=lnlinks href=#hl-10-3>3</a></span><span class=cl><span class=w></span><span class=c># Removed for Brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-10-4><a class=lnlinks href=#hl-10-4>4</a></span><span class=cl><span class=w></span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-10-5><a class=lnlinks href=#hl-10-5>5</a></span><span class=cl><span class=w> </span><span class=nt>environment</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-10-6><a class=lnlinks href=#hl-10-6>6</a></span><span class=cl><span class=w> </span><span class=nt>environmentConfigs</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-10-7><a class=lnlinks href=#hl-10-7>7</a></span><span class=cl><span class=w> </span>- <span class=nt>ref</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-10-8><a class=lnlinks href=#hl-10-8>8</a></span><span class=cl><span class=w> </span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>example-environment</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-10-9><a class=lnlinks href=#hl-10-9>9</a></span><span class=cl><span class=w> </span><span class=c># Removed for Brevity</span><span class=w> </span></span></span></code></pre></div><h3 id=patch-a-composite-resource>Patch a composite resource <a class=anchor-link id=patch-a-composite-resource href=#patch-a-composite-resource aria-label="Link to this section: Patch a composite resource"></a></h3><p>To patch between the composite resource and the in-memory environment use <code>patches</code> inside of the <code>environment</code>.</p><p>Use the <code>ToCompositeFieldPath</code> to copy data from the in-memory environment to the composite resource.</p><p>Use the <code>FromCompositeFieldPath</code> to copy data from the composite resource to the in-memory environment.</p><div class=highlight label=xrpatch copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-11-1><a class=lnlinks href=#hl-11-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-11-2><a class=lnlinks href=#hl-11-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-11-3><a class=lnlinks href=#hl-11-3> 3</a></span><span class=cl><span class=w></span><span class=nt>environment</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-11-4><a class=lnlinks href=#hl-11-4> 4</a></span><span class=cl><span class=w> </span><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-11-5><a class=lnlinks href=#hl-11-5> 5</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>ToCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-11-6><a class=lnlinks href=#hl-11-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>tags</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-11-7><a class=lnlinks href=#hl-11-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.labels[envTag]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-11-8><a class=lnlinks href=#hl-11-8> 8</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-11-9><a class=lnlinks href=#hl-11-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.name</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-11-10><a class=lnlinks href=#hl-11-10>10</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>newEnvironmentKey</span><span class=w> </span></span></span></code></pre></div><p>Individual resources can use any data written to their in-memory environment.</p><h3 id=patch-an-individual-resource>Patch an individual resource <a class=anchor-link id=patch-an-individual-resource href=#patch-an-individual-resource aria-label="Link to this section: Patch an individual resource"></a></h3><p>To patch an individual resource, inside the <code>patches</code> of the resource, use <code>ToEnvironmentFieldPath</code> to copy data from the resource to the in-memory environment.</p><p>Use <code>FromEnvironmentFieldPath</code> to copy data to the resource from the in-memory environment.</p><div class=highlight label=envpatch copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-12-1><a class=lnlinks href=#hl-12-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-12-2><a class=lnlinks href=#hl-12-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-12-3><a class=lnlinks href=#hl-12-3> 3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-12-4><a class=lnlinks href=#hl-12-4> 4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>vpc</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-12-5><a class=lnlinks href=#hl-12-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-12-6><a class=lnlinks href=#hl-12-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>ec2.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-12-7><a class=lnlinks href=#hl-12-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>VPC</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-12-8><a class=lnlinks href=#hl-12-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-12-9><a class=lnlinks href=#hl-12-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>forProvider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-12-10><a class=lnlinks href=#hl-12-10>10</a></span><span class=cl><span class=w> </span><span class=nt>cidrBlock</span><span class=p>:</span><span class=w> </span><span class=m>172.16.0.0</span><span class=l>/16</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-12-11><a class=lnlinks href=#hl-12-11>11</a></span><span class=cl><span class=w> </span><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-12-12><a class=lnlinks href=#hl-12-12>12</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>ToEnvironmentFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-12-13><a class=lnlinks href=#hl-12-13>13</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>status.atProvider.id</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-12-14><a class=lnlinks href=#hl-12-14>14</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>vpcId</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-12-15><a class=lnlinks href=#hl-12-15>15</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromEnvironmentFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-12-16><a class=lnlinks href=#hl-12-16>16</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>tags</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-12-17><a class=lnlinks href=#hl-12-17>17</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.forProvider.tags</span><span class=w> </span></span></span></code></pre></div><p>The <a href=https://docs.crossplane.io/v1.18/concepts/environment-configs/>EnvironmentConfigs</a> page has more information on EnvironmentConfigs options and usage.</p><h2 id=types-of-patches>Types of patches <a class=anchor-link id=types-of-patches href=#types-of-patches aria-label="Link to this section: Types of patches"></a></h2><p>Function Patch and Transform supports multiple patch types, each using a different source for data and applying the patch to a different location.</p><p>Summary of Crossplane patches<div class="table-responsive border rounded"><table class="table table-hover"><thead><tr><th>Patch Type</th><th>Data Source</th><th>Data Destination</th></tr></thead><tbody><tr><td><a href=#fromcompositefieldpath>FromCompositeFieldPath</a></td><td>A field in the composite resource.</td><td>A field in the composed resource.</td></tr><tr><td><a href=#tocompositefieldpath>ToCompositeFieldPath</a></td><td>A field in the composed resource.</td><td>A field in the composite resource.</td></tr><tr><td><a href=#combinefromcomposite>CombineFromComposite</a></td><td>Multiple fields in the composite resource.</td><td>A field in the composed resource.</td></tr><tr><td><a href=#combinetocomposite>CombineToComposite</a></td><td>Multiple fields in the composed resource.</td><td>A field in the composite resource.</td></tr><tr><td><a href=#fromenvironmentfieldpath>FromEnvironmentFieldPath</a></td><td>Data in the in-memory environment</td><td>A field in the composed resource.</td></tr><tr><td><a href=#toenvironmentfieldpath>ToEnvironmentFieldPath</a></td><td>A field in the composed resource.</td><td>The in-memory environment.</td></tr><tr><td><a href=#combinefromenvironment>CombineFromEnvironment</a></td><td>Multiple fields in the in-memory environment.</td><td>A field in the composed resource.</td></tr><tr><td><a href=#combinetoenvironment>CombineToEnvironment</a></td><td>Multiple fields in the composed resource.</td><td>A field in the in-memory environment.</td></tr></tbody></table></div></p><div class="admonition note d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="note:"><use xlink:href="#info"/></svg><span class=ps-1>Note</span></div><div class=admonition-content><p>All the following examples use the same set of Compositions, CompositeResourceDefinitions, Claims and EnvironmentConfigs. Only the applied patches change between examples.</p><p>All examples rely on Upbound <a href=https://marketplace.upbound.io/providers/upbound/provider-aws-s3/>provider-aws-s3</a> to create resources.</p><div class="accordion mb-3" id=reference-composition-555-Parent><div class=accordion-item><h2 class=accordion-header id=reference-composition-555><button class="accordion-button collapsed" type=button data-bs-toggle=collapse data-bs-target=#reference-composition-555-Content aria-expanded=false aria-controls=reference-composition-555-Content> Reference Composition</button></h2><div id=reference-composition-555-Content class="accordion-collapse collapse" aria-labelledby=reference-composition-555 data-bs-parent=#reference-composition-555-Parent><div class="accordion-body rounded-bottom"><div class=highlight copy-lines=all><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-0-1><a class=lnlinks href=#hl-0-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>apiextensions.crossplane.io/v1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-2><a class=lnlinks href=#hl-0-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Composition</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-3><a class=lnlinks href=#hl-0-3> 3</a></span><span class=cl><span class=w></span><span class=nt>metadata</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-4><a class=lnlinks href=#hl-0-4> 4</a></span><span class=cl><span class=w> </span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>example-composition</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-5><a class=lnlinks href=#hl-0-5> 5</a></span><span class=cl><span class=w></span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-6><a class=lnlinks href=#hl-0-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>compositeTypeRef</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-7><a class=lnlinks href=#hl-0-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>example.org/v1alpha1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-8><a class=lnlinks href=#hl-0-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>xExample</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-9><a class=lnlinks href=#hl-0-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>environment</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-10><a class=lnlinks href=#hl-0-10>10</a></span><span class=cl><span class=w> </span><span class=nt>environmentConfigs</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-11><a class=lnlinks href=#hl-0-11>11</a></span><span class=cl><span class=w> </span>- <span class=nt>ref</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-12><a class=lnlinks href=#hl-0-12>12</a></span><span class=cl><span class=w> </span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>example-environment</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-13><a class=lnlinks href=#hl-0-13>13</a></span><span class=cl><span class=w> </span><span class=nt>mode</span><span class=p>:</span><span class=w> </span><span class=l>Pipeline</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-14><a class=lnlinks href=#hl-0-14>14</a></span><span class=cl><span class=w> </span><span class=nt>pipeline</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-15><a class=lnlinks href=#hl-0-15>15</a></span><span class=cl><span class=w> </span>- <span class=nt>step</span><span class=p>:</span><span class=w> </span><span class=l>patch-and-transform</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-16><a class=lnlinks href=#hl-0-16>16</a></span><span class=cl><span class=w> </span><span class=nt>functionRef</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-17><a class=lnlinks href=#hl-0-17>17</a></span><span class=cl><span class=w> </span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>function-patch-and-transform</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-18><a class=lnlinks href=#hl-0-18>18</a></span><span class=cl><span class=w> </span><span class=nt>input</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-19><a class=lnlinks href=#hl-0-19>19</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-20><a class=lnlinks href=#hl-0-20>20</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-21><a class=lnlinks href=#hl-0-21>21</a></span><span class=cl><span class=w> </span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-22><a class=lnlinks href=#hl-0-22>22</a></span><span class=cl><span class=w> </span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>bucket1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-23><a class=lnlinks href=#hl-0-23>23</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-24><a class=lnlinks href=#hl-0-24>24</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-25><a class=lnlinks href=#hl-0-25>25</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-26><a class=lnlinks href=#hl-0-26>26</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-27><a class=lnlinks href=#hl-0-27>27</a></span><span class=cl><span class=w> </span><span class=nt>forProvider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-28><a class=lnlinks href=#hl-0-28>28</a></span><span class=cl><span class=w> </span><span class=nt>region</span><span class=p>:</span><span class=w> </span><span class=l>us-east-2</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-29><a class=lnlinks href=#hl-0-29>29</a></span><span class=cl><span class=w> </span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>bucket2</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-30><a class=lnlinks href=#hl-0-30>30</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-31><a class=lnlinks href=#hl-0-31>31</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-32><a class=lnlinks href=#hl-0-32>32</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-33><a class=lnlinks href=#hl-0-33>33</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-34><a class=lnlinks href=#hl-0-34>34</a></span><span class=cl><span class=w> </span><span class=nt>forProvider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-35><a class=lnlinks href=#hl-0-35>35</a></span><span class=cl><span class=w> </span><span class=nt>region</span><span class=p>:</span><span class=w> </span><span class=l>us-east-2</span><span class=w> </span></span></span></code></pre></div></div></div></div></div><div class="accordion mb-3" id=reference-compositeresourcedefinition-1640-Parent><div class=accordion-item><h2 class=accordion-header id=reference-compositeresourcedefinition-1640><button class="accordion-button collapsed" type=button data-bs-toggle=collapse data-bs-target=#reference-compositeresourcedefinition-1640-Content aria-expanded=false aria-controls=reference-compositeresourcedefinition-1640-Content> Reference CompositeResourceDefinition</button></h2><div id=reference-compositeresourcedefinition-1640-Content class="accordion-collapse collapse" aria-labelledby=reference-compositeresourcedefinition-1640 data-bs-parent=#reference-compositeresourcedefinition-1640-Parent><div class="accordion-body rounded-bottom"><div class=highlight copy-lines=all><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-0-1><a class=lnlinks href=#hl-0-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>apiextensions.crossplane.io/v1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-2><a class=lnlinks href=#hl-0-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>CompositeResourceDefinition</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-3><a class=lnlinks href=#hl-0-3> 3</a></span><span class=cl><span class=w></span><span class=nt>metadata</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-4><a class=lnlinks href=#hl-0-4> 4</a></span><span class=cl><span class=w> </span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>xexamples.example.org</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-5><a class=lnlinks href=#hl-0-5> 5</a></span><span class=cl><span class=w></span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-6><a class=lnlinks href=#hl-0-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>group</span><span class=p>:</span><span class=w> </span><span class=l>example.org</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-7><a class=lnlinks href=#hl-0-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>names</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-8><a class=lnlinks href=#hl-0-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>xExample</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-9><a class=lnlinks href=#hl-0-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>plural</span><span class=p>:</span><span class=w> </span><span class=l>xexamples</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-10><a class=lnlinks href=#hl-0-10>10</a></span><span class=cl><span class=w> </span><span class=nt>claimNames</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-11><a class=lnlinks href=#hl-0-11>11</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>ExampleClaim</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-12><a class=lnlinks href=#hl-0-12>12</a></span><span class=cl><span class=w> </span><span class=nt>plural</span><span class=p>:</span><span class=w> </span><span class=l>exampleclaims</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-13><a class=lnlinks href=#hl-0-13>13</a></span><span class=cl><span class=w> </span><span class=nt>versions</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-14><a class=lnlinks href=#hl-0-14>14</a></span><span class=cl><span class=w> </span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>v1alpha1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-15><a class=lnlinks href=#hl-0-15>15</a></span><span class=cl><span class=w> </span><span class=nt>served</span><span class=p>:</span><span class=w> </span><span class=kc>true</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-16><a class=lnlinks href=#hl-0-16>16</a></span><span class=cl><span class=w> </span><span class=nt>referenceable</span><span class=p>:</span><span class=w> </span><span class=kc>true</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-17><a class=lnlinks href=#hl-0-17>17</a></span><span class=cl><span class=w> </span><span class=nt>schema</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-18><a class=lnlinks href=#hl-0-18>18</a></span><span class=cl><span class=w> </span><span class=nt>openAPIV3Schema</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-19><a class=lnlinks href=#hl-0-19>19</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>object</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-20><a class=lnlinks href=#hl-0-20>20</a></span><span class=cl><span class=w> </span><span class=nt>properties</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-21><a class=lnlinks href=#hl-0-21>21</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-22><a class=lnlinks href=#hl-0-22>22</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>object</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-23><a class=lnlinks href=#hl-0-23>23</a></span><span class=cl><span class=w> </span><span class=nt>properties</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-24><a class=lnlinks href=#hl-0-24>24</a></span><span class=cl><span class=w> </span><span class=nt>field1</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-25><a class=lnlinks href=#hl-0-25>25</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-26><a class=lnlinks href=#hl-0-26>26</a></span><span class=cl><span class=w> </span><span class=nt>field2</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-27><a class=lnlinks href=#hl-0-27>27</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-28><a class=lnlinks href=#hl-0-28>28</a></span><span class=cl><span class=w> </span><span class=nt>field3</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-29><a class=lnlinks href=#hl-0-29>29</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-30><a class=lnlinks href=#hl-0-30>30</a></span><span class=cl><span class=w> </span><span class=nt>desiredRegion</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-31><a class=lnlinks href=#hl-0-31>31</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-32><a class=lnlinks href=#hl-0-32>32</a></span><span class=cl><span class=w> </span><span class=nt>boolField</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-33><a class=lnlinks href=#hl-0-33>33</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>boolean</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-34><a class=lnlinks href=#hl-0-34>34</a></span><span class=cl><span class=w> </span><span class=nt>numberField</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-35><a class=lnlinks href=#hl-0-35>35</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>integer</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-36><a class=lnlinks href=#hl-0-36>36</a></span><span class=cl><span class=w> </span><span class=nt>status</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-37><a class=lnlinks href=#hl-0-37>37</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>object</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-38><a class=lnlinks href=#hl-0-38>38</a></span><span class=cl><span class=w> </span><span class=nt>properties</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-39><a class=lnlinks href=#hl-0-39>39</a></span><span class=cl><span class=w> </span><span class=nt>url</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-40><a class=lnlinks href=#hl-0-40>40</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span></code></pre></div></div></div></div></div><div class="accordion mb-3" id=reference-claim-368-Parent><div class=accordion-item><h2 class=accordion-header id=reference-claim-368><button class="accordion-button collapsed" type=button data-bs-toggle=collapse data-bs-target=#reference-claim-368-Content aria-expanded=false aria-controls=reference-claim-368-Content> Reference Claim</button></h2><div id=reference-claim-368-Content class="accordion-collapse collapse" aria-labelledby=reference-claim-368 data-bs-parent=#reference-claim-368-Parent><div class="accordion-body rounded-bottom"><div class=highlight copy-lines=all><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-0-1><a class=lnlinks href=#hl-0-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>example.org/v1alpha1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-2><a class=lnlinks href=#hl-0-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>ExampleClaim</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-3><a class=lnlinks href=#hl-0-3> 3</a></span><span class=cl><span class=w></span><span class=nt>metadata</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-4><a class=lnlinks href=#hl-0-4> 4</a></span><span class=cl><span class=w> </span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-5><a class=lnlinks href=#hl-0-5> 5</a></span><span class=cl><span class=w></span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-6><a class=lnlinks href=#hl-0-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>field1</span><span class=p>:</span><span class=w> </span><span class=s2>"field1-text"</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-7><a class=lnlinks href=#hl-0-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>field2</span><span class=p>:</span><span class=w> </span><span class=s2>"field2-text"</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-8><a class=lnlinks href=#hl-0-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>desiredRegion</span><span class=p>:</span><span class=w> </span><span class=s2>"eu-north-1"</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-9><a class=lnlinks href=#hl-0-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>boolField</span><span class=p>:</span><span class=w> </span><span class=kc>false</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-10><a class=lnlinks href=#hl-0-10>10</a></span><span class=cl><span class=w> </span><span class=nt>numberField</span><span class=p>:</span><span class=w> </span><span class=m>10</span><span class=w> </span></span></span></code></pre></div></div></div></div></div><div class="accordion mb-3" id=reference-environmentconfig-1126-Parent><div class=accordion-item><h2 class=accordion-header id=reference-environmentconfig-1126><button class="accordion-button collapsed" type=button data-bs-toggle=collapse data-bs-target=#reference-environmentconfig-1126-Content aria-expanded=false aria-controls=reference-environmentconfig-1126-Content> Reference EnvironmentConfig</button></h2><div id=reference-environmentconfig-1126-Content class="accordion-collapse collapse" aria-labelledby=reference-environmentconfig-1126 data-bs-parent=#reference-environmentconfig-1126-Parent><div class="accordion-body rounded-bottom"><div class=highlight copy-lines=all><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-0-1><a class=lnlinks href=#hl-0-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>apiextensions.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-2><a class=lnlinks href=#hl-0-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>EnvironmentConfig</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-3><a class=lnlinks href=#hl-0-3> 3</a></span><span class=cl><span class=w></span><span class=nt>metadata</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-4><a class=lnlinks href=#hl-0-4> 4</a></span><span class=cl><span class=w> </span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>example-environment</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-5><a class=lnlinks href=#hl-0-5> 5</a></span><span class=cl><span class=w></span><span class=nt>data</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-6><a class=lnlinks href=#hl-0-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>locations</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-7><a class=lnlinks href=#hl-0-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>us</span><span class=p>:</span><span class=w> </span><span class=l>us-east-2</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-8><a class=lnlinks href=#hl-0-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>eu</span><span class=p>:</span><span class=w> </span><span class=l>eu-north-1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-9><a class=lnlinks href=#hl-0-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>key1</span><span class=p>:</span><span class=w> </span><span class=l>value1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-0-10><a class=lnlinks href=#hl-0-10>10</a></span><span class=cl><span class=w> </span><span class=nt>key2</span><span class=p>:</span><span class=w> </span><span class=l>value2</span><span class=w> </span></span></span></code></pre></div></div></div></div></div></div></div><h3 id=fromcompositefieldpath>FromCompositeFieldPath <a class=anchor-link id=fromcompositefieldpath href=#fromcompositefieldpath aria-label="Link to this section: FromCompositeFieldPath"></a></h3><p>The <code>FromCompositeFieldPath</code> patch takes a value in a composite resource and applies it to a field in the composed resource.</p><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content>Use the <code>FromCompositeFieldPath</code> patch to apply options from users in their Claims to settings in managed resource <code>forProvider</code> settings.</div></div><p>For example, to use the value <code>desiredRegion</code> provided by a user in a composite resource to a managed resource’s <code>region</code>.</p><p>The <code>fromFieldPath</code> value is a field in the composite resource.</p><p>The <code>toFieldPath</code> value is the field in the composed resource to change.</p><div class=highlight label=fromComposite copy-lines=9-11><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-13-1><a class=lnlinks href=#hl-13-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-13-2><a class=lnlinks href=#hl-13-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-13-3><a class=lnlinks href=#hl-13-3> 3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-13-4><a class=lnlinks href=#hl-13-4> 4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>bucket1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-13-5><a class=lnlinks href=#hl-13-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-13-6><a class=lnlinks href=#hl-13-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-13-7><a class=lnlinks href=#hl-13-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-13-8><a class=lnlinks href=#hl-13-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-13-9><a class=lnlinks href=#hl-13-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>forProvider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-13-10><a class=lnlinks href=#hl-13-10>10</a></span><span class=cl><span class=w> </span><span class=nt>region</span><span class=p>:</span><span class=w> </span><span class=l>us-east-2</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-13-11><a class=lnlinks href=#hl-13-11>11</a></span><span class=cl><span class=w> </span><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-13-12><a class=lnlinks href=#hl-13-12>12</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-13-13><a class=lnlinks href=#hl-13-13>13</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.desiredRegion</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-13-14><a class=lnlinks href=#hl-13-14>14</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.forProvider.region</span><span class=w> </span></span></span></code></pre></div><p>View the managed resource to see the updated <code>region</code></p><div class=highlight label=fromCompMR copy-lines=1><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-14-1><a class=lnlinks href=#hl-14-1>1</a></span><span class=cl><span class=l>$ kubectl describe bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-14-2><a class=lnlinks href=#hl-14-2>2</a></span><span class=cl><span class=w></span><span class=nt>Name</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim-qlr68-29nqf</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-14-3><a class=lnlinks href=#hl-14-3>3</a></span><span class=cl><span class=w></span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-14-4><a class=lnlinks href=#hl-14-4>4</a></span><span class=cl><span class=w></span><span class=nt>Spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-14-5><a class=lnlinks href=#hl-14-5>5</a></span><span class=cl><span class=w> </span><span class=nt>For Provider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-14-6><a class=lnlinks href=#hl-14-6>6</a></span><span class=cl><span class=w> </span><span class=nt>Region</span><span class=p>:</span><span class=w> </span><span class=l>eu-north-1</span><span class=w> </span></span></span></code></pre></div><h3 id=tocompositefieldpath>ToCompositeFieldPath <a class=anchor-link id=tocompositefieldpath href=#tocompositefieldpath aria-label="Link to this section: ToCompositeFieldPath"></a></h3><p>The <code>ToCompositeFieldPath</code> writes data from an individual composed resource to the composite resource that created it.</p><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content>Use <code>ToCompositeFieldPath</code> patches to take data from one composed resource in a Composition and use it in a second composed resource in the same Composition.</div></div><p>For example, after Crossplane creates a new managed resource, take the value <code>hostedZoneID</code> and apply it as a <code>label</code> in the composite resource.</p><div class=highlight label=toComposite copy-lines=9-11><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-15-1><a class=lnlinks href=#hl-15-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-15-2><a class=lnlinks href=#hl-15-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-15-3><a class=lnlinks href=#hl-15-3> 3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-15-4><a class=lnlinks href=#hl-15-4> 4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>bucket1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-15-5><a class=lnlinks href=#hl-15-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-15-6><a class=lnlinks href=#hl-15-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-15-7><a class=lnlinks href=#hl-15-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-15-8><a class=lnlinks href=#hl-15-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-15-9><a class=lnlinks href=#hl-15-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>forProvider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-15-10><a class=lnlinks href=#hl-15-10>10</a></span><span class=cl><span class=w> </span><span class=nt>region</span><span class=p>:</span><span class=w> </span><span class=l>us-east-2</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-15-11><a class=lnlinks href=#hl-15-11>11</a></span><span class=cl><span class=w> </span><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-15-12><a class=lnlinks href=#hl-15-12>12</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>ToCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-15-13><a class=lnlinks href=#hl-15-13>13</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>status.atProvider.hostedZoneId</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-15-14><a class=lnlinks href=#hl-15-14>14</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.labels['ZoneID']</span><span class=w> </span></span></span></code></pre></div><p>View the created managed resource to see the <code>Hosted Zone Id</code> field.</p><div class=highlight label=toCompMR copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-16-1><a class=lnlinks href=#hl-16-1>1</a></span><span class=cl><span class=l>$ kubectl describe bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-16-2><a class=lnlinks href=#hl-16-2>2</a></span><span class=cl><span class=w></span><span class=nt>Name</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim-p5pxf-5vnp8</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-16-3><a class=lnlinks href=#hl-16-3>3</a></span><span class=cl><span class=w></span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-16-4><a class=lnlinks href=#hl-16-4>4</a></span><span class=cl><span class=w></span><span class=nt>Status</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-16-5><a class=lnlinks href=#hl-16-5>5</a></span><span class=cl><span class=w> </span><span class=nt>At Provider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-16-6><a class=lnlinks href=#hl-16-6>6</a></span><span class=cl><span class=w> </span><span class=nt>Hosted Zone Id</span><span class=p>:</span><span class=w> </span><span class=l>Z2O1EMRO9K5GLX</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-16-7><a class=lnlinks href=#hl-16-7>7</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span></code></pre></div><p>Next view the composite resource and confirm the patch applied the <code>label</code></p><div class=highlight label=toCompositeXR copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-17-1><a class=lnlinks href=#hl-17-1>1</a></span><span class=cl><span class=l>$ kubectl describe composite</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-17-2><a class=lnlinks href=#hl-17-2>2</a></span><span class=cl><span class=w></span><span class=nt>Name</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim-p5pxf</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-17-3><a class=lnlinks href=#hl-17-3>3</a></span><span class=cl><span class=w></span><span class=nt>Labels</span><span class=p>:</span><span class=w> </span><span class=l>ZoneID=Z2O1EMRO9K5GLX</span><span class=w> </span></span></span></code></pre></div><h3 id=combinefromcomposite>CombineFromComposite <a class=anchor-link id=combinefromcomposite href=#combinefromcomposite aria-label="Link to this section: CombineFromComposite"></a></h3><p>The <code>CombineFromComposite</code> patch takes values from the composite resource, combines them and applies them to the composed resource.</p><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content>Use the <code>CombineFromComposite</code> patch to create complex strings, like security policies and apply them to a composed resource.</div></div><p>For example, use the Claim value <code>desiredRegion</code> and <code>field2</code> to generate the managed resource’s <code>name</code></p><p>The <code>CombineFromComposite</code> patch only supports the <code>combine</code> option.</p><p>The <code>variables</code> are the list of <code>fromFieldPath</code> values from the composite resource to combine.</p><p>The only supported <code>strategy</code> is <code>strategy: string</code>.</p><p>Optionally you can apply a <code>string.fmt</code>, based on <a href=https://pkg.go.dev/fmt>Go string formatting</a> to specify how to combine the strings.</p><p>The <code>toFieldPath</code> is the field in the composed resource to apply the new string to.</p><div class=highlight label=combineFromComp copy-lines=11-20><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-18-1><a class=lnlinks href=#hl-18-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-2><a class=lnlinks href=#hl-18-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-3><a class=lnlinks href=#hl-18-3> 3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-4><a class=lnlinks href=#hl-18-4> 4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>bucket1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-5><a class=lnlinks href=#hl-18-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-6><a class=lnlinks href=#hl-18-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-7><a class=lnlinks href=#hl-18-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-8><a class=lnlinks href=#hl-18-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-9><a class=lnlinks href=#hl-18-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>forProvider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-10><a class=lnlinks href=#hl-18-10>10</a></span><span class=cl><span class=w> </span><span class=nt>region</span><span class=p>:</span><span class=w> </span><span class=l>us-east-2</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-11><a class=lnlinks href=#hl-18-11>11</a></span><span class=cl><span class=w> </span><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-12><a class=lnlinks href=#hl-18-12>12</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>CombineFromComposite</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-13><a class=lnlinks href=#hl-18-13>13</a></span><span class=cl><span class=w> </span><span class=nt>combine</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-14><a class=lnlinks href=#hl-18-14>14</a></span><span class=cl><span class=w> </span><span class=nt>variables</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-15><a class=lnlinks href=#hl-18-15>15</a></span><span class=cl><span class=w> </span>- <span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.desiredRegion</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-16><a class=lnlinks href=#hl-18-16>16</a></span><span class=cl><span class=w> </span>- <span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.field2</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-17><a class=lnlinks href=#hl-18-17>17</a></span><span class=cl><span class=w> </span><span class=nt>strategy</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-18><a class=lnlinks href=#hl-18-18>18</a></span><span class=cl><span class=w> </span><span class=nt>string</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-19><a class=lnlinks href=#hl-18-19>19</a></span><span class=cl><span class=w> </span><span class=nt>fmt</span><span class=p>:</span><span class=w> </span><span class=s2>"my-resource-%s-%s"</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-18-20><a class=lnlinks href=#hl-18-20>20</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.name</span><span class=w> </span></span></span></code></pre></div><p>Describe the managed resource to see the applied patch.</p><div class=highlight label=describeCombineFromComp copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-19-1><a class=lnlinks href=#hl-19-1>1</a></span><span class=cl><span class=l>$ kubectl describe bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-19-2><a class=lnlinks href=#hl-19-2>2</a></span><span class=cl><span class=w></span><span class=nt>Name</span><span class=p>:</span><span class=w> </span><span class=l>my-resource-eu-north-1-field2-text</span><span class=w> </span></span></span></code></pre></div><h3 id=combinetocomposite>CombineToComposite <a class=anchor-link id=combinetocomposite href=#combinetocomposite aria-label="Link to this section: CombineToComposite"></a></h3><p>The <code>CombineToComposite</code> patch takes values from the composed resource, combines them and applies them to the composite resource.</p><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content>Use <code>CombineToComposite</code> patches to create a single field like a URL from multiple fields in a managed resource.</div></div><p>For example, use the managed resource <code>name</code> and <code>region</code> to generate a custom <code>url</code> field.</p><div class="admonition important d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="important:"><use xlink:href="#exclamation"/></svg><span class=ps-1>Important</span></div><div class=admonition-content>Writing custom fields in the status field of a composite resource requires defining the custom fields in the CompositeResourceDefinition first.</div></div><p>The <code>CombineToComposite</code> patch only supports the <code>combine</code> option.</p><p>The <code>variables</code> are the list of <code>fromFieldPath</code> the managed resource to combine.</p><p>The only supported <code>strategy</code> is <code>strategy: string</code>.</p><p>Optionally you can apply a <code>string.fmt</code>, based on <a href=https://pkg.go.dev/fmt>Go string formatting</a> to specify how to combine the strings.</p><p>The <code>toFieldPath</code> is the field in the composite resource to apply the new string to.</p><div class=highlight label=combineToComposite copy-lines=9-11><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-20-1><a class=lnlinks href=#hl-20-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-2><a class=lnlinks href=#hl-20-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-3><a class=lnlinks href=#hl-20-3> 3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-4><a class=lnlinks href=#hl-20-4> 4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>bucket1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-5><a class=lnlinks href=#hl-20-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-6><a class=lnlinks href=#hl-20-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-7><a class=lnlinks href=#hl-20-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-8><a class=lnlinks href=#hl-20-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-9><a class=lnlinks href=#hl-20-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>forProvider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-10><a class=lnlinks href=#hl-20-10>10</a></span><span class=cl><span class=w> </span><span class=nt>region</span><span class=p>:</span><span class=w> </span><span class=l>us-east-2</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-11><a class=lnlinks href=#hl-20-11>11</a></span><span class=cl><span class=w> </span><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-12><a class=lnlinks href=#hl-20-12>12</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>CombineToComposite</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-13><a class=lnlinks href=#hl-20-13>13</a></span><span class=cl><span class=w> </span><span class=nt>combine</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-14><a class=lnlinks href=#hl-20-14>14</a></span><span class=cl><span class=w> </span><span class=nt>variables</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-15><a class=lnlinks href=#hl-20-15>15</a></span><span class=cl><span class=w> </span>- <span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.name</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-16><a class=lnlinks href=#hl-20-16>16</a></span><span class=cl><span class=w> </span>- <span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.forProvider.region</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-17><a class=lnlinks href=#hl-20-17>17</a></span><span class=cl><span class=w> </span><span class=nt>strategy</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-18><a class=lnlinks href=#hl-20-18>18</a></span><span class=cl><span class=w> </span><span class=nt>string</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-19><a class=lnlinks href=#hl-20-19>19</a></span><span class=cl><span class=w> </span><span class=nt>fmt</span><span class=p>:</span><span class=w> </span><span class=s2>"https://%s.%s.com"</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-20-20><a class=lnlinks href=#hl-20-20>20</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>status.url</span><span class=w> </span></span></span></code></pre></div><p>View the composite resource to verify the applied patch.</p><div class=highlight copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-21-1><a class=lnlinks href=#hl-21-1>1</a></span><span class=cl><span class=l>$ kubectl describe composite</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-21-2><a class=lnlinks href=#hl-21-2>2</a></span><span class=cl><span class=w></span><span class=nt>Name</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim-bjdjw</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-21-3><a class=lnlinks href=#hl-21-3>3</a></span><span class=cl><span class=w></span><span class=nt>API Version</span><span class=p>:</span><span class=w> </span><span class=l>example.org/v1alpha1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-21-4><a class=lnlinks href=#hl-21-4>4</a></span><span class=cl><span class=w></span><span class=nt>Kind</span><span class=p>:</span><span class=w> </span><span class=l>xExample</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-21-5><a class=lnlinks href=#hl-21-5>5</a></span><span class=cl><span class=w></span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-21-6><a class=lnlinks href=#hl-21-6>6</a></span><span class=cl><span class=w></span><span class=nt>Status</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-21-7><a class=lnlinks href=#hl-21-7>7</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-21-8><a class=lnlinks href=#hl-21-8>8</a></span><span class=cl><span class=w> </span><span class=nt>URL</span><span class=p>:</span><span class=w> </span><span class=l>https://my-example-claim-bjdjw-r6ncd.us-east-2.com</span><span class=w> </span></span></span></code></pre></div><h3 id=fromenvironmentfieldpath>FromEnvironmentFieldPath <a class=anchor-link id=fromenvironmentfieldpath href=#fromenvironmentfieldpath aria-label="Link to this section: FromEnvironmentFieldPath"></a></h3><div class="admonition important d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="important:"><use xlink:href="#exclamation"/></svg><span class=ps-1>Important</span></div><div class=admonition-content><p>EnvironmentConfigs are an alpha feature. They aren’t enabled by default.</p><p>For more information about using an EnvironmentConfig, read the <a href=https://docs.crossplane.io/v1.18/concepts/environment-configs/>EnvironmentConfigs documentation</a>.</p></div></div><p>The <code>FromEnvironmentFieldPath</code> patch takes values from the in-memory environment and applies them to the composed resource.</p><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content>Use <code>FromEnvironmentFieldPath</code> to apply custom managed resource settings based on the current environment.</div></div><p>For example, use the environment’s <code>locations.eu</code> value and apply it as the <code>region</code>.</p><div class=highlight label=fromEnvField copy-lines=9-11><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-22-1><a class=lnlinks href=#hl-22-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-22-2><a class=lnlinks href=#hl-22-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-22-3><a class=lnlinks href=#hl-22-3> 3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-22-4><a class=lnlinks href=#hl-22-4> 4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>bucket1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-22-5><a class=lnlinks href=#hl-22-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-22-6><a class=lnlinks href=#hl-22-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-22-7><a class=lnlinks href=#hl-22-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-22-8><a class=lnlinks href=#hl-22-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-22-9><a class=lnlinks href=#hl-22-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>forProvider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-22-10><a class=lnlinks href=#hl-22-10>10</a></span><span class=cl><span class=w> </span><span class=nt>region</span><span class=p>:</span><span class=w> </span><span class=l>us-east-2</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-22-11><a class=lnlinks href=#hl-22-11>11</a></span><span class=cl><span class=w> </span><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-22-12><a class=lnlinks href=#hl-22-12>12</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromEnvironmentFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-22-13><a class=lnlinks href=#hl-22-13>13</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>locations.eu</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-22-14><a class=lnlinks href=#hl-22-14>14</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.forProvider.region</span><span class=w> </span></span></span></code></pre></div><p>Verify managed resource to confirm the applied patch.</p><div class=highlight copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-23-1><a class=lnlinks href=#hl-23-1>1</a></span><span class=cl><span class=l>kubectl describe bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-23-2><a class=lnlinks href=#hl-23-2>2</a></span><span class=cl><span class=w></span><span class=nt>Name</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim-8vrvc-xx5sr</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-23-3><a class=lnlinks href=#hl-23-3>3</a></span><span class=cl><span class=w></span><span class=nt>Labels</span><span class=p>:</span><span class=w> </span><span class=l>crossplane.io/claim-name=my-example-claim</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-23-4><a class=lnlinks href=#hl-23-4>4</a></span><span class=cl><span class=w></span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-23-5><a class=lnlinks href=#hl-23-5>5</a></span><span class=cl><span class=w></span><span class=nt>Spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-23-6><a class=lnlinks href=#hl-23-6>6</a></span><span class=cl><span class=w> </span><span class=nt>For Provider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-23-7><a class=lnlinks href=#hl-23-7>7</a></span><span class=cl><span class=w> </span><span class=nt>Region</span><span class=p>:</span><span class=w> </span><span class=l>eu-north-1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-23-8><a class=lnlinks href=#hl-23-8>8</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span></code></pre></div><h3 id=toenvironmentfieldpath>ToEnvironmentFieldPath <a class=anchor-link id=toenvironmentfieldpath href=#toenvironmentfieldpath aria-label="Link to this section: ToEnvironmentFieldPath"></a></h3><div class="admonition important d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="important:"><use xlink:href="#exclamation"/></svg><span class=ps-1>Important</span></div><div class=admonition-content>For more information about using an EnvironmentConfig, read the <a href=https://docs.crossplane.io/v1.18/concepts/environment-configs/>EnvironmentConfigs documentation</a>.</div></div><p>The <code>ToEnvironmentFieldPath</code> patch takes a value from the composed resource and applies it to the in-memory environment.</p><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content>Use <code>ToEnvironmentFieldPath</code> to write data to the environment that any FromEnvironmentFieldPath patch can access.</div></div><p>For example, use the desired <code>region</code> value and apply it as the environment’s <code>key1</code>.</p><div class=highlight label=toEnvField copy-lines=9-11><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-24-1><a class=lnlinks href=#hl-24-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-24-2><a class=lnlinks href=#hl-24-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-24-3><a class=lnlinks href=#hl-24-3> 3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-24-4><a class=lnlinks href=#hl-24-4> 4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>bucket1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-24-5><a class=lnlinks href=#hl-24-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-24-6><a class=lnlinks href=#hl-24-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-24-7><a class=lnlinks href=#hl-24-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-24-8><a class=lnlinks href=#hl-24-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-24-9><a class=lnlinks href=#hl-24-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>forProvider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-24-10><a class=lnlinks href=#hl-24-10>10</a></span><span class=cl><span class=w> </span><span class=nt>region</span><span class=p>:</span><span class=w> </span><span class=l>us-east-2</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-24-11><a class=lnlinks href=#hl-24-11>11</a></span><span class=cl><span class=w> </span><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-24-12><a class=lnlinks href=#hl-24-12>12</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>ToEnvironmentFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-24-13><a class=lnlinks href=#hl-24-13>13</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.forProvider.region</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-24-14><a class=lnlinks href=#hl-24-14>14</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>key1</span><span class=w> </span></span></span></code></pre></div><p>Because the environment is in-memory, there is no command to confirm the patch wrote the value to the environment.</p><h3 id=combinefromenvironment>CombineFromEnvironment <a class=anchor-link id=combinefromenvironment href=#combinefromenvironment aria-label="Link to this section: CombineFromEnvironment"></a></h3><div class="admonition important d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="important:"><use xlink:href="#exclamation"/></svg><span class=ps-1>Important</span></div><div class=admonition-content>For more information about using an EnvironmentConfig, read the <a href=https://docs.crossplane.io/v1.18/concepts/environment-configs/>EnvironmentConfigs documentation</a>.</div></div><p>The <code>CombineFromEnvironment</code> patch combines multiple values from the in-memory environment and applies them to the composed resource.</p><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content>Use <code>CombineFromEnvironment</code> patch to create complex strings, like security policies and apply them to a managed resource.</div></div><p>For example, combine multiple fields in the environment to create a unique <code>annotation</code> .</p><p>The <code>CombineFromEnvironment</code> patch only supports the <code>combine</code> option.</p><p>The only supported <code>strategy</code> is <code>strategy: string</code>.</p><p>The <code>variables</code> are the list of <code>fromFieldPath</code> values from the in-memory environment to combine.</p><p>Optionally you can apply a <code>string.fmt</code>, based on <a href=https://pkg.go.dev/fmt>Go string formatting</a> to specify how to combine the strings.</p><p>The <code>toFieldPath</code> is the field in the composed resource to apply the new string to.</p><div class=highlight label=combineFromEnv copy-lines=11-20><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-25-1><a class=lnlinks href=#hl-25-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-2><a class=lnlinks href=#hl-25-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-3><a class=lnlinks href=#hl-25-3> 3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-4><a class=lnlinks href=#hl-25-4> 4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>bucket1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-5><a class=lnlinks href=#hl-25-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-6><a class=lnlinks href=#hl-25-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-7><a class=lnlinks href=#hl-25-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-8><a class=lnlinks href=#hl-25-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-9><a class=lnlinks href=#hl-25-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>forProvider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-10><a class=lnlinks href=#hl-25-10>10</a></span><span class=cl><span class=w> </span><span class=nt>region</span><span class=p>:</span><span class=w> </span><span class=l>us-east-2</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-11><a class=lnlinks href=#hl-25-11>11</a></span><span class=cl><span class=w> </span><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-12><a class=lnlinks href=#hl-25-12>12</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>CombineFromEnvironment</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-13><a class=lnlinks href=#hl-25-13>13</a></span><span class=cl><span class=w> </span><span class=nt>combine</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-14><a class=lnlinks href=#hl-25-14>14</a></span><span class=cl><span class=w> </span><span class=nt>strategy</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-15><a class=lnlinks href=#hl-25-15>15</a></span><span class=cl><span class=w> </span><span class=nt>variables</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-16><a class=lnlinks href=#hl-25-16>16</a></span><span class=cl><span class=w> </span>- <span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>key1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-17><a class=lnlinks href=#hl-25-17>17</a></span><span class=cl><span class=w> </span>- <span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>key2</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-18><a class=lnlinks href=#hl-25-18>18</a></span><span class=cl><span class=w> </span><span class=nt>string</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-19><a class=lnlinks href=#hl-25-19>19</a></span><span class=cl><span class=w> </span><span class=nt>fmt</span><span class=p>:</span><span class=w> </span><span class=s2>"%s-%s"</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-25-20><a class=lnlinks href=#hl-25-20>20</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations[EnvironmentPatch]</span><span class=w> </span></span></span></code></pre></div><p>Describe the managed resource to see new <code>annotation</code>.</p><div class=highlight copy-lines=none label=combineFromEnvDesc><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-26-1><a class=lnlinks href=#hl-26-1>1</a></span><span class=cl><span class=l>$ kubectl describe bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-26-2><a class=lnlinks href=#hl-26-2>2</a></span><span class=cl><span class=w></span><span class=nt>Name</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim-zmxdg-grl6p</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-26-3><a class=lnlinks href=#hl-26-3>3</a></span><span class=cl><span class=w></span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-26-4><a class=lnlinks href=#hl-26-4>4</a></span><span class=cl><span class=w></span><span class=nt>Annotations: EnvironmentPatch</span><span class=p>:</span><span class=w> </span><span class=l>value1-value2</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-26-5><a class=lnlinks href=#hl-26-5>5</a></span><span class=cl><span class=w></span><span class=c># Removed for brevity</span><span class=w> </span></span></span></code></pre></div><h3 id=combinetoenvironment>CombineToEnvironment <a class=anchor-link id=combinetoenvironment href=#combinetoenvironment aria-label="Link to this section: CombineToEnvironment"></a></h3><div class="admonition important d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="important:"><use xlink:href="#exclamation"/></svg><span class=ps-1>Important</span></div><div class=admonition-content>For more information about using an EnvironmentConfig, read the <a href=https://docs.crossplane.io/v1.18/concepts/environment-configs/>EnvironmentConfigs documentation</a>.</div></div><p>The <code>CombineToEnvironment</code> patch combines multiple values from the composed resource and applies them to the in-memory EnvironmentConfig environment.</p><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content>Use <code>CombineToEnvironment</code> patch to create complex strings, like security policies to use in other managed resources.</div></div><p>For example, combine multiple fields in the managed resource to create a unique string and store it in the environment’s <code>key2</code> value.</p><p>The string combines the managed resource <code>Kind</code> and <code>region</code>.</p><p>The <code>CombineToEnvironment</code> patch only supports the <code>combine</code> option.</p><p>The only supported <code>strategy</code> is <code>strategy: string</code>.</p><p>The <code>variables</code> are the list of <code>fromFieldPath</code> values in the managed resource to combine.</p><p>Optionally you can apply a <code>string.fmt</code>, based on <a href=https://pkg.go.dev/fmt>Go string formatting</a> to specify how to combine the strings.</p><p>The <code>toFieldPath</code> is the key in the environment to write the new string to.</p><div class=highlight label=combineToEnv copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-27-1><a class=lnlinks href=#hl-27-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-2><a class=lnlinks href=#hl-27-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-3><a class=lnlinks href=#hl-27-3> 3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-4><a class=lnlinks href=#hl-27-4> 4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>bucket1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-5><a class=lnlinks href=#hl-27-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-6><a class=lnlinks href=#hl-27-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-7><a class=lnlinks href=#hl-27-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-8><a class=lnlinks href=#hl-27-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-9><a class=lnlinks href=#hl-27-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>forProvider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-10><a class=lnlinks href=#hl-27-10>10</a></span><span class=cl><span class=w> </span><span class=nt>region</span><span class=p>:</span><span class=w> </span><span class=l>us-east-2</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-11><a class=lnlinks href=#hl-27-11>11</a></span><span class=cl><span class=w> </span><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-12><a class=lnlinks href=#hl-27-12>12</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>CombineToEnvironment</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-13><a class=lnlinks href=#hl-27-13>13</a></span><span class=cl><span class=w> </span><span class=nt>combine</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-14><a class=lnlinks href=#hl-27-14>14</a></span><span class=cl><span class=w> </span><span class=nt>strategy</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-15><a class=lnlinks href=#hl-27-15>15</a></span><span class=cl><span class=w> </span><span class=nt>variables</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-16><a class=lnlinks href=#hl-27-16>16</a></span><span class=cl><span class=w> </span>- <span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>kind</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-17><a class=lnlinks href=#hl-27-17>17</a></span><span class=cl><span class=w> </span>- <span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.forProvider.region</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-18><a class=lnlinks href=#hl-27-18>18</a></span><span class=cl><span class=w> </span><span class=nt>string</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-19><a class=lnlinks href=#hl-27-19>19</a></span><span class=cl><span class=w> </span><span class=nt>fmt</span><span class=p>:</span><span class=w> </span><span class=s2>"%s.%s"</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-27-20><a class=lnlinks href=#hl-27-20>20</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>key2</span><span class=w> </span></span></span></code></pre></div><p>Because the environment is in-memory, there is no command to confirm the patch wrote the value to the environment.</p><h2 id=transform-a-patch>Transform a patch <a class=anchor-link id=transform-a-patch href=#transform-a-patch aria-label="Link to this section: Transform a patch"></a></h2><p>When applying a patch, Crossplane supports modifying the data before applying it as a patch. Crossplane calls this a “transform” operation.</p><p>Summary of Crossplane transforms.<div class="table-responsive border rounded"><table class="table table-hover"><thead><tr><th>Transform Type</th><th>Action</th></tr></thead><tbody><tr><td><a href=#convert-transforms>convert</a></td><td>Converts an input data type to a different type. Also called “casting.”</td></tr><tr><td><a href=#map-transforms>map</a></td><td>Selects a specific output based on a specific input.</td></tr><tr><td><a href=#match-transform>match</a></td><td>Selects a specific output based on a string or regular expression.</td></tr><tr><td><a href=#math-transforms>math</a></td><td>Applies a mathematical operation on the input.</td></tr><tr><td><a href=#string-transforms>string</a></td><td>Change the input string using <a href=https://pkg.go.dev/fmt>Go string formatting</a>.</td></tr></tbody></table></div></p><p>Apply a transform directly to an individual patch with the <code>transforms</code> field.</p><p>A <code>transform</code> requires a <code>type</code>, indicating the transform action to take.</p><p>The other transform field is the same as the <code>type</code>, in this example, <code>map</code>.</p><p>The other fields depend on the patch type used.</p><p>This example uses a <code>type: map</code> transform, taking the input <code>spec.desiredRegion</code>, matching it to either <code>us</code> or <code>eu</code> and returning the corresponding AWS region for the <code>spec.forProvider.region</code> value.</p><div class=highlight label=transform1 copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-28-1><a class=lnlinks href=#hl-28-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-28-2><a class=lnlinks href=#hl-28-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-28-3><a class=lnlinks href=#hl-28-3> 3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-28-4><a class=lnlinks href=#hl-28-4> 4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>bucket1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-28-5><a class=lnlinks href=#hl-28-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-28-6><a class=lnlinks href=#hl-28-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>s3.aws.upbound.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-28-7><a class=lnlinks href=#hl-28-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-28-8><a class=lnlinks href=#hl-28-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-28-9><a class=lnlinks href=#hl-28-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>forProvider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-28-10><a class=lnlinks href=#hl-28-10>10</a></span><span class=cl><span class=w> </span><span class=nt>region</span><span class=p>:</span><span class=w> </span><span class=l>us-east-2</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-28-11><a class=lnlinks href=#hl-28-11>11</a></span><span class=cl><span class=w> </span><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-28-12><a class=lnlinks href=#hl-28-12>12</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-28-13><a class=lnlinks href=#hl-28-13>13</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.desiredRegion</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-28-14><a class=lnlinks href=#hl-28-14>14</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.forProvider.region</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-28-15><a class=lnlinks href=#hl-28-15>15</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-28-16><a class=lnlinks href=#hl-28-16>16</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>map</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-28-17><a class=lnlinks href=#hl-28-17>17</a></span><span class=cl><span class=w> </span><span class=nt>map</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-28-18><a class=lnlinks href=#hl-28-18>18</a></span><span class=cl><span class=w> </span><span class=nt>us</span><span class=p>:</span><span class=w> </span><span class=l>us-east-2</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-28-19><a class=lnlinks href=#hl-28-19>19</a></span><span class=cl><span class=w> </span><span class=nt>eu</span><span class=p>:</span><span class=w> </span><span class=l>eu-north-1</span><span class=w> </span></span></span></code></pre></div><h3 id=convert-transforms>Convert transforms <a class=anchor-link id=convert-transforms href=#convert-transforms aria-label="Link to this section: Convert transforms"></a></h3><p>The <code>convert</code> transform type changes the input data type to a different data type.</p><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content>Some provider APIs require a field to be a string. Use a <code>convert</code> type to change any boolean or integer fields to strings.</div></div><p>A <code>convert</code> transform requires a <code>toType</code>, defining the output data type.</p><div class=highlight label=convert copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-29-1><a class=lnlinks href=#hl-29-1>1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-29-2><a class=lnlinks href=#hl-29-2>2</a></span><span class=cl><span class=w></span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-29-3><a class=lnlinks href=#hl-29-3>3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.numberField</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-29-4><a class=lnlinks href=#hl-29-4>4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.label["numberToString"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-29-5><a class=lnlinks href=#hl-29-5>5</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-29-6><a class=lnlinks href=#hl-29-6>6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>convert</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-29-7><a class=lnlinks href=#hl-29-7>7</a></span><span class=cl><span class=w> </span><span class=nt>convert</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-29-8><a class=lnlinks href=#hl-29-8>8</a></span><span class=cl><span class=w> </span><span class=nt>toType</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span></code></pre></div><p>Supported <code>toType</code> values:<div class="table-responsive border rounded"><table class="table table-sm table-hover"><thead><tr><th><code>toType</code> value</th><th>Description</th></tr></thead><tbody><tr><td><code>bool</code></td><td>A boolean value of <code>true</code> or <code>false</code>.</td></tr><tr><td><code>float64</code></td><td>A 64-bit float value.</td></tr><tr><td><code>int</code></td><td>A 32-bit integer value.</td></tr><tr><td><code>int64</code></td><td>A 64-bit integer value.</td></tr><tr><td><code>string</code></td><td>A string value.</td></tr><tr><td><code>object</code></td><td>An object.</td></tr><tr><td><code>array</code></td><td>An array.</td></tr></tbody></table></div></p><h4 id=converting-strings-to-booleans>Converting strings to booleans <a class=anchor-link id=converting-strings-to-booleans href=#converting-strings-to-booleans aria-label="Link to this section: Converting strings to booleans"></a></h4><p>When converting from a string to a <code>bool</code> Crossplane considers the string values <code>1</code>, <code>t</code>, <code>T</code>, <code>TRUE</code>, <code>True</code> and <code>true</code> equal to the boolean value <code>True</code>.</p><p>The strings <code>0</code>, <code>f</code>, <code>F</code>, <code>FALSE</code>, <code>False</code> and <code>false</code> are equal to the boolean value <code>False</code>.</p><h4 id=converting-numbers-to-booleans>Converting numbers to booleans <a class=anchor-link id=converting-numbers-to-booleans href=#converting-numbers-to-booleans aria-label="Link to this section: Converting numbers to booleans"></a></h4><p>Crossplane considers the integer <code>1</code> and float <code>1.0</code> equal to the boolean value <code>True</code>. Any other integer or float value is <code>False</code>.</p><h4 id=converting-booleans-to-numbers>Converting booleans to numbers <a class=anchor-link id=converting-booleans-to-numbers href=#converting-booleans-to-numbers aria-label="Link to this section: Converting booleans to numbers"></a></h4><p>Crossplane converts the boolean value <code>True</code> to the integer <code>1</code> or float64 <code>1.0</code>.</p><p>The value <code>False</code> converts to the integer <code>0</code> or float64 <code>0.0</code></p><h4 id=converting-strings-to-float64>Converting strings to float64 <a class=anchor-link id=converting-strings-to-float64 href=#converting-strings-to-float64 aria-label="Link to this section: Converting strings to float64"></a></h4><p>When converting from a <code>string</code> to a <code>float64</code> Crossplane supports an optional <code>format: quantity</code> field.</p><p>Using <code>format: quantity</code> translates size suffixes like <code>M</code> for megabyte or <code>Mi</code> for megabit into the correct float64 value.</p><div class="admonition note d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="note:"><use xlink:href="#info"/></svg><span class=ps-1>Note</span></div><div class=admonition-content>Refer to the <a href=https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Quantity>Go language docs</a> for a full list of supported suffixes.</div></div><p>Add <code>format: quantity</code> to the <code>convert</code> object to enable quantity suffix support.</p><div class=highlight label=format copy-lines=all><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-30-1><a class=lnlinks href=#hl-30-1>1</a></span><span class=cl>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>convert</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-30-2><a class=lnlinks href=#hl-30-2>2</a></span><span class=cl><span class=w> </span><span class=nt>convert</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-30-3><a class=lnlinks href=#hl-30-3>3</a></span><span class=cl><span class=w> </span><span class=nt>toType</span><span class=p>:</span><span class=w> </span><span class=l>float64</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-30-4><a class=lnlinks href=#hl-30-4>4</a></span><span class=cl><span class=w> </span><span class=nt>format</span><span class=p>:</span><span class=w> </span><span class=l>quantity</span><span class=w> </span></span></span></code></pre></div><h4 id=converting-strings-to-objects>Converting strings to objects <a class=anchor-link id=converting-strings-to-objects href=#converting-strings-to-objects aria-label="Link to this section: Converting strings to objects"></a></h4><p>Crossplane converts JSON strings to objects.</p><p>Add <code>format: json</code> to the <code>convert</code> object which is the only supported string format for this conversion.</p><div class=highlight label=object copy-lines=all><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-31-1><a class=lnlinks href=#hl-31-1>1</a></span><span class=cl>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>convert</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-31-2><a class=lnlinks href=#hl-31-2>2</a></span><span class=cl><span class=w> </span><span class=nt>convert</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-31-3><a class=lnlinks href=#hl-31-3>3</a></span><span class=cl><span class=w> </span><span class=nt>toType</span><span class=p>:</span><span class=w> </span><span class=l>object</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-31-4><a class=lnlinks href=#hl-31-4>4</a></span><span class=cl><span class=w> </span><span class=nt>format</span><span class=p>:</span><span class=w> </span><span class=l>json</span><span class=w> </span></span></span></code></pre></div><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content>This conversion is useful for patching keys in an object.</div></div><p>The following example adds a tag to a resource with a <code>customized key</code>:</p><div class=highlight label=patch-key copy-lines=all><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-32-1><a class=lnlinks href=#hl-32-1> 1</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-32-2><a class=lnlinks href=#hl-32-2> 2</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.clusterName</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-32-3><a class=lnlinks href=#hl-32-3> 3</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.forProvider.tags</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-32-4><a class=lnlinks href=#hl-32-4> 4</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-32-5><a class=lnlinks href=#hl-32-5> 5</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-32-6><a class=lnlinks href=#hl-32-6> 6</a></span><span class=cl><span class=w> </span><span class=nt>string</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-32-7><a class=lnlinks href=#hl-32-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>Format</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-32-8><a class=lnlinks href=#hl-32-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>fmt</span><span class=p>:</span><span class=w> </span><span class=s1>'{"kubernetes.io/cluster/%s": "true"}'</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-32-9><a class=lnlinks href=#hl-32-9> 9</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>convert</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-32-10><a class=lnlinks href=#hl-32-10>10</a></span><span class=cl><span class=w> </span><span class=nt>convert</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-32-11><a class=lnlinks href=#hl-32-11>11</a></span><span class=cl><span class=w> </span><span class=nt>toType</span><span class=p>:</span><span class=w> </span><span class=l>object</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-32-12><a class=lnlinks href=#hl-32-12>12</a></span><span class=cl><span class=w> </span><span class=nt>format</span><span class=p>:</span><span class=w> </span><span class=l>json</span><span class=w> </span></span></span></code></pre></div><h4 id=converting-strings-to-arrays>Converting strings to arrays <a class=anchor-link id=converting-strings-to-arrays href=#converting-strings-to-arrays aria-label="Link to this section: Converting strings to arrays"></a></h4><p>Crossplane converts JSON strings to arrays.</p><p>Add <code>format: json</code> to the <code>convert</code> object which is the only supported string format for this conversion.</p><div class=highlight label=array copy-lines=all><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-33-1><a class=lnlinks href=#hl-33-1>1</a></span><span class=cl>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>convert</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-33-2><a class=lnlinks href=#hl-33-2>2</a></span><span class=cl><span class=w> </span><span class=nt>convert</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-33-3><a class=lnlinks href=#hl-33-3>3</a></span><span class=cl><span class=w> </span><span class=nt>toType</span><span class=p>:</span><span class=w> </span><span class=l>array</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-33-4><a class=lnlinks href=#hl-33-4>4</a></span><span class=cl><span class=w> </span><span class=nt>format</span><span class=p>:</span><span class=w> </span><span class=l>json</span><span class=w> </span></span></span></code></pre></div><h3 id=map-transforms>Map transforms <a class=anchor-link id=map-transforms href=#map-transforms aria-label="Link to this section: Map transforms"></a></h3><p>The <code>map</code> transform type <em>maps</em> an input value to an output value.</p><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content>The <code>map</code> transform is useful for translating generic region names like <code>US</code> or <code>EU</code> to provider specific region names.</div></div><p>The <code>map</code> transform compares the value from the <code>fromFieldPath</code> to the options listed in the <code>map</code>.</p><p>If Crossplane finds the value, Crossplane puts the mapped value in the <code>toFieldPath</code>.</p><div class="admonition note d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="note:"><use xlink:href="#info"/></svg><span class=ps-1>Note</span></div><div class=admonition-content>Crossplane throws an error for the patch if the value isn’t found.</div></div><p><code>spec.field1</code> is the string <code>"field1-text"</code> then Crossplane uses the string <code>firstField</code> for the <code>annotation</code>.</p><p>If <code>spec.field1</code> is the string <code>"field2-text"</code> then Crossplane uses the string <code>secondField</code> for the <code>annotation</code>.</p><div class=highlight label=map copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-34-1><a class=lnlinks href=#hl-34-1>1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-34-2><a class=lnlinks href=#hl-34-2>2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-34-3><a class=lnlinks href=#hl-34-3>3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.field1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-34-4><a class=lnlinks href=#hl-34-4>4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations["myAnnotation"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-34-5><a class=lnlinks href=#hl-34-5>5</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-34-6><a class=lnlinks href=#hl-34-6>6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>map</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-34-7><a class=lnlinks href=#hl-34-7>7</a></span><span class=cl><span class=w> </span><span class=nt>map</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-34-8><a class=lnlinks href=#hl-34-8>8</a></span><span class=cl><span class=w> </span><span class=nt>"field1-text": </span><span class=s2>"firstField"</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-34-9><a class=lnlinks href=#hl-34-9>9</a></span><span class=cl><span class=w> </span><span class=nt>"field2-text": </span><span class=s2>"secondField"</span><span class=w> </span></span></span></code></pre></div><p>In this example, the value of <code>spec.field1</code> is <code>field1-text</code>.</p><div class=highlight label=comositeMap copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-35-1><a class=lnlinks href=#hl-35-1>1</a></span><span class=cl><span class=l>$ kubectl describe composite</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-35-2><a class=lnlinks href=#hl-35-2>2</a></span><span class=cl><span class=w></span><span class=nt>Name</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim-twx7n</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-35-3><a class=lnlinks href=#hl-35-3>3</a></span><span class=cl><span class=w></span><span class=nt>Spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-35-4><a class=lnlinks href=#hl-35-4>4</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-35-5><a class=lnlinks href=#hl-35-5>5</a></span><span class=cl><span class=w> </span><span class=nt>field1</span><span class=p>:</span><span class=w> </span><span class=l>field1-text</span><span class=w> </span></span></span></code></pre></div><p>The annotation applied to the managed resource is <code>firstField</code>.</p><div class=highlight label=mrMap copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-36-1><a class=lnlinks href=#hl-36-1>1</a></span><span class=cl><span class=l>$ kubectl describe bucket</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-36-2><a class=lnlinks href=#hl-36-2>2</a></span><span class=cl><span class=w></span><span class=nt>Name</span><span class=p>:</span><span class=w> </span><span class=l>my-example-claim-twx7n-ndb2f</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-36-3><a class=lnlinks href=#hl-36-3>3</a></span><span class=cl><span class=w></span><span class=nt>Annotations: crossplane.io/composition-resource-name</span><span class=p>:</span><span class=w> </span><span class=l>bucket1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-36-4><a class=lnlinks href=#hl-36-4>4</a></span><span class=cl><span class=w> </span><span class=nt>myAnnotation</span><span class=p>:</span><span class=w> </span><span class=l>firstField</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-36-5><a class=lnlinks href=#hl-36-5>5</a></span><span class=cl><span class=w></span><span class=c># Removed for brevity.</span><span class=w> </span></span></span></code></pre></div><h3 id=match-transform>Match transform <a class=anchor-link id=match-transform href=#match-transform aria-label="Link to this section: Match transform"></a></h3><p>The <code>match</code> transform is like the <code>map</code> transform.</p><p>The <code>match</code> transform adds support for regular expressions along with exact strings and can provide default values if there isn’t a match.</p><p>A <code>match</code> object requires a <code>patterns</code> object.</p><p>The <code>patterns</code> is a list of one or more patterns to attempt to match the input value against.</p><div class=highlight label=match copy-lines=1-8><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-37-1><a class=lnlinks href=#hl-37-1> 1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-37-2><a class=lnlinks href=#hl-37-2> 2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-37-3><a class=lnlinks href=#hl-37-3> 3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.field1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-37-4><a class=lnlinks href=#hl-37-4> 4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations["myAnnotation"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-37-5><a class=lnlinks href=#hl-37-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-37-6><a class=lnlinks href=#hl-37-6> 6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>match</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-37-7><a class=lnlinks href=#hl-37-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>match</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-37-8><a class=lnlinks href=#hl-37-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>patterns</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-37-9><a class=lnlinks href=#hl-37-9> 9</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>literal</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-37-10><a class=lnlinks href=#hl-37-10>10</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-37-11><a class=lnlinks href=#hl-37-11>11</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>regexp</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-37-12><a class=lnlinks href=#hl-37-12>12</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span></code></pre></div><p>Match <code>patterns</code> can be either <code>type: literal</code> to match an exact string or <code>type: regexp</code> to match a regular expression.</p><div class="admonition note d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="note:"><use xlink:href="#info"/></svg><span class=ps-1>Note</span></div><div class=admonition-content>Crossplane stops processing matches after the first pattern match.</div></div><h4 id=match-an-exact-string>Match an exact string <a class=anchor-link id=match-an-exact-string href=#match-an-exact-string aria-label="Link to this section: Match an exact string"></a></h4><p>Use a <code>pattern</code> with <code>type: literal</code> to match an exact string.</p><p>On a successful match Crossplane provides the <code>result:</code> to the patch <code>toFieldPath</code>.</p><div class=highlight label=matchLiteral><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-38-1><a class=lnlinks href=#hl-38-1> 1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-38-2><a class=lnlinks href=#hl-38-2> 2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-38-3><a class=lnlinks href=#hl-38-3> 3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.field1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-38-4><a class=lnlinks href=#hl-38-4> 4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations["myAnnotation"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-38-5><a class=lnlinks href=#hl-38-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-38-6><a class=lnlinks href=#hl-38-6> 6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>match</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-38-7><a class=lnlinks href=#hl-38-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>match</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-38-8><a class=lnlinks href=#hl-38-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>patterns</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-38-9><a class=lnlinks href=#hl-38-9> 9</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>literal</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-38-10><a class=lnlinks href=#hl-38-10>10</a></span><span class=cl><span class=w> </span><span class=nt>literal</span><span class=p>:</span><span class=w> </span><span class=s2>"field1-text"</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-38-11><a class=lnlinks href=#hl-38-11>11</a></span><span class=cl><span class=w> </span><span class=nt>result</span><span class=p>:</span><span class=w> </span><span class=s2>"matchedLiteral"</span><span class=w> </span></span></span></code></pre></div><h4 id=match-a-regular-expression>Match a regular expression <a class=anchor-link id=match-a-regular-expression href=#match-a-regular-expression aria-label="Link to this section: Match a regular expression"></a></h4><p>Use a <code>pattern</code> with <code>type: regexp</code> to match a regular expression. Define a <code>regexp</code> key with the value of the regular expression to match.</p><p>On a successful match Crossplane provides the <code>result:</code> to the patch <code>toFieldPath</code>.</p><div class=highlight label=matchRegex><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-39-1><a class=lnlinks href=#hl-39-1> 1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-39-2><a class=lnlinks href=#hl-39-2> 2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-39-3><a class=lnlinks href=#hl-39-3> 3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.field1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-39-4><a class=lnlinks href=#hl-39-4> 4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations["myAnnotation"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-39-5><a class=lnlinks href=#hl-39-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-39-6><a class=lnlinks href=#hl-39-6> 6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>match</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-39-7><a class=lnlinks href=#hl-39-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>match</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-39-8><a class=lnlinks href=#hl-39-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>patterns</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-39-9><a class=lnlinks href=#hl-39-9> 9</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>regexp</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-39-10><a class=lnlinks href=#hl-39-10>10</a></span><span class=cl><span class=w> </span><span class=nt>regexp</span><span class=p>:</span><span class=w> </span><span class=s1>'^field1.*'</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-39-11><a class=lnlinks href=#hl-39-11>11</a></span><span class=cl><span class=w> </span><span class=nt>result</span><span class=p>:</span><span class=w> </span><span class=s2>"foundField1"</span><span class=w> </span></span></span></code></pre></div><h4 id=using-default-values>Using default values <a class=anchor-link id=using-default-values href=#using-default-values aria-label="Link to this section: Using default values"></a></h4><p>Optionally you can provide a default value to use if there is no matching pattern.</p><p>The default value can either be the original input value or a defined default value.</p><p>Use <code>fallbackTo: Value</code> to provide a default value if a match isn’t found.</p><p>For example if the string <code>unknownString</code> isn’t matched, Crossplane provides the <code>Value</code> <code>StringNotFound</code> to the <code>toFieldPath</code></p><div class=highlight label=defaultValue><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-40-1><a class=lnlinks href=#hl-40-1> 1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-40-2><a class=lnlinks href=#hl-40-2> 2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-40-3><a class=lnlinks href=#hl-40-3> 3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.field1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-40-4><a class=lnlinks href=#hl-40-4> 4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations["myAnnotation"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-40-5><a class=lnlinks href=#hl-40-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-40-6><a class=lnlinks href=#hl-40-6> 6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>match</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-40-7><a class=lnlinks href=#hl-40-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>match</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-40-8><a class=lnlinks href=#hl-40-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>patterns</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-40-9><a class=lnlinks href=#hl-40-9> 9</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>literal</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-40-10><a class=lnlinks href=#hl-40-10>10</a></span><span class=cl><span class=w> </span><span class=nt>literal</span><span class=p>:</span><span class=w> </span><span class=s2>"UnknownString"</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-40-11><a class=lnlinks href=#hl-40-11>11</a></span><span class=cl><span class=w> </span><span class=nt>result</span><span class=p>:</span><span class=w> </span><span class=s2>"foundField1"</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-40-12><a class=lnlinks href=#hl-40-12>12</a></span><span class=cl><span class=w> </span><span class=nt>fallbackTo</span><span class=p>:</span><span class=w> </span><span class=l>Value</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-40-13><a class=lnlinks href=#hl-40-13>13</a></span><span class=cl><span class=w> </span><span class=nt>fallbackValue</span><span class=p>:</span><span class=w> </span><span class=s2>"StringNotFound"</span><span class=w> </span></span></span></code></pre></div><p>To use the original input as the fallback value use <code>fallbackTo: Input</code>.</p><p>Crossplane uses the original <code>fromFieldPath</code> input for the <code>toFieldPath</code> value.</p><div class=highlight label=defaultInput><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-41-1><a class=lnlinks href=#hl-41-1> 1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-41-2><a class=lnlinks href=#hl-41-2> 2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-41-3><a class=lnlinks href=#hl-41-3> 3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.field1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-41-4><a class=lnlinks href=#hl-41-4> 4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations["myAnnotation"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-41-5><a class=lnlinks href=#hl-41-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-41-6><a class=lnlinks href=#hl-41-6> 6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>match</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-41-7><a class=lnlinks href=#hl-41-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>match</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-41-8><a class=lnlinks href=#hl-41-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>patterns</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-41-9><a class=lnlinks href=#hl-41-9> 9</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>literal</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-41-10><a class=lnlinks href=#hl-41-10>10</a></span><span class=cl><span class=w> </span><span class=nt>literal</span><span class=p>:</span><span class=w> </span><span class=s2>"UnknownString"</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-41-11><a class=lnlinks href=#hl-41-11>11</a></span><span class=cl><span class=w> </span><span class=nt>result</span><span class=p>:</span><span class=w> </span><span class=s2>"foundField1"</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-41-12><a class=lnlinks href=#hl-41-12>12</a></span><span class=cl><span class=w> </span><span class=nt>fallbackTo</span><span class=p>:</span><span class=w> </span><span class=l>Input</span><span class=w> </span></span></span></code></pre></div><h3 id=math-transforms>Math transforms <a class=anchor-link id=math-transforms href=#math-transforms aria-label="Link to this section: Math transforms"></a></h3><p>Use the <code>math</code> transform to multiply an input or apply a minimum or maximum value.</p><div class="admonition important d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="important:"><use xlink:href="#exclamation"/></svg><span class=ps-1>Important</span></div><div class=admonition-content>A <code>math</code> transform only supports integer inputs.</div></div><div class=highlight label=math copy-lines=1-7><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-42-1><a class=lnlinks href=#hl-42-1>1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-42-2><a class=lnlinks href=#hl-42-2>2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-42-3><a class=lnlinks href=#hl-42-3>3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.numberField</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-42-4><a class=lnlinks href=#hl-42-4>4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations["mathAnnotation"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-42-5><a class=lnlinks href=#hl-42-5>5</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-42-6><a class=lnlinks href=#hl-42-6>6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>math</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-42-7><a class=lnlinks href=#hl-42-7>7</a></span><span class=cl><span class=w> </span><span class=nt>math</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-42-8><a class=lnlinks href=#hl-42-8>8</a></span><span class=cl><span class=w> </span><span class=l>...</span><span class=w> </span></span></span></code></pre></div><h4 id=clampmin>clampMin <a class=anchor-link id=clampmin href=#clampmin aria-label="Link to this section: clampMin"></a></h4><p>The <code>type: clampMin</code> uses a defined minimum value if an input is larger than the <code>type: clampMin</code> value.</p><p>For example, this <code>type: clampMin</code> requires an input to be greater than <code>20</code>.</p><p>If an input is lower than <code>20</code>, Crossplane uses the <code>clampMin</code> value for the <code>toFieldPath</code>.</p><div class=highlight label=clampMin><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-43-1><a class=lnlinks href=#hl-43-1>1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-43-2><a class=lnlinks href=#hl-43-2>2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-43-3><a class=lnlinks href=#hl-43-3>3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.numberField</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-43-4><a class=lnlinks href=#hl-43-4>4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations["mathAnnotation"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-43-5><a class=lnlinks href=#hl-43-5>5</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-43-6><a class=lnlinks href=#hl-43-6>6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>math</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-43-7><a class=lnlinks href=#hl-43-7>7</a></span><span class=cl><span class=w> </span><span class=nt>math</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-43-8><a class=lnlinks href=#hl-43-8>8</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>clampMin</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-43-9><a class=lnlinks href=#hl-43-9>9</a></span><span class=cl><span class=w> </span><span class=nt>clampMin</span><span class=p>:</span><span class=w> </span><span class=m>20</span><span class=w> </span></span></span></code></pre></div><h4 id=clampmax>clampMax <a class=anchor-link id=clampmax href=#clampmax aria-label="Link to this section: clampMax"></a></h4><p>The <code>type: clampMax</code> uses a defined minimum value if an input is larger than the <code>type: clampMax</code> value.</p><p>For example, this <code>type: clampMax</code> requires an input to be less than <code>5</code>.</p><p>If an input is higher than <code>5</code>, Crossplane uses the <code>clampMax</code> value for the <code>toFieldPath</code>.</p><div class=highlight label=clampMax><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-44-1><a class=lnlinks href=#hl-44-1>1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-44-2><a class=lnlinks href=#hl-44-2>2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-44-3><a class=lnlinks href=#hl-44-3>3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.numberField</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-44-4><a class=lnlinks href=#hl-44-4>4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations["mathAnnotation"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-44-5><a class=lnlinks href=#hl-44-5>5</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-44-6><a class=lnlinks href=#hl-44-6>6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>math</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-44-7><a class=lnlinks href=#hl-44-7>7</a></span><span class=cl><span class=w> </span><span class=nt>math</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-44-8><a class=lnlinks href=#hl-44-8>8</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>clampMax</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-44-9><a class=lnlinks href=#hl-44-9>9</a></span><span class=cl><span class=w> </span><span class=nt>clampMax</span><span class=p>:</span><span class=w> </span><span class=m>5</span><span class=w> </span></span></span></code></pre></div><h4 id=multiply>Multiply <a class=anchor-link id=multiply href=#multiply aria-label="Link to this section: Multiply"></a></h4><p>The <code>type: multiply</code> multiplies the input by the <code>multiply</code> value.</p><p>For example, this <code>type: multiply</code> multiplies the value from the <code>fromFieldPath</code> value by <code>2</code></p><div class=highlight label=multiply><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-45-1><a class=lnlinks href=#hl-45-1>1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-45-2><a class=lnlinks href=#hl-45-2>2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-45-3><a class=lnlinks href=#hl-45-3>3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.numberField</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-45-4><a class=lnlinks href=#hl-45-4>4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations["mathAnnotation"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-45-5><a class=lnlinks href=#hl-45-5>5</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-45-6><a class=lnlinks href=#hl-45-6>6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>math</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-45-7><a class=lnlinks href=#hl-45-7>7</a></span><span class=cl><span class=w> </span><span class=nt>math</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-45-8><a class=lnlinks href=#hl-45-8>8</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>multiply</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-45-9><a class=lnlinks href=#hl-45-9>9</a></span><span class=cl><span class=w> </span><span class=nt>multiply</span><span class=p>:</span><span class=w> </span><span class=m>2</span><span class=w> </span></span></span></code></pre></div><div class="admonition note d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="note:"><use xlink:href="#info"/></svg><span class=ps-1>Note</span></div><div class=admonition-content>The <code>multiply</code> value only supports integers.</div></div><h3 id=string-transforms>String transforms <a class=anchor-link id=string-transforms href=#string-transforms aria-label="Link to this section: String transforms"></a></h3><p>The <code>string</code> transform applies string formatting or manipulation to string inputs.</p><div class=highlight label=string><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-46-1><a class=lnlinks href=#hl-46-1>1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-46-2><a class=lnlinks href=#hl-46-2>2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-46-3><a class=lnlinks href=#hl-46-3>3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.field1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-46-4><a class=lnlinks href=#hl-46-4>4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations["stringAnnotation"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-46-5><a class=lnlinks href=#hl-46-5>5</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-46-6><a class=lnlinks href=#hl-46-6>6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-46-7><a class=lnlinks href=#hl-46-7>7</a></span><span class=cl><span class=w> </span><span class=nt>string</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-46-8><a class=lnlinks href=#hl-46-8>8</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>...</span><span class=w> </span></span></span></code></pre></div><p>String transforms support the following <code>types</code></p><ul><li><a href=#string-convert>Convert</a></li><li><a href=#string-format>Format</a></li><li><a href=#join>Join</a></li><li><a href=#regular-expression-type>Regexp</a></li><li><a href=#trim-prefix>TrimPrefix</a></li><li><a href=#trim-suffix>TrimSuffix</a></li></ul><h4 id=string-convert>String convert <a class=anchor-link id=string-convert href=#string-convert aria-label="Link to this section: String convert"></a></h4><p>The <code>type: convert</code> converts the input based on one of the following conversion types:</p><ul><li><code>ToUpper</code> - Change the string to all upper case letters.</li><li><code>ToLower</code> - Change the string to all lower case letters.</li><li><code>ToBase64</code> - Create a new base64 string from the input.</li><li><code>FromBase64</code> - Create a new text string from a base64 input.</li><li><code>ToJson</code> - Convert the input string to valid JSON.</li><li><code>ToSha1</code> - Create a SHA-1 hash of the input string.</li><li><code>ToSha256</code> - Create a SHA-256 hash of the input string.</li><li><code>ToSha512</code> - Create a SHA-512 hash of the input string.</li><li><code>ToAdler32</code> - Create an Adler32 hash of the input string.</li></ul><div class=highlight label=stringConvert><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-47-1><a class=lnlinks href=#hl-47-1>1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-47-2><a class=lnlinks href=#hl-47-2>2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-47-3><a class=lnlinks href=#hl-47-3>3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.field1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-47-4><a class=lnlinks href=#hl-47-4>4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations["FIELD1-TEXT"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-47-5><a class=lnlinks href=#hl-47-5>5</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-47-6><a class=lnlinks href=#hl-47-6>6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-47-7><a class=lnlinks href=#hl-47-7>7</a></span><span class=cl><span class=w> </span><span class=nt>string</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-47-8><a class=lnlinks href=#hl-47-8>8</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>Convert</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-47-9><a class=lnlinks href=#hl-47-9>9</a></span><span class=cl><span class=w> </span><span class=nt>convert</span><span class=p>:</span><span class=w> </span><span class=s2>"ToUpper"</span><span class=w> </span></span></span></code></pre></div><h4 id=string-format>String format <a class=anchor-link id=string-format href=#string-format aria-label="Link to this section: String format"></a></h4><p>The <code>type: format</code> applies <a href=https://pkg.go.dev/fmt>Go string formatting</a> to the input.</p><div class=highlight label=typeFormat><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-48-1><a class=lnlinks href=#hl-48-1>1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-48-2><a class=lnlinks href=#hl-48-2>2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-48-3><a class=lnlinks href=#hl-48-3>3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.field1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-48-4><a class=lnlinks href=#hl-48-4>4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations["stringAnnotation"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-48-5><a class=lnlinks href=#hl-48-5>5</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-48-6><a class=lnlinks href=#hl-48-6>6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-48-7><a class=lnlinks href=#hl-48-7>7</a></span><span class=cl><span class=w> </span><span class=nt>string</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-48-8><a class=lnlinks href=#hl-48-8>8</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>Format</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-48-9><a class=lnlinks href=#hl-48-9>9</a></span><span class=cl><span class=w> </span><span class=nt>fmt</span><span class=p>:</span><span class=w> </span><span class=s2>"the-field-%s"</span><span class=w> </span></span></span></code></pre></div><h4 id=join>Join <a class=anchor-link id=join href=#join aria-label="Link to this section: Join"></a></h4><p>The <code>type: Join</code> joins all values in the input array into a string using the given separator.</p><p>This transform only works with array inputs.</p><div class=highlight label=typeJoin><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-49-1><a class=lnlinks href=#hl-49-1> 1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-49-2><a class=lnlinks href=#hl-49-2> 2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-49-3><a class=lnlinks href=#hl-49-3> 3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.parameters.inputList</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-49-4><a class=lnlinks href=#hl-49-4> 4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.targetJoined</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-49-5><a class=lnlinks href=#hl-49-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-49-6><a class=lnlinks href=#hl-49-6> 6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-49-7><a class=lnlinks href=#hl-49-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>string</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-49-8><a class=lnlinks href=#hl-49-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>Join</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-49-9><a class=lnlinks href=#hl-49-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>join</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-49-10><a class=lnlinks href=#hl-49-10>10</a></span><span class=cl><span class=w> </span><span class=nt>separator</span><span class=p>:</span><span class=w> </span><span class=s2>","</span><span class=w> </span></span></span></code></pre></div><h4 id=regular-expression-type>Regular expression type <a class=anchor-link id=regular-expression-type href=#regular-expression-type aria-label="Link to this section: Regular expression type"></a></h4><p>The <code>type: Regexp</code> extracts the part of the input matching a regular expression.</p><p>Optionally use a <code>group</code> to match a regular expression capture group. By default Crossplane matches the entire regular expression.</p><div class=highlight label=typeRegex><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-50-1><a class=lnlinks href=#hl-50-1> 1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-50-2><a class=lnlinks href=#hl-50-2> 2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-50-3><a class=lnlinks href=#hl-50-3> 3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.desiredRegion</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-50-4><a class=lnlinks href=#hl-50-4> 4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations["euRegion"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-50-5><a class=lnlinks href=#hl-50-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-50-6><a class=lnlinks href=#hl-50-6> 6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-50-7><a class=lnlinks href=#hl-50-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>string</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-50-8><a class=lnlinks href=#hl-50-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>Regexp</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-50-9><a class=lnlinks href=#hl-50-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>regexp</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-50-10><a class=lnlinks href=#hl-50-10>10</a></span><span class=cl><span class=w> </span><span class=nt>match</span><span class=p>:</span><span class=w> </span><span class=s1>'^eu-(.*)-'</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-50-11><a class=lnlinks href=#hl-50-11>11</a></span><span class=cl><span class=w> </span><span class=nt>group</span><span class=p>:</span><span class=w> </span><span class=m>1</span><span class=w> </span></span></span></code></pre></div><h4 id=trim-prefix>Trim prefix <a class=anchor-link id=trim-prefix href=#trim-prefix aria-label="Link to this section: Trim prefix"></a></h4><p>The <code>type: TrimPrefix</code> uses Go’s <a href=https://pkg.go.dev/strings#TrimPrefix>TrimPrefix</a> and removes characters from the beginning of a line.</p><div class=highlight label=typeTrimP><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-51-1><a class=lnlinks href=#hl-51-1>1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-51-2><a class=lnlinks href=#hl-51-2>2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-51-3><a class=lnlinks href=#hl-51-3>3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.desiredRegion</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-51-4><a class=lnlinks href=#hl-51-4>4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations["north-1"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-51-5><a class=lnlinks href=#hl-51-5>5</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-51-6><a class=lnlinks href=#hl-51-6>6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-51-7><a class=lnlinks href=#hl-51-7>7</a></span><span class=cl><span class=w> </span><span class=nt>string</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-51-8><a class=lnlinks href=#hl-51-8>8</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>TrimPrefix</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-51-9><a class=lnlinks href=#hl-51-9>9</a></span><span class=cl><span class=w> </span><span class=nt>trim</span><span class=p>:</span><span class=w> </span><span class=l>`eu-</span><span class=w> </span></span></span></code></pre></div><h4 id=trim-suffix>Trim suffix <a class=anchor-link id=trim-suffix href=#trim-suffix aria-label="Link to this section: Trim suffix"></a></h4><p>The <code>type: TrimSuffix</code> uses Go’s <a href=https://pkg.go.dev/strings#TrimSuffix>TrimSuffix</a> and removes characters from the end of a line.</p><div class=highlight label=typeTrimS><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-52-1><a class=lnlinks href=#hl-52-1>1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-52-2><a class=lnlinks href=#hl-52-2>2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-52-3><a class=lnlinks href=#hl-52-3>3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.desiredRegion</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-52-4><a class=lnlinks href=#hl-52-4>4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations["eu"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-52-5><a class=lnlinks href=#hl-52-5>5</a></span><span class=cl><span class=w> </span><span class=nt>transforms</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-52-6><a class=lnlinks href=#hl-52-6>6</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>string</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-52-7><a class=lnlinks href=#hl-52-7>7</a></span><span class=cl><span class=w> </span><span class=nt>string</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-52-8><a class=lnlinks href=#hl-52-8>8</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>TrimSuffix</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-52-9><a class=lnlinks href=#hl-52-9>9</a></span><span class=cl><span class=w> </span><span class=nt>trim</span><span class=p>:</span><span class=w> </span><span class=l>`-north-1'</span><span class=w> </span></span></span></code></pre></div><h2 id=patch-policies>Patch policies <a class=anchor-link id=patch-policies href=#patch-policies aria-label="Link to this section: Patch policies"></a></h2><p>Crossplane supports two types of patch policies:</p><ul><li><code>fromFieldPath</code></li><li><code>toFieldPath</code></li></ul><h3 id=fromfieldpath-policy>fromFieldPath policy <a class=anchor-link id=fromfieldpath-policy href=#fromfieldpath-policy aria-label="Link to this section: fromFieldPath policy"></a></h3><p>Using a <code>fromFieldPath: Required</code> policy on a patch requires the <code>fromFieldPath</code> to exist in the data source resource.</p><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content>If a resource patch isn’t working applying the <code>fromFieldPath: Required</code> policy may produce an error in the composite resource to help troubleshoot.</div></div><p>By default, Crossplane applies the policy <code>fromFieldPath: Optional</code>. With <code>fromFieldPath: Optional</code> Crossplane ignores a patch if the <code>fromFieldPath</code> doesn’t exist.</p><p>With <code>fromFieldPath: Required</code> the composite resource produces an error if the <code>fromFieldPath</code> doesn’t exist.</p><div class=highlight label=required><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-53-1><a class=lnlinks href=#hl-53-1>1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-53-2><a class=lnlinks href=#hl-53-2>2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-53-3><a class=lnlinks href=#hl-53-3>3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.desiredRegion</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-53-4><a class=lnlinks href=#hl-53-4>4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations["eu"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-53-5><a class=lnlinks href=#hl-53-5>5</a></span><span class=cl><span class=w> </span><span class=nt>policy</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-53-6><a class=lnlinks href=#hl-53-6>6</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>Required</span><span class=w> </span></span></span></code></pre></div><h3 id=tofieldpath-policy>toFieldPath policy <a class=anchor-link id=tofieldpath-policy href=#tofieldpath-policy aria-label="Link to this section: toFieldPath policy"></a></h3><p>By default when applying a patch the function replaces the destination data. Use <code>toFieldPath</code> to allow patches to merge arrays and objects without overwriting them.</p><p>The <code>toFieldPath</code> policy supports these options:<div class="table-responsive border rounded"><table class="table table-hover"><thead><tr><th>Policy</th><th>Action</th></tr></thead><tbody><tr><td><code>Replace</code> (default)</td><td>Replace the value at <code>toFieldPath</code>.</td></tr><tr><td><code>MergeObjects</code></td><td>Recursively merge into the value at <code>toFieldPath</code>. Keep any conflicting object keys.</td></tr><tr><td><code>ForceMergeObjects</code></td><td>Recursively merge into the value at <code>toFieldPath</code>. Replace any conflicting object keys.</td></tr><tr><td><code>MergeObjectsAppendArrays</code></td><td>Like <code>MergeObjects</code>, but append values to arrays instead of replacing them.</td></tr><tr><td><code>ForceMergeObjectsAppendArrays</code></td><td>Like <code>ForceMergeObjects</code>, but append values to arrays instead of replacing them.</td></tr></tbody></table></div></p><div class=highlight label=merge><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-54-1><a class=lnlinks href=#hl-54-1>1</a></span><span class=cl><span class=nt>patches</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-54-2><a class=lnlinks href=#hl-54-2>2</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromCompositeFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-54-3><a class=lnlinks href=#hl-54-3>3</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.desiredRegion</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-54-4><a class=lnlinks href=#hl-54-4>4</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>metadata.annotations["eu"]</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-54-5><a class=lnlinks href=#hl-54-5>5</a></span><span class=cl><span class=w> </span><span class=nt>policy</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-54-6><a class=lnlinks href=#hl-54-6>6</a></span><span class=cl><span class=w> </span><span class=nt>toFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>MergeObjectsAppendArrays</span><span class=w> </span></span></span></code></pre></div><h2 id=composite-resource-connection-details>Composite resource connection details <a class=anchor-link id=composite-resource-connection-details href=#composite-resource-connection-details aria-label="Link to this section: Composite resource connection details"></a></h2><p>Function patch and Transform must define the specific secret keys a resource creates with the <code>connectionDetails</code> object.</p><div class="table-responsive border rounded"><table class="table table-sm"><thead><tr><th>Secret Type</th><th>Description</th></tr></thead><tbody><tr><td><code>FromConnectionSecretKey</code></td><td>Create a secret key matching the key of a secret generated by the resource.</td></tr><tr><td><code>FromFieldPath</code></td><td>Create a secret key matching a field path of the resource.</td></tr><tr><td><code>FromValue</code></td><td>Create a secret key with a predefined value.</td></tr></tbody></table></div><div class="admonition note d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="note:"><use xlink:href="#info"/></svg><span class=ps-1>Note</span></div><div class=admonition-content><p>The <code>value</code> type must use a string value.</p><p>The <code>value</code> isn’t added to the individual resource secret object. The <code>value</code> only appears in the combined composite resource secret.</p></div></div><div class=highlight label=conDeet copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-55-1><a class=lnlinks href=#hl-55-1> 1</a></span><span class=cl><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Composition</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-2><a class=lnlinks href=#hl-55-2> 2</a></span><span class=cl><span class=w></span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-3><a class=lnlinks href=#hl-55-3> 3</a></span><span class=cl><span class=w> </span><span class=nt>writeConnectionSecretsToNamespace</span><span class=p>:</span><span class=w> </span><span class=l>other-namespace</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-4><a class=lnlinks href=#hl-55-4> 4</a></span><span class=cl><span class=w> </span><span class=nt>mode</span><span class=p>:</span><span class=w> </span><span class=l>Pipeline</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-5><a class=lnlinks href=#hl-55-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>pipeline</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-6><a class=lnlinks href=#hl-55-6> 6</a></span><span class=cl><span class=w> </span>- <span class=nt>step</span><span class=p>:</span><span class=w> </span><span class=l>patch-and-transform</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-7><a class=lnlinks href=#hl-55-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>functionRef</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-8><a class=lnlinks href=#hl-55-8> 8</a></span><span class=cl><span class=w> </span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>function-patch-and-transform</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-9><a class=lnlinks href=#hl-55-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>input</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-10><a class=lnlinks href=#hl-55-10>10</a></span><span class=cl><span class=w> </span><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-11><a class=lnlinks href=#hl-55-11>11</a></span><span class=cl><span class=w> </span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-12><a class=lnlinks href=#hl-55-12>12</a></span><span class=cl><span class=w> </span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-13><a class=lnlinks href=#hl-55-13>13</a></span><span class=cl><span class=w> </span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>key</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-14><a class=lnlinks href=#hl-55-14>14</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-15><a class=lnlinks href=#hl-55-15>15</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-16><a class=lnlinks href=#hl-55-16>16</a></span><span class=cl><span class=w> </span><span class=nt>spec</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-17><a class=lnlinks href=#hl-55-17>17</a></span><span class=cl><span class=w> </span><span class=nt>forProvider</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-18><a class=lnlinks href=#hl-55-18>18</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-19><a class=lnlinks href=#hl-55-19>19</a></span><span class=cl><span class=w> </span><span class=nt>writeConnectionSecretToRef</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-20><a class=lnlinks href=#hl-55-20>20</a></span><span class=cl><span class=w> </span><span class=nt>namespace</span><span class=p>:</span><span class=w> </span><span class=l>docs</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-21><a class=lnlinks href=#hl-55-21>21</a></span><span class=cl><span class=w> </span><span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>key1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-22><a class=lnlinks href=#hl-55-22>22</a></span><span class=cl><span class=w> </span><span class=nt>connectionDetails</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-23><a class=lnlinks href=#hl-55-23>23</a></span><span class=cl><span class=w> </span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>my-username</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-24><a class=lnlinks href=#hl-55-24>24</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromConnectionSecretKey</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-25><a class=lnlinks href=#hl-55-25>25</a></span><span class=cl><span class=w> </span><span class=nt>fromConnectionSecretKey</span><span class=p>:</span><span class=w> </span><span class=l>username</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-26><a class=lnlinks href=#hl-55-26>26</a></span><span class=cl><span class=w> </span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>my-field-secret</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-27><a class=lnlinks href=#hl-55-27>27</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromFieldPath</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-28><a class=lnlinks href=#hl-55-28>28</a></span><span class=cl><span class=w> </span><span class=nt>fromFieldPath</span><span class=p>:</span><span class=w> </span><span class=l>spec.forProvider.user</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-29><a class=lnlinks href=#hl-55-29>29</a></span><span class=cl><span class=w> </span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>my-status-secret</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-30><a class=lnlinks href=#hl-55-30>30</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>FromValue</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-55-31><a class=lnlinks href=#hl-55-31>31</a></span><span class=cl><span class=w> </span><span class=nt>value</span><span class=p>:</span><span class=w> </span><span class=s2>"docs.crossplane.io"</span><span class=w> </span></span></span></code></pre></div><p>The <code>connectionDetails</code> in a resource can reference a secret from a resource with <code>FromConnectionSecretKey</code>, from another field in the resource with <code>FromFieldPath</code> or a statically defined value with <code>FromValue</code>.</p><p>Crossplane sets the secret key to the <code>name</code> value.</p><p>Describe the secret to view the secret keys inside the secret object.</p><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content><p>If more than one resource generates secrets with the same secret key name, Crossplane only saves one value.</p><p>Use a custom <code>name</code> to create unique secret keys.</p></div></div><div class="admonition important d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="important:"><use xlink:href="#exclamation"/></svg><span class=ps-1>Important</span></div><div class=admonition-content><p>Crossplane only adds connection details listed in the <code>connectionDetails</code> to the combined secret object.</p><p>Any connection secrets in a managed resource, not defined in the <code>connectionDetails</code> aren’t added to the combined secret object.</p></div></div><div class=highlight copy-lines=1><pre tabindex=0 class=chroma><code class=language-shell data-lang=shell><span class=line><span class=ln id=hl-56-1><a class=lnlinks href=#hl-56-1> 1</a></span><span class=cl>kubectl describe secret </span></span><span class=line><span class=ln id=hl-56-2><a class=lnlinks href=#hl-56-2> 2</a></span><span class=cl>Name: my-access-key-secret </span></span><span class=line><span class=ln id=hl-56-3><a class=lnlinks href=#hl-56-3> 3</a></span><span class=cl>Namespace: default </span></span><span class=line><span class=ln id=hl-56-4><a class=lnlinks href=#hl-56-4> 4</a></span><span class=cl>Labels: <none> </span></span><span class=line><span class=ln id=hl-56-5><a class=lnlinks href=#hl-56-5> 5</a></span><span class=cl>Annotations: <none> </span></span><span class=line><span class=ln id=hl-56-6><a class=lnlinks href=#hl-56-6> 6</a></span><span class=cl> </span></span><span class=line><span class=ln id=hl-56-7><a class=lnlinks href=#hl-56-7> 7</a></span><span class=cl>Type: connection.crossplane.io/v1alpha1 </span></span><span class=line><span class=ln id=hl-56-8><a class=lnlinks href=#hl-56-8> 8</a></span><span class=cl> </span></span><span class=line><span class=ln id=hl-56-9><a class=lnlinks href=#hl-56-9> 9</a></span><span class=cl><span class=nv>Data</span> </span></span><span class=line><span class=ln id=hl-56-10><a class=lnlinks href=#hl-56-10>10</a></span><span class=cl><span class=o>====</span> </span></span><span class=line><span class=ln id=hl-56-11><a class=lnlinks href=#hl-56-11>11</a></span><span class=cl>myUsername: <span class=m>20</span> bytes </span></span><span class=line><span class=ln id=hl-56-12><a class=lnlinks href=#hl-56-12>12</a></span><span class=cl>myFieldSecret: <span class=m>24</span> bytes </span></span><span class=line><span class=ln id=hl-56-13><a class=lnlinks href=#hl-56-13>13</a></span><span class=cl>myStaticSecret: <span class=m>18</span> bytes </span></span></code></pre></div><div class="admonition note d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="note:"><use xlink:href="#info"/></svg><span class=ps-1>Note</span></div><div class=admonition-content><p>The CompositeResourceDefinition can also limit which keys Crossplane stores from the composite resources.</p><p>By default an XRD writes all secret keys listed in the composed resources <code>connectionDetails</code> to the combined secret object.</p><p>Read the <a href=https://docs.crossplane.io/v1.18/concepts/composite-resource-definitions/#manage-connection-secrets>CompositeResourceDefinition documentation</a> for more information on restricting secret keys.</p></div></div><p>For more information on connection secrets read the <a href=https://docs.crossplane.io/v1.18/concepts/connection-details/>Connection Secrets concepts age</a>.</p><h2 id=resource-readiness-checks>Resource readiness checks <a class=anchor-link id=resource-readiness-checks href=#resource-readiness-checks aria-label="Link to this section: Resource readiness checks"></a></h2><p>By default Crossplane considers a composite resource or Claim as <code>READY</code> when the status of all created resource are <code>Type: Ready</code> and <code>Status: True</code></p><p>Some resources, for example, a ProviderConfig, don’t have a Kubernetes status and are never considered <code>Ready</code>.</p><p>Custom readiness checks allow Compositions to define what custom conditions to meet for a resource to be <code>Ready</code>.</p><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content>Use multiple readiness checks if a resource must meet multiple conditions for it to be <code>Ready</code>.</div></div><p>Define a custom readiness check with the <code>readinessChecks</code> field on a resource.</p><p>Checks have a <code>type</code> defining how to match the resource and a <code>fieldPath</code> of which field in the resource to compare.</p><div class=highlight label=check copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-57-1><a class=lnlinks href=#hl-57-1>1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-57-2><a class=lnlinks href=#hl-57-2>2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-57-3><a class=lnlinks href=#hl-57-3>3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-57-4><a class=lnlinks href=#hl-57-4>4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>my-resource</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-57-5><a class=lnlinks href=#hl-57-5>5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-57-6><a class=lnlinks href=#hl-57-6>6</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-57-7><a class=lnlinks href=#hl-57-7>7</a></span><span class=cl><span class=w> </span><span class=nt>readinessChecks</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-57-8><a class=lnlinks href=#hl-57-8>8</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l><match type></span><span class=w> </span></span></span><span class=line><span class=ln id=hl-57-9><a class=lnlinks href=#hl-57-9>9</a></span><span class=cl><span class=w> </span><span class=nt>fieldPath</span><span class=p>:</span><span class=w> </span><span class=l><resource field></span><span class=w> </span></span></span></code></pre></div><p>Compositions support matching resource fields by:</p><ul><li><a href=#match-a-string>string match</a></li><li><a href=#match-an-integer>integer match</a></li><li><a href=#match-that-a-field-exists>non-empty match</a></li><li><a href=#always-consider-a-resource-ready>always ready</a></li><li><a href=#match-a-condition>condition match</a></li><li><a href=#match-a-boolean>boolean match</a></li></ul><h3 id=match-a-string>Match a string <a class=anchor-link id=match-a-string href=#match-a-string aria-label="Link to this section: Match a string"></a></h3><p><code>MatchString</code> considers the composed resource to be ready when the value of a field in that resource matches a specified string.</p><div class="admonition note d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="note:"><use xlink:href="#info"/></svg><span class=ps-1>Note</span></div><div class=admonition-content><p>Crossplane only supports exact string matches. Substrings and regular expressions aren’t supported in a readiness check.</p></div></div><p>For example, matching the string <code>Online</code> in the resource’s <code>status.atProvider.state</code> field.</p><div class=highlight label=matchstring copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-58-1><a class=lnlinks href=#hl-58-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-58-2><a class=lnlinks href=#hl-58-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-58-3><a class=lnlinks href=#hl-58-3> 3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-58-4><a class=lnlinks href=#hl-58-4> 4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>my-resource</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-58-5><a class=lnlinks href=#hl-58-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-58-6><a class=lnlinks href=#hl-58-6> 6</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-58-7><a class=lnlinks href=#hl-58-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>readinessChecks</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-58-8><a class=lnlinks href=#hl-58-8> 8</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>MatchString</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-58-9><a class=lnlinks href=#hl-58-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>fieldPath</span><span class=p>:</span><span class=w> </span><span class=l>status.atProvider.state</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-58-10><a class=lnlinks href=#hl-58-10>10</a></span><span class=cl><span class=w> </span><span class=nt>matchString</span><span class=p>:</span><span class=w> </span><span class=s2>"Online"</span><span class=w> </span></span></span></code></pre></div><h3 id=match-an-integer>Match an integer <a class=anchor-link id=match-an-integer href=#match-an-integer aria-label="Link to this section: Match an integer"></a></h3><p><code>MatchInteger</code> considers the composed resource to be ready when the value of a field in that resource matches a specified integer.</p><div class="admonition note d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="note:"><use xlink:href="#info"/></svg><span class=ps-1>Note</span></div><div class=admonition-content><p>Crossplane doesn’t support matching <code>0</code>.</p></div></div><p>For example, matching the number <code>4</code> in the resource’s <code>status.atProvider.state</code> field.</p><div class=highlight label=matchint copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-59-1><a class=lnlinks href=#hl-59-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-59-2><a class=lnlinks href=#hl-59-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-59-3><a class=lnlinks href=#hl-59-3> 3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-59-4><a class=lnlinks href=#hl-59-4> 4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>my-resource</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-59-5><a class=lnlinks href=#hl-59-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-59-6><a class=lnlinks href=#hl-59-6> 6</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-59-7><a class=lnlinks href=#hl-59-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>readinessChecks</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-59-8><a class=lnlinks href=#hl-59-8> 8</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>MatchInteger</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-59-9><a class=lnlinks href=#hl-59-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>fieldPath</span><span class=p>:</span><span class=w> </span><span class=l>status.atProvider.state</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-59-10><a class=lnlinks href=#hl-59-10>10</a></span><span class=cl><span class=w> </span><span class=nt>matchInteger</span><span class=p>:</span><span class=w> </span><span class=m>4</span><span class=w> </span></span></span></code></pre></div><h3 id=match-that-a-field-exists>Match that a field exists <a class=anchor-link id=match-that-a-field-exists href=#match-that-a-field-exists aria-label="Link to this section: Match that a field exists"></a></h3><p><code>NonEmpty</code> considers the composed resource to be ready when a field exists with a value.</p><div class="admonition note d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="note:"><use xlink:href="#info"/></svg><span class=ps-1>Note</span></div><div class=admonition-content><p>Crossplane considers a value of <code>0</code> or an empty string as empty.</div></div><p>For example, to check that a resource’s <code>status.atProvider.state</code> field isn’t empty.</p><div class=highlight label=NonEmpty copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-60-1><a class=lnlinks href=#hl-60-1>1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-60-2><a class=lnlinks href=#hl-60-2>2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-60-3><a class=lnlinks href=#hl-60-3>3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-60-4><a class=lnlinks href=#hl-60-4>4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>my-resource</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-60-5><a class=lnlinks href=#hl-60-5>5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-60-6><a class=lnlinks href=#hl-60-6>6</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-60-7><a class=lnlinks href=#hl-60-7>7</a></span><span class=cl><span class=w> </span><span class=nt>readinessChecks</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-60-8><a class=lnlinks href=#hl-60-8>8</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>NonEmpty</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-60-9><a class=lnlinks href=#hl-60-9>9</a></span><span class=cl><span class=w> </span><span class=nt>fieldPath</span><span class=p>:</span><span class=w> </span><span class=l>status.atProvider.state</span><span class=w> </span></span></span></code></pre></div><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content>Checking <code>NonEmpty</code> doesn’t require setting any other fields.</div></div><h3 id=always-consider-a-resource-ready>Always consider a resource ready <a class=anchor-link id=always-consider-a-resource-ready href=#always-consider-a-resource-ready aria-label="Link to this section: Always consider a resource ready"></a></h3><p><code>None</code> considers the composed resource to be ready as soon as it’s created. Crossplane doesn’t wait for any other conditions before declaring the resource ready.</p><p>For example, consider <code>my-resource</code> ready as soon as it’s created.</p><div class=highlight label=none copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-61-1><a class=lnlinks href=#hl-61-1>1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-61-2><a class=lnlinks href=#hl-61-2>2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-61-3><a class=lnlinks href=#hl-61-3>3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-61-4><a class=lnlinks href=#hl-61-4>4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>my-resource</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-61-5><a class=lnlinks href=#hl-61-5>5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-61-6><a class=lnlinks href=#hl-61-6>6</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-61-7><a class=lnlinks href=#hl-61-7>7</a></span><span class=cl><span class=w> </span><span class=nt>readinessChecks</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-61-8><a class=lnlinks href=#hl-61-8>8</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>None</span><span class=w> </span></span></span></code></pre></div><h3 id=match-a-condition>Match a condition <a class=anchor-link id=match-a-condition href=#match-a-condition aria-label="Link to this section: Match a condition"></a></h3><p><code>Condition</code> considers the composed resource to be ready when it finds the expected condition type, with the expected status for it in its <code>status.conditions</code>.</p><p>For example, consider <code>my-resource</code>, which is ready if there is a condition of type <code>MyType</code> with a status of <code>Success</code>.</p><div class=highlight label=condition copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-62-1><a class=lnlinks href=#hl-62-1> 1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-62-2><a class=lnlinks href=#hl-62-2> 2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-62-3><a class=lnlinks href=#hl-62-3> 3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-62-4><a class=lnlinks href=#hl-62-4> 4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>my-resource</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-62-5><a class=lnlinks href=#hl-62-5> 5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-62-6><a class=lnlinks href=#hl-62-6> 6</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-62-7><a class=lnlinks href=#hl-62-7> 7</a></span><span class=cl><span class=w> </span><span class=nt>readinessChecks</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-62-8><a class=lnlinks href=#hl-62-8> 8</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>MatchCondition</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-62-9><a class=lnlinks href=#hl-62-9> 9</a></span><span class=cl><span class=w> </span><span class=nt>matchCondition</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-62-10><a class=lnlinks href=#hl-62-10>10</a></span><span class=cl><span class=w> </span><span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>MyType</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-62-11><a class=lnlinks href=#hl-62-11>11</a></span><span class=cl><span class=w> </span><span class=nt>status</span><span class=p>:</span><span class=w> </span><span class=l>Success</span><span class=w> </span></span></span></code></pre></div><h3 id=match-a-boolean>Match a boolean <a class=anchor-link id=match-a-boolean href=#match-a-boolean aria-label="Link to this section: Match a boolean"></a></h3><p>Two types of checks exist for matching boolean fields:</p><ul><li><code>MatchTrue</code></li><li><code>MatchFalse</code></li></ul><p><code>MatchTrue</code> considers the composed resource to be ready when the value of a field inside that resource is <code>true</code>.</p><p><code>MatchFalse</code> considers the composed resource to be ready when the value of a field inside that resource is <code>false</code>.</p><p>For example, consider <code>my-resource</code>, which is ready if <code>status.atProvider.manifest.status.ready</code> is <code>true</code>.</p><div class=highlight label=matchTrue copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-63-1><a class=lnlinks href=#hl-63-1>1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-63-2><a class=lnlinks href=#hl-63-2>2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-63-3><a class=lnlinks href=#hl-63-3>3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-63-4><a class=lnlinks href=#hl-63-4>4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>my-resource</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-63-5><a class=lnlinks href=#hl-63-5>5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-63-6><a class=lnlinks href=#hl-63-6>6</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-63-7><a class=lnlinks href=#hl-63-7>7</a></span><span class=cl><span class=w> </span><span class=nt>readinessChecks</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-63-8><a class=lnlinks href=#hl-63-8>8</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>MatchTrue</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-63-9><a class=lnlinks href=#hl-63-9>9</a></span><span class=cl><span class=w> </span><span class=nt>fieldPath</span><span class=p>:</span><span class=w> </span><span class=l>status.atProvider.manifest.status.ready</span><span class=w> </span></span></span></code></pre></div><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content>Checking <code>MatchTrue</code> doesn’t require setting any other fields.</div></div><p><code>MatchFalse</code> matches fields that express readiness with the value <code>false</code>.</p><p>For example, consider <code>my-resource</code>, is ready if <code>status.atProvider.manifest.status.pending</code> is <code>false</code>.</p><div class=highlight label=matchFalse copy-lines=none><pre tabindex=0 class=chroma><code class=language-yaml data-lang=yaml><span class=line><span class=ln id=hl-64-1><a class=lnlinks href=#hl-64-1>1</a></span><span class=cl><span class=nt>apiVersion</span><span class=p>:</span><span class=w> </span><span class=l>pt.fn.crossplane.io/v1beta1</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-64-2><a class=lnlinks href=#hl-64-2>2</a></span><span class=cl><span class=w></span><span class=nt>kind</span><span class=p>:</span><span class=w> </span><span class=l>Resources</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-64-3><a class=lnlinks href=#hl-64-3>3</a></span><span class=cl><span class=w></span><span class=nt>resources</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-64-4><a class=lnlinks href=#hl-64-4>4</a></span><span class=cl><span class=w></span>- <span class=nt>name</span><span class=p>:</span><span class=w> </span><span class=l>my-resource</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-64-5><a class=lnlinks href=#hl-64-5>5</a></span><span class=cl><span class=w> </span><span class=nt>base</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-64-6><a class=lnlinks href=#hl-64-6>6</a></span><span class=cl><span class=w> </span><span class=c># Removed for brevity</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-64-7><a class=lnlinks href=#hl-64-7>7</a></span><span class=cl><span class=w> </span><span class=nt>readinessChecks</span><span class=p>:</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-64-8><a class=lnlinks href=#hl-64-8>8</a></span><span class=cl><span class=w> </span>- <span class=nt>type</span><span class=p>:</span><span class=w> </span><span class=l>MatchFalse</span><span class=w> </span></span></span><span class=line><span class=ln id=hl-64-9><a class=lnlinks href=#hl-64-9>9</a></span><span class=cl><span class=w> </span><span class=nt>fieldPath</span><span class=p>:</span><span class=w> </span><span class=l>status.atProvider.manifest.status.pending</span><span class=w> </span></span></span></code></pre></div><div class="admonition tip d-flex flex-column mx-4 p-0"><div class=admonition-title><svg class="bi flex-shrink-0" role="img" aria-label="tip:"><use xlink:href="#check"/></svg><span class=ps-1>Tip</span></div><div class=admonition-content>Checking <code>MatchFalse</code> doesn’t require setting any other fields.</div></div></div></main></div><footer class="bd-footer p-5"><div class="container text-center"><div class="row pb-5 top-row"><div class="col-lg img-col"><img src=/img/crossplane-logo.svg alt="Crossplane logo" srcset="/img/crossplane-logo.svg 1x, /img/crossplane-logo.svg 2x" width=185 height=40 decoding=async data-nimg=future loading=lazy class="d-flex crossplane-footer"></div><div class="col-lg links-col d-fill justify-content-evenly ms-5"><div class=row><div class=col-lg><a class=footer-link target=_blank href=https://twitter.com/crossplane_io>Twitter</a></div><div class=col-lg><a class=footer-link target=_blank href=https://www.youtube.com/channel/UC19FgzMBMqBro361HbE46Fw>Youtube</a></div><div class=col-lg><a class=footer-link target=_blank href="https://www.youtube.com/playlist?list=PL510POnNVaaYFuK-B_SIUrpIonCtLVOzT">Podcast</a></div><div class=col-lg><a class=footer-link target=_blank href=https://groups.google.com/g/crossplane-dev>Forum</a></div></div></div></div><div class="row pb-5"><div class="col-lg copyright-col pe-4 border-end"><p>© Crossplane Authors 2024. Documentation distributed under <a target=_blank href=https://creativecommons.org/licenses/by/4.0/>CC-BY-4.0</a>.</p><p>© 2024 The Linux Foundation. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our <a target=_blank href=https://www.linuxfoundation.org/legal/trademark-usage>Trademark Usage</a> page.</p></div><div class="col-lg cncf-col ms-5"><a class=d-flex target=_blank href=https://www.cncf.io/><img alt=cncfLogo src=/img/cncf-white.webp width=702 height=114 decoding=async data-nimg=future loading=lazy class="cncf-footer py-3"></a><p class=d-flex>We are a Cloud Native Computing Foundation incubating project.</p></div></div></div></footer><script src=https://docs.crossplane.io/js/main-727bf178.bundle.min.js data-no-instant></script><script type=text/javascript>(function(e,t,n,s,o,i,a){e[n]=e[n]||function(){(e[n].q=e[n].q||[]).push(arguments)},i=t.createElement(s),i.async=1,i.src="https://www.clarity.ms/tag/"+o,a=t.getElementsByTagName(s)[0],a.parentNode.insertBefore(i,a)})(window,document,"clarity","script","el5517lxor")</script> <script>(function(e,t,n,s,o){e[s]=e[s]||[],e[s].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var a=t.getElementsByTagName(n)[0],i=t.createElement(n),r=s!="dataLayer"?"&l="+s:"";i.async=!0,i.src="https://www.googletagmanager.com/gtm.js?id="+o+r,a.parentNode.insertBefore(i,a)})(window,document,"script","dataLayer","GTM-WFF2NQHG")</script><noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WFF2NQHG" height=0 width=0 style=display:none;visibility:hidden></iframe></noscript><script type=text/javascript>adroll_adv_id="B4XQTO44VJFVDGCGM332GU",adroll_pix_id="6ROIBHUPMVCSXN7HHIKJTK",adroll_version="2.0",function(e,t,n,s,o){e.__adroll_loaded=!0,e.adroll=e.adroll||[],e.adroll.f=["setProperties","identify","track"];var i="https://s.adroll.com/j/"+adroll_adv_id+"/roundtrip.js";for(o=0;o<e.adroll.f.length;o++)e.adroll[e.adroll.f[o]]=e.adroll[e.adroll.f[o]]||function(t){return function(){e.adroll.push([t,arguments])}}(e.adroll.f[o]);n=t.createElement("script"),s=t.getElementsByTagName("script")[0],n.async=1,n.src=i,s.parentNode.insertBefore(n,s)}(window,document),adroll.track("pageView")</script><script src=https://cdn.jsdelivr.net/npm/@docsearch/js@3></script> <script>docsearch({container:"#docSearch",appId:"9UXKYX61NK",indexName:"crossplane",apiKey:"e07e181044d561f6a4cb7261931d980a",placeholder:"Search the docs"})</script></body></html>