Skip to content

Support transforms in connection details #177

Description

@bak-fts

I would like greater control in how connection details are written to kubernetes secrets. One way to achieve this could be by allowing patch & transform style transforms in the connectionDetails items, like so:

kind: Composition
spec:
  writeConnectionSecretsToNamespace: other-namespace
  mode: Pipeline
  pipeline:
  - step: patch-and-transform
    functionRef:
      name: function-patch-and-transform
    input:
      apiVersion: pt.fn.crossplane.io/v1beta1
      kind: Resources
      resources:
      - name: key
        base:
          # Removed for brevity
          spec:
            forProvider:
            # Removed for brevity
            writeConnectionSecretToRef:
              namespace: docs
              name: key1
        connectionDetails:
          - name: my-username
            type: FromConnectionSecretKey
            transforms:
              - type: string
                string:
                  type: Format
                  format: 'username = "%s"'
            fromConnectionSecretKey: username

This would allow me to use the resulting connection secret in the varFiles property of Terraform provider Workspaces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions