How do I configure environment specific loader con...
# troubleshooting
k
How do I configure environment specific loader configs using environment variables? For example, given the following config, I can set the password for all environment using
TARGET_POSTGRES_PASSWORD
. But, how do I set the password for just the
prod
environment config?
Copy code
plugins:
  loaders:
  - name: target-postgres
    variant: meltanolabs
    config:
      dialect+driver: postgresql+psycopg2
      host: 127.0.0.1
      port: 5432
      user: postgres
environments:
- name: prod
  config:
    plugins:
      loaders:
      - name: target-postgres
        config:
          password: some_password_here
r
I don't think Meltano has an in-built way to configure plugin settings for specific environments via environment variables yet, but you should be able to use variable expansion to do what you want:
Copy code
plugins:
   loaders:
   - name: target-postgres
     variant: meltanolabs
     config:
       dialect+driver: postgresql+psycopg2
       host: 127.0.0.1
       port: 5432
       user: postgres
 environments:
 - name: prod
   config:
     plugins:
       loaders:
       - name: target-postgres
         config:
           password: some_password_here

   loaders:
   - name: target-postgres
     variant: meltanolabs
     config:
       dialect+driver: postgresql+psycopg2
       host: 127.0.0.1
       port: 5432
       user: postgres
 environments:
 - name: prod
   config:
     plugins:
       loaders:
       - name: target-postgres
         config:
           password: $PROD__TARGET_POSTGRES_PASSWORD
👍 2