How to format external resource name in a patch transform without a string replace available? #5472
Unanswered
markphillips100
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm attempting to code a composition of Azure resources and like most azure resources they have naming restrictions. Storage account for example will not accept "-" characters and must be between 3 and 24 characters.
I want my XRD to only define an Id property. I want to use this Id to formulate the names of the composition resources, especially the external names. I'd prefer not to add specific composition resource names to the XRD and so names should be derived from the claim's identifier.
I'm using composition functions, specifically
xpkg.upbound.io/crossplane-contrib/function-patch-and-transform:v0.1.4
patch-and-transform to create the resources.Some of the resources, like say ResourceGroup, just require a transform of the
spec.id
so the external name is formatted like thisrg-%s
, However for storage account name I need to ensure "-" characters are removed but I see no way of achieving this using the available transforms. I would wish for a simple string replace transform but doesn't appear to be one. There is a regex but I'm not certain that can be used to achieve my requirement.Does anyone have a solution to my problem?
Beta Was this translation helpful? Give feedback.
All reactions