terrajet icon indicating copy to clipboard operation
terrajet copied to clipboard

Reference network interface in VM creation

Open vishnujanardhanan opened this issue 2 years ago • 0 comments

Hi, This is not a bug, but i need help with configuring the network interface in VM's spec. I'm using terrajet to create a VM in azure and it has a field called spec -> networkInterfaceIds. However I have defined Network interface and VM in the same composition file so not sure how i reference Network interface id in VM's spec? Attaching my compostion file for reference. Please help.

apiVersion: apiextensions.crossplane.io/v1 kind: Composition metadata: name: compositiont0services.vj.com labels: provider: azure vnet: crossplane-poc-new spec: compositeTypeRef: apiVersion: vj.com/v1alpha1 kind: crdt0service resources:

  • name: vnet base: apiVersion: network.azure.crossplane.io/v1alpha3 kind: VirtualNetwork metadata: labels: provider: azure vnet: crossplane-poc-new spec: resourceGroupNameSelector: matchControllerRef: true matchLabels: provider: azure vnet: crossplane-poc-new location: South India providerConfigRef: name: az-provider-config properties: addressSpace: addressPrefixes:
  • 10.2.0.0/24
  • name: resourcegroup base: apiVersion: azure.crossplane.io/v1alpha3 kind: ResourceGroup metadata: labels: provider: azure vnet: crossplane-poc-new spec: location: South India providerConfigRef: name: az-provider-config
  • name: subnet base: apiVersion: network.azure.crossplane.io/v1alpha3 kind: Subnet metadata: labels: provider: azure vnet: crossplane-poc-new spec: resourceGroupNameSelector: matchControllerRef: true matchLabels: provider: azure vnet: crossplane-poc-new virtualNetworkNameSelector: matchControllerRef: true matchLabels: provider: azure vnet: crossplane-poc-new location: South India providerConfigRef: name: az-provider-config properties: addressPrefix: 10.2.0.0/25
  • name: vm base: apiVersion: compute.azure.jet.crossplane.io/v1alpha1 kind: LinuxVirtualMachine metadata: labels: provider: azure vnet: crossplane-poc-new spec: providerConfigRef: name: az-provider-config forProvider: adminUserName: azuser location: South India name: vm networkInterfaceIds: ==== osDisk: caching: == storageAccountType: == size: Standard_B1s resourceGroupNameSelector: matchControllerRef: true matchLabels: provider: azure vnet: crossplane-poc-new
  • name: nic base: apiVersion: compute.azure.jet.crossplane.io/v1alpha2 kind: NetworkInterface metadata: labels: provider: azure vnet: crossplane-poc-new spec: providerConfigRef: name: az-provider-config forProvider: ipConfiguration:
  • name: aznic privateIpAddressAllocation: Dynamic subnetIdselector: matchControllerRef: true matchLabels: provider: azure vnet: crossplane-poc-new location: South India name: vm resourceGroupNameSelector: matchControllerRef: true matchLabels: provider: azure vnet: crossplane-poc-new

vishnujanardhanan avatar May 25 '22 04:05 vishnujanardhanan