-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcomposition-func.yaml
60 lines (60 loc) · 1.83 KB
/
composition-func.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
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
creationTimestamp: "2024-03-19T10:12:40Z"
name: xacmedatabases.acme.com
spec:
compositeTypeRef:
apiVersion: acme.com/v1
kind: XAcmeDatabase
mode: Pipeline
pipeline:
- functionRef:
name: function-patch-and-transform
input:
apiVersion: pt.fn.crossplane.io/v1beta1
environment: null
kind: Resources
patchSets: []
resources:
- base:
apiVersion: sql.gcp.upbound.io/v1beta1
kind: DatabaseInstance
spec:
forProvider:
databaseVersion: POSTGRES_13
deletionProtection: false
region: us-west2
settings:
- diskSize: 10
tier: db-f1-micro
writeConnectionSecretToRef:
namespace: crossplane-system
connectionDetails:
- fromConnectionSecretKey: connectionName
name: connectionName
type: FromConnectionSecretKey
- fromConnectionSecretKey: publicIP
name: publicIP
type: FromConnectionSecretKey
- fromConnectionSecretKey: serverCACertificateCert
name: serverCACertificateCert
type: FromConnectionSecretKey
- name: port
type: FromValue
value: "5432"
name: DBInstance
patches:
- fromFieldPath: metadata.name
toFieldPath: spec.writeConnectionSecretToRef.name
transforms:
- string:
fmt: '%s-postgresql'
type: Format
type: string
type: FromCompositeFieldPath
- fromFieldPath: spec.storageGB
toFieldPath: spec.forProvider.settings[0].discSize
type: FromCompositeFieldPath
step: patch-and-transform
writeConnectionSecretsToNamespace: crossplane-system