title: How to configure AWS Fargate task to run a container that will create a cloudwatch custom metric
body: <p>I need to set up a monitoring into an aws account to ping certain servers from outside the account, create a custom cloudwatch metric with the package loss and i need to deploy the solution without any EC2 instance. 
  My first choice was lambda, but it seems that lambda does not allow pinging from it.</p>
  
  <p>Second choice was a container, as FARGATE has the ability to execute containers without any EC2 instance. The thing is im able to run the task definition and i see the task in RUNNNING state in the cluster, but the cloudwatch metric is never received.</p>
  
  <p>If I use the normal EC2 cluster, the container works perfectly, so i assume I have some error within the configuration, but I'm lost why. I have added admin rights to the ECS Task Execution Role and opened all ports in the sec group.</p>
  
  <p>I have tried public/private subnets with no success.
  Anyone could please help me?</p>
  
  <p><a href="https://i.stack.imgur.com/C0X7A.png" rel="nofollow noreferrer">Here you can find that the task is certainly RUNNING, however the app dont generate any further action</a></p>