Env and keyword mapping

Hello, I’m trying to set up a JSON config for a dev environment and later pushing towards a staging env but I’m getting errors when importing/exporting.

Command:

  • a0deploy import --config_file config.json --input_file tenant.yaml

  • a0deploy export --config_file config.json --format yaml --output_folder /…

Errors:

  • error: Problem running command import
  • error: connect ECONNREFUSED 127.0.0.1:443

JSON File

{
“AUTH0_DOMAIN”: “”,
“AUTH0_CLIENT_ID”: “”,
“AUTH0_CLIENT_SECRET”: “”,
“AUTH0_TENANT_NAME”: “”,
“SES_ACCESS_KEY_ID”: “”,
“SES_ACCESS_SECRET_KEY”: “”,
"AUTH0_KEYWORD_REPLACE_MAPPINGS": {
    "AUTH0_DOMAIN": "##AUTH0_DOMAIN##",
    "AUTH0_CLIENT_ID": "##AUTH0_CLIENT_ID##",
    "AUTH0_CLIENT_SECRET": "##AUTH0_CLIENT_SECRET##",
    "AUTH0_TENANT_NAME": "##AUTH0_TENANT_NAME##", 
    "SES_ACCESS_KEY_ID": "##SES_ACCESS_KEY_ID##", 
    "SES_ACCESS_SECRET_KEY": "##SES_ACCESS_SECRET_KEY##"
  },
  "AUTH0_ALLOW_DELETE": false,
  "AUTH0_EXCLUDED_RULES": [ "rule-1-name" ]
}

I have all the mappings set to an env file and if we hard code all values, it works. How do I fix this connection issue?

Hi @kevin.shrestha

Thanks for getting in touch with us here at Auth0 Community.

The JSON file that contains AUTH0_KEYWORD_REPLACE_MAPPINGS is your config so it needs to be hardcoded but you might have multiple version e.g. dev-config.json, prod-config.json and you’ll pass in the relevant config into the import/export command depending on which env is involved.

The Client/Tenant.json or YAML file is where you’ll have a single version and this is where the ##AUTH0_DOMAIN## variables will need to go. Please see https://auth0.com/docs/deploy/deploy-cli-tool/environment-variables-and-keyword-mappings for more info on this.

I hope this resolves the issue for you, any other questions please let me know.
Regards

1 Like