xnetworks.azure.platform.upbound.io
kind: Composition
apiVersion: apiextensions.crossplane.io/v1
metadata:
name: xnetworks.azure.platform.upbound.io
creationTimestamp: null
labels:
provider: azure
type: basic
spec:
compositeTypeRef:
apiVersion: azure.platform.upbound.io/v1alpha1
kind: XNetwork
mode: Pipeline
pipeline:
- step: patch-and-transform
functionRef:
name: crossplane-contrib-function-patch-and-transform
input:
apiVersion: pt.fn.crossplane.io/v1beta1
kind: Resources
patchSets:
- name: providerConfigRef
patches:
- fromFieldPath: spec.parameters.providerConfigName
toFieldPath: spec.providerConfigRef.name
type: FromCompositeFieldPath
- name: deletionPolicy
patches:
- fromFieldPath: spec.parameters.deletionPolicy
toFieldPath: spec.deletionPolicy
type: FromCompositeFieldPath
- name: network-id
patches:
- fromFieldPath: spec.parameters.id
toFieldPath: metadata.labels[azure.platform.upbound.io/network-id]
type: FromCompositeFieldPath
- name: region
patches:
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.location
type: FromCompositeFieldPath
resources:
- base:
apiVersion: azure.upbound.io/v1beta1
kind: ResourceGroup
name: resourceGroup
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- patchSetName: region
type: PatchSet
- base:
apiVersion: network.azure.upbound.io/v1beta1
kind: VirtualNetwork
spec:
forProvider:
addressSpace:
- 192.168.0.0/16
resourceGroupNameSelector:
matchControllerRef: true
name: virtualNetwork
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- patchSetName: region
type: PatchSet
- fromFieldPath: spec.parameters.id
toFieldPath: metadata.name
transforms:
- string:
fmt: "%s-vnet"
type: Format
type: string
type: FromCompositeFieldPath
- base:
apiVersion: network.azure.upbound.io/v1beta1
kind: Subnet
spec:
forProvider:
addressPrefixes:
- 192.168.1.0/24
resourceGroupNameSelector:
matchControllerRef: true
serviceEndpoints:
- Microsoft.Sql
virtualNetworkNameSelector:
matchControllerRef: true
name: subnet
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- fromFieldPath: spec.parameters.id
toFieldPath: metadata.name
transforms:
- string:
fmt: "%s-sn"
type: Format
type: string
type: FromCompositeFieldPath
writeConnectionSecretsToNamespace: upbound-system
© 2022 Upbound, Inc.
Discover the building blocksfor your internal cloud platform.