Boto3 Problem: "BucketName", must be one of: S3. Cannot move archives from Glacier to s3 bucket

0

I'm using Boto3 to try to create an Inventory Retrieval Job from Glacier. Relevant part of my job retrieval dict looks like this:

job_params = {
            'Type': 'inventory-retrieval',
            'OutputLocation': {
                'BucketName': self.returnBucket,
            },
            'InventoryRetrievalParameters': {
                'StartDate': formatStart,
                'EndDate': formateEnd,
            },
        }

The error I get says" BucketName", must be one of: S3. The Boto3 Documents say that it's supposed to be a string, with the bucket name. I've tried both the bucket name and the ARN and they don't work.

I Tried created resource that I thought was the right approach:

s3_resource = boto3.resource('s3')
s3_bucket = s3_resource.Bucket('the bucket name')

but when the self.retrurnBucket = s3_bucket I still get the same error.

asked a year ago235 views
2 Answers
0

The doco page you linked to shows jobParameters contains:

        'OutputLocation': {
            'S3': {
                'BucketName': 'string',

Looks like you forgot the 'S3' bit.

EXPERT
answered a year ago
0

Hello you have to use it like below:

jobParameters={
        'Type': 'inventory-retrieval',
        'Format': 'JSON',
        'OutputLocation': {
            'S3': {
                'BucketName': bucket_name,
                'Prefix': inventory_file_key
            }
        }
    }
AWS
SUPPORT ENGINEER
answered a year 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