I have to repeat a lot of plugin configuration for...
# troubleshooting
j
I have to repeat a lot of plugin configuration for each environment even though most of properties are the same in all environments. Example:
Copy code
- name: dev_local
  config:
    plugins:
      extractors:
      - name: tap-salesforce
        config:
          api_type: BULK
          is_sandbox: true
          select_fields_by_default: false
          start_date: '2023-01-01T00:00:00Z'
          streams_to_discover:
          - Account
          .....
The only property which differs in environemnts is the
start_date
. Is there a way how to specify the same properties in the main config and
start_date
per environment? If I am not mistaken, if I specify config both in main plugin config and in each environment, the environment config fully replaces the main one and it obviously does not work then....
a
https://docs.meltano.com/guide/configuration#specifying-environment-variables Could you just specify the different variables under the
env:
level and have top-level config the same?
j
Interesting. If I specify ENV_VAR in each environment, will it be expanded when used in the main plugin config?
I'll try it
Looks like it works! Man, you made my day(and the following weekend) 😉 Design:
Copy code
environments:
- name: dev
  env:
    START_DATE: "2023-01-01T00:00:00Z"
    SALESFORCE_SANDBOX: "true"
- name: prod
  env:
    START_DATE: "2021-01-01T00:00:00Z"
    SALESFORCE_SANDBOX: "false"
plugins:
  extractors:
  - name: tap-salesforce
    variant: meltanolabs
    pip_url: git+<https://github.com/jaceksan/tap-salesforce.git>
    config:
      api_type: BULK
      is_sandbox: ${SALESFORCE_SANDBOX}
      select_fields_by_default: false
      start_date: ${START_DATE}
      streams_to_discover:
        - Account
p
@jan_soubusta you should be able to do what you want without using env. For example I set a default start date at the top level of my config along with other configs, then override just start date in my CICD environment config
a
Yes, I don't think you need env variables for this @jan_soubusta
j
I am pretty sure that it did not work exactly in the case of tap-salesforce. But I may be wrong, will give it a try once more 😉
p
@jan_soubusta if its not working as expected then I'd call it a bug so feel free to open an issue with what youre seeing