xnetworks.aws.platform.upbound.io
kind: Composition
apiVersion: apiextensions.crossplane.io/v1
metadata:
name: xnetworks.aws.platform.upbound.io
creationTimestamp: null
labels:
provider: aws
type: basic
spec:
compositeTypeRef:
apiVersion: aws.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[networks.aws.platform.upbound.io/network-id]
type: FromCompositeFieldPath
- name: network-id-tags
patches:
- fromFieldPath: spec.parameters.id
toFieldPath: spec.forProvider.tags[networks.aws.platform.upbound.io/network-id]
type: FromCompositeFieldPath
- name: region
patches:
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.region
type: FromCompositeFieldPath
resources:
- base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: VPC
spec:
forProvider:
cidrBlock: 192.168.0.0/16
enableDnsHostnames: true
enableDnsSupport: true
tags:
Name: ""
name: vpc
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- patchSetName: region
type: PatchSet
- fromFieldPath: metadata.name
toFieldPath: spec.forProvider.tags["Name"]
type: FromCompositeFieldPath
- fromFieldPath: status.atProvider.id
toFieldPath: status.vpcId
type: ToCompositeFieldPath
- base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: InternetGateway
spec:
forProvider:
vpcIdSelector:
matchControllerRef: true
name: internetGateway
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- patchSetName: region
type: PatchSet
- 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
name: subnetPublicA
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- patchSetName: network-id-tags
type: PatchSet
- patchSetName: region
type: PatchSet
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.availabilityZone
transforms:
- string:
fmt: "%sa"
type: Format
type: string
type: FromCompositeFieldPath
- fromFieldPath: spec.parameters.region
toFieldPath: metadata.labels[zone]
transforms:
- string:
fmt: "%sa"
type: Format
type: string
type: FromCompositeFieldPath
- fromFieldPath: metadata.annotations[crossplane.io/external-name]
toFieldPath: status.subnetIds[0]
type: ToCompositeFieldPath
- fromFieldPath: metadata.annotations[crossplane.io/external-name]
toFieldPath: status.publicSubnetIds[0]
type: ToCompositeFieldPath
- 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
name: subnetPublicB
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- patchSetName: network-id-tags
type: PatchSet
- patchSetName: region
type: PatchSet
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.availabilityZone
transforms:
- string:
fmt: "%sb"
type: Format
type: string
type: FromCompositeFieldPath
- fromFieldPath: spec.parameters.region
toFieldPath: metadata.labels[zone]
transforms:
- string:
fmt: "%sb"
type: Format
type: string
type: FromCompositeFieldPath
- fromFieldPath: metadata.annotations[crossplane.io/external-name]
toFieldPath: status.subnetIds[1]
type: ToCompositeFieldPath
- fromFieldPath: metadata.annotations[crossplane.io/external-name]
toFieldPath: status.publicSubnetIds[1]
type: ToCompositeFieldPath
- 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
name: subnetPrivateA
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- patchSetName: region
type: PatchSet
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.availabilityZone
transforms:
- string:
fmt: "%sa"
type: Format
type: string
type: FromCompositeFieldPath
- fromFieldPath: spec.parameters.region
toFieldPath: metadata.labels[zone]
transforms:
- string:
fmt: "%sa"
type: Format
type: string
type: FromCompositeFieldPath
- fromFieldPath: metadata.annotations[crossplane.io/external-name]
toFieldPath: status.subnetIds[2]
type: ToCompositeFieldPath
- fromFieldPath: metadata.annotations[crossplane.io/external-name]
toFieldPath: status.privateSubnetIds[0]
type: ToCompositeFieldPath
- 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
name: subnetPrivateB
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- patchSetName: region
type: PatchSet
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.availabilityZone
transforms:
- string:
fmt: "%sb"
type: Format
type: string
type: FromCompositeFieldPath
- fromFieldPath: spec.parameters.region
toFieldPath: metadata.labels[zone]
transforms:
- string:
fmt: "%sb"
type: Format
type: string
type: FromCompositeFieldPath
- fromFieldPath: metadata.annotations[crossplane.io/external-name]
toFieldPath: status.subnetIds[3]
type: ToCompositeFieldPath
- fromFieldPath: metadata.annotations[crossplane.io/external-name]
toFieldPath: status.privateSubnetIds[1]
type: ToCompositeFieldPath
- base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: RouteTable
spec:
forProvider:
vpcIdSelector:
matchControllerRef: true
name: routeTable
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- patchSetName: region
type: PatchSet
- base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: Route
spec:
forProvider:
destinationCidrBlock: 0.0.0.0/0
gatewayIdSelector:
matchControllerRef: true
routeTableIdSelector:
matchControllerRef: true
name: route
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- patchSetName: region
type: PatchSet
- base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: MainRouteTableAssociation
spec:
forProvider:
routeTableIdSelector:
matchControllerRef: true
vpcIdSelector:
matchControllerRef: true
name: mainRouteTableAssociation
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- patchSetName: region
type: PatchSet
- base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: RouteTableAssociation
spec:
forProvider:
routeTableIdSelector:
matchControllerRef: true
subnetIdSelector:
matchControllerRef: true
matchLabels:
access: public
name: routeTableAssociationPublicA
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- patchSetName: region
type: PatchSet
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.subnetIdSelector.matchLabels[zone]
transforms:
- string:
fmt: "%sa"
type: Format
type: string
type: FromCompositeFieldPath
- base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: RouteTableAssociation
spec:
forProvider:
routeTableIdSelector:
matchControllerRef: true
subnetIdSelector:
matchControllerRef: true
matchLabels:
access: public
name: routeTableAssociationPublicB
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- patchSetName: region
type: PatchSet
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.subnetIdSelector.matchLabels[zone]
transforms:
- string:
fmt: "%sb"
type: Format
type: string
type: FromCompositeFieldPath
- base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: RouteTableAssociation
spec:
forProvider:
routeTableIdSelector:
matchControllerRef: true
subnetIdSelector:
matchControllerRef: true
matchLabels:
access: private
name: routeTableAssociationPrivateA
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- patchSetName: region
type: PatchSet
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.subnetIdSelector.matchLabels[zone]
transforms:
- string:
fmt: "%sa"
type: Format
type: string
type: FromCompositeFieldPath
- base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: RouteTableAssociation
spec:
forProvider:
routeTableIdSelector:
matchControllerRef: true
subnetIdSelector:
matchControllerRef: true
matchLabels:
access: private
name: routeTableAssociationPrivateB
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- patchSetName: region
type: PatchSet
- fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.subnetIdSelector.matchLabels[zone]
transforms:
- string:
fmt: "%sb"
type: Format
type: string
type: FromCompositeFieldPath
- base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: SecurityGroup
spec:
forProvider:
description: Allow access to databases
name: platform-ref-aws-cluster
vpcIdSelector:
matchControllerRef: true
name: securityGroup
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- patchSetName: region
type: PatchSet
- fromFieldPath: metadata.annotations[crossplane.io/external-name]
toFieldPath: status.securityGroupIds[0]
type: ToCompositeFieldPath
- base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: SecurityGroupRule
spec:
forProvider:
cidrBlocks:
- 0.0.0.0/0
description: Everywhere
fromPort: 5432
protocol: tcp
securityGroupIdSelector:
matchControllerRef: true
toPort: 5432
type: ingress
name: securityGroupRulePostgres
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- patchSetName: region
type: PatchSet
- base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: SecurityGroupRule
spec:
forProvider:
cidrBlocks:
- 0.0.0.0/0
description: Everywhere
fromPort: 3306
protocol: tcp
securityGroupIdSelector:
matchControllerRef: true
toPort: 3306
type: ingress
name: securityGroupRuleMysql
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: network-id
type: PatchSet
- patchSetName: region
type: PatchSet
writeConnectionSecretsToNamespace: upbound-system
© 2022 Upbound, Inc.
Discover the building blocksfor your internal cloud platform.