-
Notifications
You must be signed in to change notification settings - Fork 2
/
composition.yaml
122 lines (121 loc) · 5.04 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: xsqlinstances.aws.platform.upbound.io
labels:
provider: aws
spec:
writeConnectionSecretsToNamespace: upbound-system
compositeTypeRef:
apiVersion: aws.platform.upbound.io/v1alpha1
kind: XSQLInstance
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:
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.providerConfigName
toFieldPath: spec.providerConfigRef.name
- name: deletionPolicy
patches:
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.deletionPolicy
toFieldPath: spec.deletionPolicy
- name: region
patches:
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.region
toFieldPath: spec.forProvider.region
resources:
- name: compositeSQLInstanceDbSubnetGroup
base:
apiVersion: rds.aws.upbound.io/v1beta1
kind: SubnetGroup
spec:
forProvider:
description: An excellent formation of subnetworks.
patches:
- patchSetName: providerConfigRef
type: PatchSet
- patchSetName: deletionPolicy
type: PatchSet
- patchSetName: region
type: PatchSet
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.networkRef.id
toFieldPath: spec.forProvider.subnetIdSelector.matchLabels[networks.aws.platform.upbound.io/network-id]
- name: RDSInstanceSmall
base:
apiVersion: rds.aws.upbound.io/v1beta1
kind: Instance
spec:
forProvider:
dbName: upbound
dbSubnetGroupNameSelector:
matchControllerRef: true
instanceClass: db.t3.micro
publiclyAccessible: false
skipFinalSnapshot: true
username: masteruser
connectionDetails:
- type: FromFieldPath
fromFieldPath: status.atProvider.endpoint
name: endpoint
- type: FromFieldPath
fromFieldPath: status.atProvider.address
name: host
- type: FromFieldPath
fromFieldPath: spec.forProvider.username
name: username
- type: FromConnectionSecretKey
fromConnectionSecretKey: attribute.password
name: password
patches:
- type: PatchSet
patchSetName: providerConfigRef
- type: PatchSet
patchSetName: deletionPolicy
- type: PatchSet
patchSetName: region
- type: FromCompositeFieldPath
fromFieldPath: metadata.uid
toFieldPath: spec.writeConnectionSecretToRef.name
transforms:
- type: string
string:
fmt: '%s-sql'
type: Format
- type: FromCompositeFieldPath
fromFieldPath: spec.writeConnectionSecretToRef.namespace
toFieldPath: spec.writeConnectionSecretToRef.namespace
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.engine
toFieldPath: spec.forProvider.engine
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.engineVersion
toFieldPath: spec.forProvider.engineVersion
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.storageGB
toFieldPath: spec.forProvider.allocatedStorage
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.networkRef.id
toFieldPath: spec.forProvider.vpcSecurityGroupIdSelector.matchLabels[networks.aws.platform.upbound.io/network-id]
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.autoGeneratePassword
toFieldPath: spec.forProvider.autoGeneratePassword
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.passwordSecretRef.namespace
toFieldPath: spec.forProvider.passwordSecretRef.namespace
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.passwordSecretRef.name
toFieldPath: spec.forProvider.passwordSecretRef.name
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.passwordSecretRef.key
toFieldPath: spec.forProvider.passwordSecretRef.key