Shinyproxy ECS Backend with public subnets

Hi,
we have been usign Shinyproxy for years with a Kubernetes backend and we now would like to transition to an ECS backend. I followed the example application referenced in the docs but updated certain things to comform to our other ECS service set ups that we have. For the testing part of the transition, I also removed the load balancer. By conforming to existing set ups we have, I am using a VPC with public subnets (the example app has private subnets). This also means that the network configuration under the ECS service needs to have assign public IP enabled in order to pull images from ECR. This is easily done for the ShinyProxy part in the configuration. However, when trying to pull the image for the Shiny app once we are logged in to ShinyProxy, the task created by ShinyProxy eventaully times out with a connection error. After a ton of checks and experiments, I reckon the issue is that the task pulling the shiny app image does not get a public IP address assigned (it remains empty in the task and the ENI). Is there a way to work with public subnets in the ECS set up and ensure that in case of public subnets used, a public IP is assigned to the task definition that pulls the shiny app image?
Or did I miss something else and the AWS ECR ResourceInitializationError may be resolved another way?
Thanks so much!

Hi

I’m happy to hear that you are already using ShinyProxy for years!
Regarding your issue: while assigning a public IP to every task could maybe solve the issue, I don’t think this is a good idea.
First of all public IPs are expensive and by default you can only use 5 public IPs in your VPC: Amazon VPC quotas - Amazon Virtual Private Cloud

If you want to run your apps in a public subnet, the subnet should have an internet gateway attached to it: Enable internet access for a VPC using an internet gateway - Amazon Virtual Private Cloud

If you are using the vpc terraform module, as in the example (shinyproxy-config-examples/20-ecs-minimal/terraform/2_vpc.tf at master · openanalytics/shinyproxy-config-examples · GitHub), this should work out of the box. So it might be that you are running into some other issue.

Thanks so much for your quick and extensive response! I also very much apprecaite all the work that’s going into ShinyProxy - great stuff!!
Yes, I used the minimal example as a template and was trying to adapt it to a slightly different terrafom setup from the get go. I very much appreciate your advice! I’ll just go back to the drawingboard based completely off the minimal example and will take any adaptation from there.
Thanks again for your help,
Ferko