Not necessarily, I just want to be able to access my API directly from browser instead of postman.
Jonathan Sanders
For access: I can't remember ec2 exactly but you should have a 'public ip' associated with your instance. You might need to set the security groups to allow access from anywhere from the port you are trying to hit though.
For charges: I would kill the instance as soon as you are done with it but you are going to get charged inevitably as well, just through mistakes/forgetting to down an instance/free tier expires and you don't remember at the time etc. Put some alerts on the account to email if the amount spent is beyond a few pennies.
Camden Parker
Yeah, I have the public ip and the security group set to inboud from any point but can acess via browser. Weird because postman access all crud normally.
Michael Ward
Just do it serverless. For low traffic it's basically free and easier to setup
Lucas Martin
might be trying to force https or something? I've had that happen sometimes. When you open up the console what is the get url?
Asher Bailey
I need exactly the server because it is an API for my portfolio. The point of the website is to show I can do some rest API.
* Preparing request to ec2.amazonaws.com:8080/api/users/ * Using default HTTP version * Enable automatic URL encoding * Enable SSL validation * Enable cookie sending with jar of 1 cookie * Found bundle for host ec2-amazonaws.com: 0x13e20039e10 [serially] * Can not multiplex, even if we wanted to! * Re-using existing connection! (#1) with host ec2.amazonaws.com * Connected to ec2.amazonaws.com (IP) port 8080 (#1)
> GET /api/users/ HTTP/1.1 > Host: ec2.amazonaws.com:8080 > Accept: */* * Mark bundle as not supporting multiuse
* Received 187 B chunk * Received 5 B chunk * Connection #1 to host ec2.amazonaws.com left intact
Owen Turner
here
Wyatt Murphy
FUCK AMAZON.
Thank you, found the solution. This trash must use http instead of https. Like anything in aws is a matter of correcting semantics and chars out of place.
BTW fuck aws.
Christopher Hall
welcome to modern development
Grayson Reed
>try to connect to aws rds >it has 10 different labels and names for a single db >spend hours trying to figure out how to write the prioper connection string >pajeet from youtube does dns:port/dbname >doesnt work >keep trying >for some reason what works is dns:port/postgres >db is nome called postgres
>try to simply download a file from s3 bucket to ec2 >spend hours playing with the many options of security groups >nothing works >find tutorial from 2015 doing some hacking >finally works
It just works.
Owen Miller
Oh no, aws won again.
I have the working link to my API from EC2 (must use http instead of https). But how do I keep the spring running on EC2 after I close the SSH connection via putty?
Is there a way to open EC2, start spring and let it running forever? Do I need to keep my pc on 24/7 to have putty on and the server running?
it's been some years you have to setup an API gateway and a network, a subnet with a load balancer or something like that. it's described in the docs, don't ask here asshole, use aws-cli
Easton Turner
Is it working with the public ec2 DNS.
http:ec2-some-ip-here.amazonaws:8080/api/user
Samuel Russell
Now my next problem is keeping the server running when I close putty.
Nathaniel Long
that's not how you do it because the IP changes whenever you restart the instance. you have to connect your instance to a network or api gateway might be enough, can't remember in detail.
James Robinson
use lambda or ec2 has hidden charges
Tyler Peterson
I'm doing this API to try to get a job. The last thing I need now is some sneaky charge in dolars. Luckly I'm not gonna pay that credit card anyway.
Caleb Green
dude... make it a systemd service. Or, for a quick fix, use tmux. Nevermind, I didn't say that, make it a service. Look up how to make a systemd service. Don't use tmux as a dirty workaround. AAAAAAH