EC2 Image Builder Cloud Formation S3Download Source Issue

0

I am using EC2 Image Builder using Cloud Formation. In that I am trying to download files inside a folder (or Prefix?) from an S3 bucket using the following syntax.

 - name: DownloadFiles
   action: S3Download
   onFailure: Abort
   maxAttempts: 3
   inputs:
       -  source: s3://myBucket/my-app/*
          destination: C:\temp\

However, in my s3 bucket called myBucket, I have 2 folders with the names my-app and my-app-prereq. Because of this, it seems to be downloading from both, instead of downloading from just my-app folder as specified in the Source attribute above. Can anyone please help me?

asked 8 months ago357 views
1 Answer
0

Did you recheck if it's actually downloading from both folders? It is expected to download all folders and files under the specified prefix with wildcard * according to the documentation https://docs.aws.amazon.com/imagebuilder/latest/userguide/toe-action-modules.html#action-modules-s3download

I recommend you If possible, to separate the folders into different hierarchies to eliminate the prefix ambiguity:

s3://myBucket/app/my-app/
s3://myBucket/app-prereq/my-app-prereq/

Then, you can update your EC2 Image Builder CloudFormation YAML configuration as follows:

  - name: DownloadFiles
    action: S3Download
    onFailure: Abort
    maxAttempts: 3
    inputs:
      - source: s3://myBucket/app/my-app/*
        destination: C:\temp\
profile picture
answered 8 months ago
  • I did and it is also showing 2 paths in CW logs. I have renamed the 2nd folder as a workaround. But, this certainly looks like an issue

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions