How do I provide multiple string values to MatchAnyPrefix when creating S3 Batch Operation job?

0

I'm using the the AWS CLI (v2.15.37) with command aws s3control create-job and the following argument:

--manifest-generator '{
  "S3JobManifestGenerator": {
    "SourceBucket": "arn:aws:s3:::example-bucket1",
    "EnableManifestOutput": true,
    "ManifestOutputLocation": {
      "Bucket": "arn:aws:s3:::example-bucket2",
      "ManifestPrefix": "manifests",
      "ManifestFormat": "S3InventoryReport_CSV_20211130"
    },
    "Filter": {
      "ObjectSizeGreaterThanBytes": 131072,
      "KeyNameConstraint": {
        "MatchAnyPrefix": [
          "prefix1",
          "prefix2",
          "prefix3"
        ]
      },
      "MatchAnyStorageClass": [
        "STANDARD"
      ]
    }
  }
}'

This only works if I remove prefix2 and prefix3 from the MatchAnyPrefix parameter but the documentation (see screenshot) led me to believe that I could have 1024 prefixes. How do I provide multiple string values to MatchAnyPrefix when creating S3 Batch Operation job?

Enter image description here

James
asked 13 days ago254 views
1 Answer
1

Hi There

As of right now, only one prefix is supported. The max length of 1024 refers to the length of the prefix string. The suggested workaround would be to create a separate job for each prefix.

profile pictureAWS
EXPERT
Matt-B
answered 13 days ago
profile picture
EXPERT
reviewed 12 days ago

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