Important 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)