amazon-ecs

python logging in AWS Fargate, datetime duplicated

python logging in AWS Fargate, datetime duplicated Question: I’m trying to use python logging module in AWS Fargate. The same application should work also locally, so I’d like to use a custom logger for local use but to keep intact cloudwatch logs. This is what I’m doing: if logging.getLogger().hasHandlers(): log = logging.getLogger() log.setLevel(logging.INFO) else: from …

Total answers: 2

AWS ECS environment variable not available [Python]

AWS ECS environment variable not available [Python] Question: I am using AWS ECS with a Python Framework and in my task definition i have the option to add environment variables that will be available to the service(cluster). Here is where i added the env variables: When i then try to print all the env variables …

Total answers: 1

CDK: How to get L2 construct instance from L1 (CFN)?

CDK: How to get L2 construct instance from L1 (CFN)? Question: In my CDK code there is a low-lavel ecs.CfnTaskDefinition task definition. my_task_definition = aws_cdk.ecs.CfnTaskDefinition( scope=self, id="my_task_definition", # rest of the parameters… ) I want to use this task definition to a create a Ecs service, like this. my_service = aws_cdk.ecs.Ec2Service( scope=self, id="my_service", cluster=my_cluster, task_definition=my_task_definition, …

Total answers: 1

Mitigating TCP connection resets in AWS Fargate

Mitigating TCP connection resets in AWS Fargate Question: I am using Amazon ECS on AWS Fargate, My instances can access the internet, but the connection drops after 350 seconds. On average, out of 100 times, my service is getting ConnectionResetError: [Errno 104] Connection reset by peer error approximately 5 times. I found a couple of …

Total answers: 2

AWS ECS – Using Boto3 to update a task definition

AWS ECS – Using Boto3 to update a task definition Question: Using boto3, we can create a new task definition: client = boto3.client(‘ecs’) client.register_task_definition(…) How do we update an existing task definition? Is it just another call with changes and the same family name? Asked By: Flo || Source Answers: update an existing task definition …

Total answers: 2

Why are my gunicorn Python/Flask workers exiting from signal term?

Why are my gunicorn Python/Flask workers exiting from signal term? Question: I have a Python/Flask web application that I am deploying via Gunicorn in a docker image on Amazon ECS. Everything is going fine, and then suddenly, including the last successful request, I see this in the logs: [2017-03-29 21:49:42 +0000] [14] [DEBUG] GET /heatmap_column/e4c53623-2758-4863-af06-91bd002e0107/ADA …

Total answers: 5