I am using AWS CodePipeline to deploy to an EC2 instance whenever there's a file change in my S3 bucket. Currently the Code Pipeline automatically kicks off a deployment only when I make a change to a file inside of a specific zip folder inside the S3 bucket (SampleApp_Linux.zip).
This is inconvenient when using AWS CDK, because I have to unzip the object, make changes to my file, and then zip it again before pushing changes. I also can't see my files in the zipped folder from a code repo.
I'm wondering is there a way to have CodePipeline automatically start deployments whenever there's a change to any file in the S3 bucket and not just those inside of the zip folder (ie changes to myDummyFiles folder)?
Update:
I am creating all of these resources via AWS CDK and using the bucketDeployment resource to push my S3 file changes in SampleApp_Linux folder to CDK. If it isn't possible for Pipelines to track unzipped changes to S3 perhaps AWS CDK can zip the SampleApp_Linux folder for me before it deploys it to AWS. That way CodePipeline will pick up the change.
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3_deployment.BucketDeployment.html
Attached are screenshots of my CodePipeline SourceAction and S3 bucket.

Here's one option: Configure your pipeline source to run on changes to your code repo. Next, add a
BucketDeploymentconstruct to the pipeline. On each pipeline run, theBucketDeploymentbundles yourSampleApp_Linuxcode and saves it to a S3 bucket.The BucketDeployment construct automagically (using a Custom Resource) will create your code artefact from the
sourcepath and copy it to adestinationBucket. Theextract: falsesetting tells the CDK not to unzip the artefact at the S3 destination.