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
질문됨 한 달 전151회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠