manuel_garcia
06/14/2023, 10:46 AM.env
and on production they are injected via docker. How can be done? I have only seen environment variables for plugins.
An example meltano.yml
for clarification of what I want to do:
version: 1
default_environment: dev
project_id: <project_id>
environments:
- name: dev
- name: staging
- name: prod
plugins:
extractors:
- name: tap-rest-api-msdk
variant: widen
pip_url: tap-rest-api-msdk
config:
api_url: https://******
next_page_token_path: $.data.next
streams:
- name: dev_partner
headers:
Authorization: Bearer $TOKEN
X-Integration-Id: $INTEGRATION_ID
params:
include_deleted: 'true'
page_size: 250
path: /v1/data
primary_keys:
- id
records_path: $.data.results[*]
num_inference_records: 250
select:
- '*.*'
loaders:
- name: target-postgres
variant: transferwise
pip_url: pipelinewise-target-postgres
And the `.env`:
TOKEN=12345
INTEGRATION_ID=123kljh123kj1h23k1j23h1k2j3h
Thank you!Andy Carter
06/14/2023, 11:37 AMenvironments:
- name: prod
env:
# Level 3: environment-level `env:`
# Inherits from top-level `env:`
LEVEL_NUM: "3" # '3'
STACKED: "${STACKED}3" # '123'
manuel_garcia
06/14/2023, 12:34 PMmanuel_garcia
06/14/2023, 12:35 PMenv:
# Level 2: top-level `env:`
# Inherits from terminal context
LEVEL_NUM: "2" # '2'
STACKED: "${STACKED}2" # '12'
plugins:
extractors:
- name: tap-foobar
env:
# Level 4: plugin-level `env:`
# Inherits from a environment-level `env:` if an environment is active
# Inherits directly from top-level `env:` if no environment is active
LEVEL_NUM: "4" # '4'
STACKED: "${STACKED}4" # '1234'
environments:
- name: prod
env:
# Level 3: environment-level `env:`
# Inherits from top-level `env:`
LEVEL_NUM: "3" # '3'
STACKED: "${STACKED}3" # '123'
config:
plugins:
extractors:
- name: tap-foobar
env:
# Level 5: environment-level plugin `env:`
# Inherits from (global) plugin-level `env:`
LEVEL_NUM: "5" # '5'
STACKED: "${STACKED}5" # '12345'
user
06/14/2023, 12:51 PMmeltano config tap-x
it will print out the final config file thats passed to the extractor so you can see what is being expanded or notmanuel_garcia
06/14/2023, 12:52 PMuser
06/14/2023, 12:55 PMstreams
config into an environment variable like TAP_REST_API_MSDK_STREAMS="{\"blahblah\"}"
. Again I'd test that out using the config command to make sure it prints properlyuser
06/14/2023, 12:59 PMTAP_REST_API_MSDK_STREAMS='[ { "name": "dev_partner", "headers": { "Authorization": "Bearer $TOKEN", "X-Integration-Id": "$INTEGRATION_ID" }, "params": { "include_deleted": "true", "page_size": 250 },
"path": "/v1/data", "primary_keys": [ "id" ], "records_path": "$.data.results[*]", "num_inference_records": 250 } ]' meltano config tap-rest-api-msdk
manuel_garcia
06/14/2023, 1:01 PMuser
06/14/2023, 1:02 PMuser
06/14/2023, 1:05 PMmanuel_garcia
06/14/2023, 1:06 PM