Connect HttpResolver to API using custom port - aws-appsync

Hello: I'm creating an Appsync endpoint to gradually upgrade all of our old Rest API to GraphQL. In our API we aggregate data from some third party services (also REST).
One of those services has an endpoint running in a custom port (let's say 8050) and while our initial idea was to use Appsync HTTP Resolvers to connect to it we've been experiencing timeout problems. Our provider says there is nothing wrong with it's service but I've searched Amazon Appsync docs and there's nothing there about ports.
Has anyone else experienced this issue and knows how to solve it?
Thanks in advance.

When configuring your HTTP Data source, you can append the port to the HTTP Endpoint URL. See below.

As of May 2021, I tried to specify the port number in HTTP Endpoint URL in the Data Source configuration UI, it didn't work. I still received the timeout error.
Since I have control to the HTTP API server, I changed the server to listen on port 80, removed port number from the datasource HTTP endpoint config, and things start to work. It seems as of now, appsync does not support listening on ports other than 80 for http.

Related

In Mirth (nextgen-connect) how do I configure the HTTP URL of an HTTP Listener

The manual says this about the HTTP URL value of an http listener:
"Displays the generated HTTP URL for the HTTP Listener. This is not an actual
configurable setting, but is instead displayed for copy/paste convenience. Note
that the host in the URL will be the same as the host you used to connect to
the Administrator. The actual host that connecting clients use may be different
due to differing networking environments."
When I have used the feature in the past its value has always begun "http://localhost:" which would be great except this time it is auto-generating " http://'domainName':${Incoming_Pathology_Source_Port}/${Incoming_Pathology_Source_BaseContextPath}/"
For the first time, we are deploying Mirth inside a Kubernetes cluster, 'a different working environment'. (nginx accepts https and we want it pass the messages on as http to Mirth).
Is there any way I can take control of the URL or must I change the configuration of the cluster in some way.
All help/suggestions welcome.

How to serve gRPC and REST with TLS enable on the same port

I'm trying to create a gRPC/REST PoC written in Go.
I would like to serve the gRPC and REST on the same port, in a TLS connection. I'm also using serving metrics.
When accessing my service through HTTP/1, all is working as expected
When accessing the /metrics url, all is working as expected
When accessing the gRPC service directly, using a client I received a connection close response
I do not know how to debug this kind of error.
I have created a repo on https://github.com/lrobinot/grpc-poc to reproduce the issue.
Can someone give me pointers to some resources or show me my enormous error :)
Thanks in advance!

HTTPS Request/Response processing via Apama

What additional setup is required to perform HTTPS call using HTTPClient adapter in Apama. I have used the host and port as 443. But still it is giving host not found error with status 400. The same https endpoint is working in POSTMAN , Browser and Integration Server. Please help.
You need to set 'tls' to true in the config for HTTPClient (see http://www.apamacommunity.com/documents/10.3.1.1/apama_10.3.1.1_webhelp/apama-webhelp/#page/apama-webhelp%2Fco-ConApaAppToExtCom_httpclient_configuring_the_http_client_transport.html%23 )
Or, if you're using the Generic HTTP EPL API, it's HttpTransport.getOrCreateWithConfigurations(host, port, {HttpTransport.CONFIG_TLS:"true"})
There's also tlsAcceptUnrecognizedCertificates and tlsCertificateAuthorityFile if you have a service that's not using a recognisable certificate.

Kubernetes - route static IP to multiple services (Google Cloud Platform)

I have a small application comprising three services:
A single page application (SPA) served from nginx
A simple nodejs HTTP API used by the SPA
An MQtt broker exposing ports 1883 and 9001
Ideally I'd like the all to be served from the same subdomain and static IP address and have been trying to configure this in Kubernetes on the Google Cloud Platform.
I've created deployments for each of the services, with the SPA exposing port 80, the API 3000 and the MQTT broker 1883/9001. I've then followed the instructions here to set up a static IP and a Service to route to the SPA, then created similar services for the API and the MQTT app. (I've initally adapted these from deployments and services generated from a docker-compose file and Kompose).
The SPA and API seem to work fine but the MQTT service does not. When I run kubetl get events I see:
Error creating load balancer (will retry): failed to ensure load balancer for service default/mqtt-broker: failed to create forwarding rule for load balancer (a5529f2a9bdaf11e8b35d42010a84005(default/mqtt-broker)): googleapi: Error 400: Invalid value for field 'resource.IPAddress': '35.190.221.113'. Specified IP address is in-use and would result in a conflict., invalid
So I'm wondering if I should be creating a single service to route to the three deployments but can't find any documentation or examples that explain how to do this for a non http service.
I guess I could put the mqtt service on a separate IP address but this seems to be hacking around the problem rather than solving it.
Thanks in advance for any advice.
I eventually found an almost identical use case to my own on this github repository.
In essence, they are creating the MQTT broker on a separate static IP and using Kubernetes API calls to expose the details to the front end, which they explain in the following comment at the top of the web.yaml file:
This needs a bit of trickery
as it needs to expose the LB ip address for the MQTT server. That
requires kubernetes API calls to look it up, and the ability to
store it somewhere (we put it in a secret). To be secure this is
done with a dedicated service account and an init container.
https://github.com/IBM/ny-power

REST API with Single Page Application over HTTPS on Firefox only

I am developing a web service using REST API. This REST API is running on port 6443 for HTTPS. Client is going to be a Single page application running on port 443 for HTTPS on same machine. The problem I am facing is:
While I hit the url say: https://mymachine.com/new_ui I get certificate exception for an invalid certificate because I use a self signed one, so mymachine.com:443 gets added to server exception. But still requests doen't go to REST API as they are running on https://mymachine.com:6443/restservice. If I manually add mymachine.com:6443 to server exception on firefox it works but it will not be the case in production for customers.
Some options that I thought are:
1. Give another pop up and ask to add REST server on port 6443 exception too.But this doesn't look proper as why an end user should accept the cerf for same domain twice. Also REST api server port can change.
Can we programmatically add exception for domain and both the ports in one shot? Ofcourse with the consent of the user. 3. Use a reverse proxy. But then its going to have memory footprint on our system. Also it will be time consuming.
Please suggest some options. How do I deal with it. Thank you