nicc777 / py-animus

A python based plugable and extensible manifest processing system
GNU General Public License v3.0
0 stars 0 forks source link

Add support for variable placeholders in Manifests (compliment to values placeholders) #67

Closed nicc777 closed 1 year ago

nicc777 commented 1 year ago

Brief Description of the Enhancement

Extend the feature of supporting values in manifests and support for variable substitution based on prior processed manifests (implied dependency, in this case)

Describe the benefit of this proposed enhancement

Allows the implementation of some manifests that set some variable values to re-use those values in other manifests.

Code examples, pseudo code or any other technical description of the proposal

General parsing rule:

Basic example:

---
kind: ShellScript
version: v1
metadata:
  name: cli-get-aws-secret-sandbox
  skipDeleteAll: true
  environments:
  - sandbox
spec:
  source:
    type: filePath
    path: '/opt/get-aws-sandbox-secret.sh'
---
kind: AwsBoto3Session
version: v1
metadata:
  name: aws-boto3-session-v1-aws-session-access-key-sandbox
  dependencies:
    apply: cli-get-aws-secret-sandbox
  environments:
  - sandbox
  executeOnlyOnceOnApply: true
  skipDeleteAll: true
spec:
  awsAccessKeyId: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  awsRegion: eu-central-1
  awsSecretAccessKey:
    source: '{{ .Variables.ShellScript:cli-get-aws-secret-sandbox:sandbox:STDOUT }}'