-
Notifications
You must be signed in to change notification settings - Fork 0
/
composition.yaml
85 lines (84 loc) · 2.18 KB
/
composition.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: xp-layers.crossplane.io
labels:
layer: composition
provider: aws
spec:
writeConnectionSecretsToNamespace: crossplane-system
compositeTypeRef:
apiVersion: xp-layers.crossplane.io/v1alpha1
kind: XNetwork
patchSets:
- name: common-patches
patches:
- type: FromCompositeFieldPath
fromFieldPath: spec.providerConfigName
toFieldPath: spec.providerConfigRef.name
- type: FromCompositeFieldPath
fromFieldPath: spec.region
toFieldPath: spec.forProvider.region
mode: Resources
resources:
# VPC resource
- name: vpc
base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: VPC
spec:
forProvider:
region: us-west-2
cidrBlock: 192.168.0.0/16
enableDnsSupport: true
enableDnsHostnames: true
providerConfigRef:
name: default
patches:
- type: PatchSet
patchSetName: common-patches
- type: FromCompositeFieldPath
fromFieldPath: spec.id
toFieldPath: metadata.name
transforms:
- type: string
string:
type: Format
fmt: "vpc-comp-%s"
- type: FromCompositeFieldPath
fromFieldPath: spec.id
toFieldPath: metadata.labels["xp-layers.crossplane.io/vpc-id"]
transforms:
- type: string
string:
type: Format
fmt: "vpc-comp-%s"
# InternetGateway resource
- name: gateway
base:
apiVersion: ec2.aws.upbound.io/v1beta1
kind: InternetGateway
spec:
forProvider:
region: us-west-2
providerConfigRef:
name: default
patches:
- type: PatchSet
patchSetName: common-patches
- type: FromCompositeFieldPath
fromFieldPath: spec.id
toFieldPath: metadata.name
transforms:
- type: string
string:
type: Format
fmt: "gateway-comp-%s"
- type: FromCompositeFieldPath
fromFieldPath: spec.id
toFieldPath: spec.forProvider.vpcIdSelector.matchLabels["xp-layers.crossplane.io/vpc-id"]
transforms:
- type: string
string:
type: Format
fmt: "vpc-comp-%s"