# S3 event trigger/notification which will run a python script in ECS/EC2 (without using Lambda)

**URL:** <https://discuss.hashicorp.com/t/s3-event-trigger-notification-which-will-run-a-python-script-in-ecs-ec2-without-using-lambda/6487>\
**Category:** Terraform\
**Created:** [March 3, 2020, 9:05pm UTC](https://discuss.hashicorp.com/t/s3-event-trigger-notification-which-will-run-a-python-script-in-ecs-ec2-without-using-lambda/6487 "2020-03-03T21:05:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcraw](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@mcraw](https://discuss.hashicorp.com/u/mcraw)\
**Post date:** [March 3, 2020, 9:05pm UTC](https://discuss.hashicorp.com/t/s3-event-trigger-notification-which-will-run-a-python-script-in-ecs-ec2-without-using-lambda/6487/1 "2020-03-03T21:05:05Z")

</div>

Has anyone successfully created and/or used a s3 event trigger/notification (once an object is uploaded to the s3 bucket) to run a script in ECS/EC2?

The architecture for this is S3 --\> Trigger —\> SQS —\> ECS/EC2 Instance.

I used the resource “aws\_sqs\_queue” “queue” found at [https://www.terraform.io/docs/providers/aws/r/s3\_bucket\_notification.html](https://www.terraform.io/docs/providers/aws/r/s3_bucket_notification.html). Then I created my ECS and EC2 instance(s).

I created permissions so the ECS will have access to the trigger (once the object is PUT into the S3 bucket). However, the python script I am trying to run is not running.

Any pointers would help. I am quite new to terraform.
