Accessing Running Container on AWS to my local machine

0

I have a requirement where i am running mysql on a container on aws and want to access it as if it was installed on my local machine i.e, if i hit localhost:3306 on my local machine, i should be able to access the mysql database which is running on aws. How to achieve this?

1개 답변
0

I would say that given your explanation, the way to do this is to have a EC2 instance running SSM and create a tunnel that will point localhost:3306 to your container|host:3306. If you are on ECS you could look at using execute-command but that'd be mostly to execute admin tasks remotely.

You could also consider using a web based admin tool, i.e. phpMyAdmin or stuff like that so that you don't require tunneling.

But for the long run, I'd recommend to not rely on that and not to run DB containers unless you really know what you're doing.

Instead, use RDS / RDS Aurora. If costs is an issue, consider Aurora Serverless. I have an instance running for 1y+ and never paid for it (it's there for API integrations, not for actual DB work). If need be you can still tunnel to it or use other ways to manage it.

profile picture
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인