I’ve got a new function, which is successfully created when running the push command, but the https_endpoints->config.json configuration file has no effect to the infrastructure and no errors are reported. How can I create the https endpoint for the above function then? Setting it up manually via the UI does work, but nothing happens when trying the same via the realm-cli…
For reference my config.json file is similar to the following:
I’ve got a new function, which is successfully created when running the push command, but the https_endpoints->config.json configuration file has no effect to the infrastructure and no errors are reported.
Setting it up manually via the UI does work, but nothing happens when trying the same via the realm-cli…
Just to clarify - It sounds like the push itself is successful but you are not seeing the changes to the HTTPS Endpoint configuration after the push. In addition to this, I presume the function itself testingonly is already created and you’re only trying to create the HTTPS endpoint to associate it with this function. Please correct me if I am incorrect in either of my assumptions.
Regarding the push itself, are you seeing something similar to the below output?
Due to the -y option used, I believe the proposed changes won’t be logged to the output in the cli. Would you be able to try create another HTTPS_endpoint again and provide the output without the -y option? Additionally, could you try creating the HTTPS_endpoint directly from the application folder (or even a test application folder) without the use of --remote or --local for troubleshooting purposes? This will help determine what the issue may be when creating the custom endpoint.
An example of this below from my test environment where a HTTPS_Endpoint is created (original config.json only containing []):
realm-cli pull which created the "http_endpoints" folder:
$ ../realm-cli pull
? Directory '/Users/<REDACTED>/mongodb-realm-cli/node_modules/mongodb-realm-cli/Application-1' already exists, do you still wish to proceed? Yes
Saved app to disk
Successfully pulled app down: .
❯ ls
total 8
drwxr-xr-x 4 staff 128 1 Dec 10:59 auth
drwxr-xr-x 3 staff 96 1 Dec 10:59 data_sources
drwxr-xr-x 7 staff 224 1 Dec 10:59 environments
drwxr-xr-x 4 staff 128 1 Dec 10:59 functions
drwxr-xr-x 4 staff 128 1 Dec 10:59 graphql
drwxr-xr-x 3 staff 96 1 Dec 20:20 http_endpoints /// <--- Created from the pull
drwxr-xr-x 3 staff 96 1 Dec 10:59 https_endpoints /// <--- Manually changed prior to pull
drwxr-xr-x 2 staff 64 1 Dec 10:59 log_forwarders
-rw-r--r-- 1 staff 201 1 Dec 20:20 realm_config.json
drwxr-xr-x 3 staff 96 1 Dec 10:59 sync
drwxr-xr-x 2 staff 64 1 Dec 10:59 values
realm-cli push and the changes were back to normal
It may be possibly easier to just remove the directory and do a fresh pull of the application, make the changes from the "http_endpoints" directory that is created, and perform a push again.
Let me know if both a fresh pull / push doesn’t work either.
Downloading the structure using a pull and then adding the http_endpoints (https_endpoints is not tracked/does not work as you’ve suggested) has done the job!
I’ve noticed that the project structure is a bit different now compared to what it was like with v.1 of the realm-cli. However it’s easy enough to move the necessary files around and update some of the config files to match the new style!