Boto3 1.3.0 Create a (directory) object in an (already existing) S3 bucket

**chocksaway_smallestImportant to add the “/” after the name of the directory object **(Key=’second_level/’):

#!/usr/bin/env python

import boto3
import logging

s3_client = boto3.client('s3')

try:
    response = s3_client.put_object(Bucket='int-mybucket-created-milesd3', Key='second_level/')
    logging.info("  %s", response)
except Exception as e:
    logging.warn("Bucket error %s", e)

Author | Miles Davenport

Career programmer, who designs, assembles, fixes, and supports customers, software and systems.