The following resources are composed to implement the referenced Composite Resource Definition (XRD).
VPC
InternetGateway
Subnet
Subnet
Subnet
Subnet
RouteTable
Route
MainRouteTableAssociation
RouteTableAssociation
RouteTableAssociation
RouteTableAssociation
RouteTableAssociation
kind: Composition
apiVersion: apiextensions.crossplane.io/v1
metadata:
name: xnetworks.aws.caas.upbound.io
creationTimestamp: null
labels:
provider: aws
type: basic
spec:
compositeTypeRef:
apiVersion: aws.caas.upbound.io/v1alpha1
kind: XNetwork
patchSets:
- name: providerConfigRef
patches:
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.providerConfigName
toFieldPath: spec.providerConfigRef.name
- name: deletionPolicy
patches:
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.deletionPolicy
toFieldPath: spec.deletionPolicy
- name: network-id
patches:
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.id
toFieldPath: metadata.labels[networks.aws.caas.upbound.io/network-id]
- name: region
patches:
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.region
resources:
- name: caas-vcp
base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: VPC
spec:
forProvider:
cidrBlock: 192.168.0.0/16
enableDnsHostnames: true
enableDnsSupport: true
tags:
Name: ""
patches:
- type: PatchSet
patchSetName: providerConfigRef
- type: PatchSet
patchSetName: deletionPolicy
- type: PatchSet
patchSetName: network-id
- type: PatchSet
patchSetName: region
- fromFieldPath: metadata.name
toFieldPath: spec.forProvider.tags["Name"]
- name: gateway
base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: InternetGateway
spec:
forProvider:
vpcIdSelector:
matchControllerRef: true
patches:
- type: PatchSet
patchSetName: providerConfigRef
- type: PatchSet
patchSetName: deletionPolicy
- type: PatchSet
patchSetName: network-id
- type: PatchSet
patchSetName: region
- name: subnet-public-a
base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: Subnet
metadata:
labels:
access: public
spec:
forProvider:
cidrBlock: 192.168.0.0/18
mapPublicIpOnLaunch: true
tags:
kubernetes.io/role/elb: "1"
vpcIdSelector:
matchControllerRef: true
patches:
- type: PatchSet
patchSetName: providerConfigRef
- type: PatchSet
patchSetName: deletionPolicy
- type: PatchSet
patchSetName: network-id
- type: PatchSet
patchSetName: region
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.availabilityZone
transforms:
- type: string
string:
fmt: "%sa"
- fromFieldPath: spec.parameters.region
toFieldPath: metadata.labels[zone]
transforms:
- type: string
string:
fmt: "%sa"
- type: ToCompositeFieldPath
fromFieldPath: metadata.annotations[crossplane.io/external-name]
toFieldPath: status.subnetIds[0]
- name: subnet-public-b
base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: Subnet
metadata:
labels:
access: public
spec:
forProvider:
cidrBlock: 192.168.64.0/18
mapPublicIpOnLaunch: true
tags:
kubernetes.io/role/elb: "1"
vpcIdSelector:
matchControllerRef: true
patches:
- type: PatchSet
patchSetName: providerConfigRef
- type: PatchSet
patchSetName: deletionPolicy
- type: PatchSet
patchSetName: network-id
- type: PatchSet
patchSetName: region
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.availabilityZone
transforms:
- type: string
string:
fmt: "%sb"
- fromFieldPath: spec.parameters.region
toFieldPath: metadata.labels[zone]
transforms:
- type: string
string:
fmt: "%sb"
- type: ToCompositeFieldPath
fromFieldPath: metadata.annotations[crossplane.io/external-name]
toFieldPath: status.subnetIds[1]
- name: subnet-private-a
base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: Subnet
metadata:
labels:
access: private
spec:
forProvider:
cidrBlock: 192.168.128.0/18
tags:
kubernetes.io/role/internal-elb: "1"
vpcIdSelector:
matchControllerRef: true
patches:
- type: PatchSet
patchSetName: providerConfigRef
- type: PatchSet
patchSetName: deletionPolicy
- type: PatchSet
patchSetName: network-id
- type: PatchSet
patchSetName: region
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.availabilityZone
transforms:
- type: string
string:
fmt: "%sa"
- fromFieldPath: spec.parameters.region
toFieldPath: metadata.labels[zone]
transforms:
- type: string
string:
fmt: "%sa"
- type: ToCompositeFieldPath
fromFieldPath: metadata.annotations[crossplane.io/external-name]
toFieldPath: status.subnetIds[2]
- name: subnet-private-b
base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: Subnet
metadata:
labels:
access: private
spec:
forProvider:
cidrBlock: 192.168.192.0/18
tags:
kubernetes.io/role/internal-elb: "1"
vpcIdSelector:
matchControllerRef: true
patches:
- type: PatchSet
patchSetName: providerConfigRef
- type: PatchSet
patchSetName: deletionPolicy
- type: PatchSet
patchSetName: network-id
- type: PatchSet
patchSetName: region
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.availabilityZone
transforms:
- type: string
string:
fmt: "%sb"
- fromFieldPath: spec.parameters.region
toFieldPath: metadata.labels[zone]
transforms:
- type: string
string:
fmt: "%sb"
- type: ToCompositeFieldPath
fromFieldPath: metadata.annotations[crossplane.io/external-name]
toFieldPath: status.subnetIds[3]
- name: routeTable
base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: RouteTable
spec:
forProvider:
vpcIdSelector:
matchControllerRef: true
patches:
- type: PatchSet
patchSetName: providerConfigRef
- type: PatchSet
patchSetName: deletionPolicy
- type: PatchSet
patchSetName: network-id
- type: PatchSet
patchSetName: region
- name: route
base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: Route
spec:
forProvider:
destinationCidrBlock: 0.0.0.0/0
gatewayIdSelector:
matchControllerRef: true
routeTableIdSelector:
matchControllerRef: true
patches:
- type: PatchSet
patchSetName: providerConfigRef
- type: PatchSet
patchSetName: deletionPolicy
- type: PatchSet
patchSetName: network-id
- type: PatchSet
patchSetName: region
- name: mainRouteTableAssociation
base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: MainRouteTableAssociation
spec:
forProvider:
routeTableIdSelector:
matchControllerRef: true
vpcIdSelector:
matchControllerRef: true
patches:
- type: PatchSet
patchSetName: providerConfigRef
- type: PatchSet
patchSetName: deletionPolicy
- type: PatchSet
patchSetName: network-id
- type: PatchSet
patchSetName: region
- name: RouteTableAssociation-public-a
base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: RouteTableAssociation
spec:
forProvider:
routeTableIdSelector:
matchControllerRef: true
subnetIdSelector:
matchControllerRef: true
matchLabels:
access: public
patches:
- type: PatchSet
patchSetName: providerConfigRef
- type: PatchSet
patchSetName: deletionPolicy
- type: PatchSet
patchSetName: network-id
- type: PatchSet
patchSetName: region
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.subnetIdSelector.matchLabels[zone]
transforms:
- type: string
string:
fmt: "%sa"
- name: RouteTableAssociation-public-b
base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: RouteTableAssociation
spec:
forProvider:
routeTableIdSelector:
matchControllerRef: true
subnetIdSelector:
matchControllerRef: true
matchLabels:
access: public
patches:
- type: PatchSet
patchSetName: providerConfigRef
- type: PatchSet
patchSetName: deletionPolicy
- type: PatchSet
patchSetName: network-id
- type: PatchSet
patchSetName: region
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.subnetIdSelector.matchLabels[zone]
transforms:
- type: string
string:
fmt: "%sb"
- name: RouteTableAssociation-private-a
base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: RouteTableAssociation
spec:
forProvider:
routeTableIdSelector:
matchControllerRef: true
subnetIdSelector:
matchControllerRef: true
matchLabels:
access: private
patches:
- type: PatchSet
patchSetName: providerConfigRef
- type: PatchSet
patchSetName: deletionPolicy
- type: PatchSet
patchSetName: network-id
- type: PatchSet
patchSetName: region
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.subnetIdSelector.matchLabels[zone]
transforms:
- type: string
string:
fmt: "%sa"
- name: RouteTableAssociation-private-b
base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: RouteTableAssociation
spec:
forProvider:
routeTableIdSelector:
matchControllerRef: true
subnetIdSelector:
matchControllerRef: true
matchLabels:
access: private
patches:
- type: PatchSet
patchSetName: providerConfigRef
- type: PatchSet
patchSetName: deletionPolicy
- type: PatchSet
patchSetName: network-id
- type: PatchSet
patchSetName: region
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.subnetIdSelector.matchLabels[zone]
transforms:
- type: string
string:
fmt: "%sb"
writeConnectionSecretsToNamespace: upbound-system