Currently I have the ec2 in a private subnet within VPC. This ec2 has to get a "template-file" from a github repo. Ideally, I would like it to fetch the "template-file" only if changes are made. In short, the changes will tell the ec2 to fetch the new template. What is the best way to accomplish this?
I was thinking of using github-actions to sync the changes into S3 bucket, and have the ec2 constantly pull from it.
CodePudding user response:
You can use SNS to handle the event of a new object created in the bucket and make sure that the EC2 is consuming this event.
CodePudding user response:
You can try this approach:-
- sync changes with the s3 bucket.
- configure bucket notifications on upload using sns.
- Run a script in your ec2 instance, which is running continuously and and checking whether there is object in sns or not, if yes download the updated file in your ec2 instance