When trying to access a parameter of a config type based on a SQL scrapeconfig, the parameter is returned as a string instead of an object, this means that it has to be converted into an object via a json call , see example below, the last line should not need the "json" conversion.
apiVersion: mission-control.flanksource.com/v1
kind: Playbook
metadata:
name: grant-mssql-user-db-access
spec:
description: Grant an MSSQL user read or readwrite access to a database
parameters:
- name: database
label: Database
type: config
properties:
filter:
- types:
- MSSQL::Database
actions:
- name: 'debug show params'
if: "always()"
exec:
script: >
echo "{{ (json ((.params.database).config )).id }}"
When trying to access a parameter of a config type based on a SQL scrapeconfig, the parameter is returned as a string instead of an object, this means that it has to be converted into an object via a json call , see example below, the last line should not need the "json" conversion.