-
Notifications
You must be signed in to change notification settings - Fork 729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource Derived Types -> Add support for User Defined Types in referenced modules #13677
Comments
In this scenario what would the custom type declaration look like? And what does your existing bicepparam file that doesn't work look like (did you try creating and importing a custom types module)? |
In this example, the UDT definition will look like:
And the thing is that when I create a module with some parameters, including this type; I would like to pass the UDT without exporting the UDT but instead use a reference. Because I publish my modules to a registry and use only modules from that registry. So, I would like to re-use the resource derived type way of referencing for my container registry published modules. |
@schaijkw Why don't you want to export the UDT? |
The UDT can evolve over time. And when you use a UDT as a parameter for a module, you want a specific version of that UDT, the version at time of writing your module. |
I'm still not following. The Let's say you have the following template published as @export()
type myUDT = {
value: string
secondValue: int
}
param myUdtParam myUDT You can consume this template as both an import source and as a module: import {myUDT} from 'br/recipe:api:v1.0.4'
param myUDTParam myUDT
module myModule 'br/recipe:api:v1.0.4' = {
name: 'myModule-${deploymentDate}'
scope: resourceGroup
params: {
location: location
myUdtParam: myUDTParam
}
} |
Hi Jonny, thanks for providing your example and it will work in the most straight-forward situations. I think the way how resource derived types are referenced, is easier to use, strongly-typed/more type-safe and is abstracting underlying resource references. For example, we crafted module D in the image below. I believe that we don't have to know about the versions that are used by the modules we imported: At this moment I can reference an older version of module A without the IDE or bicep complaining. Code example: |
Is your feature request related to a problem? Please describe.
When you declare a user defined type as a parameter of a module, you now cannot reference this type dynamically.
Describe the solution you'd like
A way to reference myUDT so we can provide the values via bicepparam, like:
The text was updated successfully, but these errors were encountered: