amazon-ecs

How to have AWS ECS automatically map ports of my container to the host machine(EC2)

天大地大妈咪最大 提交于 2020-12-13 04:01:44
问题 Context: I am using Circle CI's aws-ecs/deploy-service-update orb to deploy my docker container by pulling the latest image in AWS ECR and deploy it in AWS ECS with AWS EC2 instance. This container is a Machine Learning model that accepts API requests at TCP port 3000(I am using fastAPI for this) and returns the predictions. After I deployed it I couldn't send requests to the public IP of the container instance of the task that deploys the container at port 3000 (This IP is not my EC2

How to get the event content in ECS when it is invoked by cloudwatch/eventbridge event?

那年仲夏 提交于 2020-12-12 11:27:05
问题 We can set up event rules to trigger an ECS task, but I don't see if the triggering event is passed to the runing ECS task and in the task how to fetch the content of this event. If a Lambda is triggered, we can get it from the event variable, for example, in Python: def lambda_handler(event, context): ... But in ECS I don't see how I can do things similar. Going to the cloudtrail log bucket doesn't sound to be a good way because it has around 5 mins delay for the new log/event to show up,

Get TargetGroupArn from name?

允我心安 提交于 2020-12-12 11:12:32
问题 You use TargetGroupArn in a CF template for ECS services. I have a situation where the target group has already been created and I want to make this a param for the template But those arn's are awful: arn:aws:elasticloadbalancing:us-east-1:123456:targetgroup/mytarget/4ed48ba353064a79 That unique number at the end makes this almost impossible. Can I reference the target by name instead of full arn in the template? Maybe i can use Fn::GetAtt here but not sure what that looks like This doesn't

Get TargetGroupArn from name?

北城余情 提交于 2020-12-12 11:12:16
问题 You use TargetGroupArn in a CF template for ECS services. I have a situation where the target group has already been created and I want to make this a param for the template But those arn's are awful: arn:aws:elasticloadbalancing:us-east-1:123456:targetgroup/mytarget/4ed48ba353064a79 That unique number at the end makes this almost impossible. Can I reference the target by name instead of full arn in the template? Maybe i can use Fn::GetAtt here but not sure what that looks like This doesn't

Get TargetGroupArn from name?

痴心易碎 提交于 2020-12-12 11:12:03
问题 You use TargetGroupArn in a CF template for ECS services. I have a situation where the target group has already been created and I want to make this a param for the template But those arn's are awful: arn:aws:elasticloadbalancing:us-east-1:123456:targetgroup/mytarget/4ed48ba353064a79 That unique number at the end makes this almost impossible. Can I reference the target by name instead of full arn in the template? Maybe i can use Fn::GetAtt here but not sure what that looks like This doesn't

Exposing to public more than 1 port with AWS ECS service and Elastic LoadBalancer

社会主义新天地 提交于 2020-12-08 06:04:51
问题 I have service that exposes multiple ports and it worked fine with kubernetes but now we move it to AWS ECS. It seems I can only expose ports via Load Balancer and I am limited to 1 port per service/tasks even when docker defines multiple ports I have to choose one port Add to load balancer button allows to add one port. Once added there is no button to add second port. Is there any nicer workarround than making second proxy service to expose second port? UPDATE: I use fargate based service.

Exposing to public more than 1 port with AWS ECS service and Elastic LoadBalancer

ぐ巨炮叔叔 提交于 2020-12-08 06:02:54
问题 I have service that exposes multiple ports and it worked fine with kubernetes but now we move it to AWS ECS. It seems I can only expose ports via Load Balancer and I am limited to 1 port per service/tasks even when docker defines multiple ports I have to choose one port Add to load balancer button allows to add one port. Once added there is no button to add second port. Is there any nicer workarround than making second proxy service to expose second port? UPDATE: I use fargate based service.

How to diagnose ECS Fargate task failing to start?

浪尽此生 提交于 2020-12-02 06:12:25
问题 I'm trying to launch/run a Dockerfile on AWS using their ECS service. I can run my docker image locally just fine, but it's failing on the Fargate launch type. I've uploaded my Docker image to ECR, and I've created a cluster/service/task from it. However, my cluster's task status simply reads "DEPROVISIONING (Task failed to start)", but it provides no logs or details of the output of my running image, so I have no idea what's wrong. How do I find more information and diagnose why ECS isn't

Cloudwatch failedinvocation error no logs available

半腔热情 提交于 2020-11-26 01:37:40
问题 I have set up a Cloudwatch rule event where an ECS task definition is started when a previous task definition is completed. I can see the event triggers the task definition however it fails. The only visibility of this failure is in the rule metrics, where I see the metric failedinnvocations. Question, are there any logs to see why the trigger failed? I can manually set up the rule via the management console and everything works fine. The error occurs when I set up the rule via a