Skip to content

Commit 04b89e8

Browse files
author
aws-turpiej
committed
Merge pull request awslabs#47 from bgardella/bucket-restriction
added S3 Bucket restriction
2 parents bdfca24 + ff7e363 commit 04b89e8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/com/amazonaws/codedeploy/AWSCodeDeployPublisher.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@ private RevisionLocation zipAndUpload(AWSClients aws, String projectName, FilePa
289289
String prefix = getS3PrefixFromEnv();
290290
String bucket = getS3BucketFromEnv();
291291

292+
if(bucket.indexOf("/") > 0){
293+
throw new IllegalArgumentException("S3 Bucket field cannot contain any subdirectories. Bucket name only!");
294+
}
295+
292296
try {
293297
if (this.deploymentGroupAppspec) {
294298
appspec = new File(sourceDirectory + "/appspec." + deploymentGroupName + ".yml");

0 commit comments

Comments
 (0)