Get resource with its name pattern or type? #7609
-
Hi, I have a virtual network in a resource group with a name pattern like aks-vnet-XXX. The suffix of XXX is generated randomly. I know, maybe I should create a vnet before the deployment of cluster. But till now, I do not have to do that. There are two potential ways that I want to try:
Is that possible to achieve that? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
There could be a few approaches for this... Would it work to go from a known resource name with something that references the VNET ? I think you could find a reference from any of these
Something like ... resource cluster 'Microsoft.ContainerService/managedClusters@2022-05-02-preview' existing = {
name: 'myCluster01'
resource agentPool 'agentPools@2022-05-02-preview' existing = {
name: 'myPool01'
}
}
var subnetId = cluster::agentPool.properties.vnetSubnetID
output subnetId string = subnetId |
Beta Was this translation helpful? Give feedback.
There could be a few approaches for this...
Would it work to go from a known resource name with something that references the VNET ?
I think you could find a reference from any of these
Something like ...