apiVersion: core.oam.dev/v1alpha2
kind: WorkloadDefinition
metadata:
  name: rds
  annotations:
    definition.oam.dev/description: "RDS on Ali Cloud"
spec:
  definitionRef:
    name: rdsinstances.database.alibaba.crossplane.io
  extension:
    template: |
      output: {
        apiVersion: "database.example.org/v1alpha1"
        kind: "PostgreSQLInstance"
        metadata:
          name: context.name
        spec: {         
          parameters:
            storageGB: 20
          compositionSelector: {
            matchLabels:
              provider: parameter.provider
          }
          writeConnectionSecretToRef:
            name: parameter.secretname
        }
      }
      
      parameter: {
        secretname: *"db-conn" | string
        provider: *"alibaba" | string
      }
      
