Hasura CLI: connector create
Create a new Hasura Cloud Data Connector.
Synopsis
This command triggers deployment of a custom Hasura Data Connector agent to Hasura Cloud. The source of the connector is fetched from the GitHub repository provided to the flag --github-repo-url
. Please note:
- The provided repository must be publicly accessible.
- The provided repository should follow the GDC spec: https://github.com/hasura/graphql-engine/blob/master/dc-agents/DOCUMENTATION.md.
- The provided repository should have a Dockerfile at the root directory which will be used to build the image.
- The Data Connector should listen on port
8080
.
Further Reading:
- https://hasura.io/docs/latest/databases/data-connectors/
- https://github.com/hasura/graphql-engine/tree/master/dc-agents/reference
- https://github.com/hasura/graphql-engine/blob/master/dc-agents/DOCUMENTATION.md
hasura connector create [connector-name] [flags]
Examples
# source code for the connector is at HEAD of the main branch
hasura connector create my-connector:v1 --github-repo-url https://github.com/hasura/weaviate_gdc/tree/main
# source code for the connector is at HEAD of a custom branch, eg - abhinav/fix_in_operator
hasura connector create my-connector:v2 --github-repo-url https://github.com/hasura/weaviate_gdc/tree/abhinav/fix_in_operator
# source code for the connector is at commit ref, eg - 93e644c87567c44e7dced66362fa7100f5a93042
hasura connector create my-connector:v3 --github-repo-url https://github.com/hasura/weaviate_gdc/tree/93e644c87567c44e7dced66362fa7100f5a93042
# (optional) connector configuration file (config.json) located at '/home/user/config.json'
hasura connector create my-connector:v4 --github-repo-url https://github.com/hasura/weaviate_gdc/tree/abhinav/fix_in_operator --config-file /home/user/config.json
# Add env vars to the deployed connector
hasura connector create my-connector:v1 --github-repo-url https://github.com/hasura/weaviate_gdc/tree/main --env URL=http://example.com -e DB_CREDENTIALS=postgres://user:pass@host:port/db
# Mount a volume in the connector (the file '/home/user/secrets.json' in user machine to be mounted at '/etc/connector/config.json' in the connector deployment)
hasura connector create my-connector:v1 --github-repo-url https://github.com/hasura/weaviate_gdc/tree/main --volume /home/user/secrets.json:/etc/connector/config.json
Options
-c, --config-file string path to the configuration file
-e, --env stringArray Set environment variables
--github-repo-url string url of the github repo which contains connector source code
-h, --help help for create
-v, --volume string mount a folder in the container. Use docker syntax of <host-dir-path>:<container-target-path>
SEE ALSO
- hasura connector - Hasura Data Connector CLI
Auto generated by spf13/cobra