-
Notifications
You must be signed in to change notification settings - Fork 134
/
Copy pathapp-database-postgresql.yaml
51 lines (51 loc) · 1.47 KB
/
app-database-postgresql.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
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: sql.db.aws.salaboy.com
labels:
type: dev
provider: aws
kind: sql
spec:
writeConnectionSecretsToNamespace: crossplane-system
compositeTypeRef:
apiVersion: salaboy.com/v1alpha1
kind: Database
resources:
- name: rdsinstance
base:
apiVersion: database.aws.crossplane.io/v1beta1
kind: RDSInstance
metadata:
annotations:
crossplane.io/external-name: # patched
spec:
providerConfigRef:
name: default
forProvider:
region: us-west-2
allocatedStorage: 5
dbInstanceClass: db.t3.micro
engine: postgres
engineVersion: "13"
masterUsername: salaboy
port: 5432
writeConnectionSecretToRef:
namespace: crossplane-system
name: postgresql
patches:
- fromFieldPath: metadata.name
toFieldPath: metadata.annotations[crossplane.io/external-name]
policy:
fromFieldPath: Required
- fromFieldPath: metadata.name
toFieldPath: metadata.name
transforms:
- type: string
string:
fmt: "%s-postgres"
connectionDetails:
- fromConnectionSecretKey: username
- fromConnectionSecretKey: password
- fromConnectionSecretKey: endpoint
- fromConnectionSecretKey: port