Hi, Indeed as Carl said, you want to use ECS Execute Command, not SSH for containers in ECS. Much more secure, easier to audit, and far less faffing around to get it working.
On the public access side, did you put your service in a public subnet ? That'd be a subnet with the internet gateway as the default route. Did you enable granting an EIP to the container (not enabled by default)? You most likely already have opened the Security Group accordingly to do all that.
Note thought that, unless there is a very, very good reason for that, I wouldn't recommend to expose your services directly, and keep them behind an ALB (or NLB), for the simple reason that this enables a wealth of other features: ACM for TLS, WAF, audit logs, etc.
An acquaintance of mine who's using ECS Compose-X needed only to have egress to the internet access, to retrieve data, and publish it back elsewhere. So we put his service on a public subnet, with a VPC without NAT or anything (so no VPC costs incurred) and his service gets an EIP automatically. But there is no ingress to that service needed, which more or less makes it a Lambda function running via ECS ^^
Route 53 A record with Load Balancer DNS not propagatingAccepted Answerasked 2 months ago
Is it possible to connect aws fargate with task ip instead of load balancer DNS?Accepted Answer
Application Load Balancer for EC2 instance with Elastic IPasked 9 months ago
How to set the Load balancer service to route a certain host to a fargate task?Accepted Answerasked 5 months ago
The web acl is associated with the Application Load Balancer in the AWS region. After a few hours, it is found that the association has been cancelledasked 5 months ago
Application Load Balancer : external IP outside VPC ?asked 5 months ago
AWS Load Balancer Controller deployment to force creation of application Load Balancer?asked 7 months ago
Application load balancer blocks websocket connections?asked 5 months ago
Obtain client IP address through a network load balancer (TCP socket server, Python)asked 5 months ago
Can't access webpage with fargate's ip?Accepted Answer