Bitcoin core that is running inside the aws ec2 instance has rpc server hosted inside the instance which you can connect with a rpc url something like this http://127.0.0.1:18332/ , this url will work inside the ec2 instance, but if you want to connect to the same rpc server from a different machine(like from your personal laptop), you can use ngrok (maybe) to expose localhost as https and then try to access from you machine with the new ngrok url. I have not tried this, but let me know if this works.
Or if you can somehow expose the localhost url to an https, that should help you to connect to it.