- Newest
- Most votes
- Most comments
Hello,
The error message indicates the S3 source action can't find any files matching the path bucket-path/*.zip.
Problem: Wildcards (*) aren't supported with S3 source actions in CodePipeline.
Solution: Specify the exact filename of the zip artifact you expect.
Here's how to adjust your S3 source action:
Identify the filename: Locate the exact filename (e.g., deployment.zip) of the zip artifact you want to deploy.
Update S3ObjectKey: In your CodePipeline configuration, change the S3ObjectKey parameter of the S3 source action to the specific filename (deployment.zip).
Example:
# Incorrect (using wildcard)
S3Bucket: my-bucket
S3ObjectKey: bucket-path/*.zip
# Correct (specifying filename)
S3Bucket: my-bucket
S3ObjectKey: bucket-path/deployment.zip
link to the official AWS documentation that explains configuration options for the S3 source action and best practices for triggering pipelines based on S3 object changes: https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-S3.html
you're right, specifying a single filename in the S3 source action won't work if you want to deploy different zip artifacts each time.
Here are two approaches to handle dynamic filenames with CodePipeline:
Dynamic filenames in CodePipeline:
- Specify exact filename (not wildcards) in S3 source action.
Two approaches:
Manual (Environment Variables):
- Set a variable in CodePipeline with the filename for each deployment.
- Use a script in your buildspec to download the file based on the variable.
Automated (S3 Event):
- Configure S3 to trigger a CodeBuild project on new uploads.
- CodeBuild provides a variable with the uploaded filename for your script to use.
Both methods use variables to handle dynamic filenames
CodeBuild Environment Variables: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
S3 Event Notifications: https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventNotifications.html
Relevant content
- asked 4 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 3 years ago

and what if i want to use different zip artifact every time? is it possible to configure it with codepipeline variables, or i need some other aws service?
Overwrite the ZIP file each time. Pipeline takes a copy of that zip into its own S3 bucket with its own version ID there. On your source S3 bucket, you can enable versioning and or part of your process, create 2 copies of the zip.. One with you own name and one with the name that triggers the pipeline