'Loads a local file to S3
This is provided as a convenience to drop a file in S3. It uses the
boto infrastructure to ship a file to s3. It is currently using only
a single part download, and should not be used to move large files.
:param string_data: string to set as content for the key.
:type string_data: str
:param key: S3 key that will point to the file
:type key: str
:param bucket_name: Name of the bucket in which to store the file
:type bucket_name: str
:param replace: A flag to decide whether or not to overwrite the key
if it already exists
:type replace: bool
:param encrypt: If True, the file will be encrypted on the server-side
by S3 and will be stored in an encrypted form while at rest in S3.
:type encrypt: bool'

def load_string(self, string_data, key, bucket_name=None, replace=False, encrypt=False):

    if (not bucket_name):
        (bucket_name, key) = self.parse_s3_url(key)
    bucket = self.get_bucket(bucket_name)
    key_obj = bucket.get_key(key)
    if ((not replace) and key_obj):
        raise ValueError('The    key    {key}    already    exists.'.format(**locals()))
    if (not key_obj):
        key_obj = bucket.new_key(key_name=key)
    key_size = key_obj.set_contents_from_string(string_data, replace=replace, encrypt_key=encrypt)
    logging.info('The    key    {key}    now    contains    {key_size}    bytes'.format(**locals()))
