My current setup is comprised of 3 EC2 instances – a NAT instance(public subnet), an Ubuntu node app(public subnet), and Wordpress(private subnet).
I'm able to connect to the private Wordpress instance via ssh port forwarding and proxy jumping using a command similar to this:
ssh -L <localPort>:localhost:<externalPort> -J EC2-User@<NATpublicIP> ubuntu@<privateIP> -i <pathToKeyFile.pem>
With this, I can successfully access my WordPress data via the localhost port I set and the built-in WP API; example: localhost:<localPort>/wp-json/wp/v2
.
On the node app(React with Gatsby) EC2 instance, I can make simple Axios get requests from external sources, but I'm unable to get data from the private WP API although I believe I gave the private security group inbound rules from the node app security group, but I'm not successful in retrieving my posts data.
Anyone successfully do this?
Note: I'm not using Amplify or anything like that at this moment. I'm simply using gatsby develop
to serve the src files of the app.