S3PutObjectCopy - CreateJob operation: Request invalid

2

The goal here is to, using the AWS CLI, automate restoring objects back from Deep Archive and copying them back to INTELLIGENT_TIERING. I have the first part working, I create and upload a CSV to a bucket and then create a Batch Operation job to restore the objects. The plan is to at the same time create the COPY job using the same CSV file, but wait with submitting it until all the objects have been restored. But when I attempt to create the COPY job I get the error:

An error occurred (InvalidRequest) when calling the CreateJob operation: Request invalid

Here is my command:

aws s3control create-job --account-id <account id> --operation '{
  "S3PutObjectCopy": {
    "TargetResource": "arn:aws:s3:::<my target bucket>",
    "MetadataDirective": "COPY",
    "StorageClass": "INTELLIGENT_TIERING",
    "BucketKeyEnabled": false
  }
}' --manifest '{
  "Spec": {
    "Format": "S3BatchOperations_CSV_20180820",
    "Fields": [
      "Bucket",
      "Key",
      "TargetBucket",
      "TargetKey"
    ]
  },
  "Location": {
    "ObjectArn": "arn:aws:s3:::bucket/restores/manifests/restore-objects.csv",
    "ETag": "<etag>"
  }
}' --role-arn arn:aws:iam::<account id>:role/restore-copy-role --client-request-token 90cd761a-7eb5-4fc8-b9c0-9529db297442 --report '{
  "Bucket": "arn:aws:s3:::report-bucket",
  "Format": "Report_CSV_20180820",
  "Enabled": true,
  "Prefix": "restores/reports",
  "ReportScope": "AllTasks"
}' --priority 1 --region us-east-1 --confirmation-required --tags Key=Role,Value=restore-data Key=Project,Value=myprojectname 'Key=Project Number,Value=12345' 'Key=Data Type,Value=mydatatype'

This is identical to the RESTORE job, which it is able to create fine, apart from the operation, which looks like this:

{
  "S3InitiateRestoreObject": {
    "ExpirationInDays": 7,
    "GlacierJobTier": "BULK"
  }
}

The idea is that both jobs gets created one after the other, then something monitors at the restore job and when all the objects have been successfully restored, the copy job starts. Any ideas or suggestions are welcome.

Mattias
質問済み 1ヶ月前151ビュー
回答なし

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ