(profile, region, bucket, bucket_object)
Put object into bucket.  Only called if we've also created an archive file with do_archive()

    Bucket must exist prior to running this function.
    profile could be None.
    bucket_object is file to be uploaded
Put object into bucket.  Only called if we've also created an archive file with do_archive()
Put object into bucket . Only called if we ve also created an archive file with do_archive ()
def do_put_bucket_object(profile, region, bucket, bucket_object):
    """
    Put object into bucket.  Only called if we've also created an archive file with do_archive()

    Bucket must exist prior to running this function.
    profile could be None.
    bucket_object is file to be uploaded
    """

    s3 = _get_aws_client(profile=profile, region=region, service="s3")
    logging.info("Uploading backup to S3 bucket " + bucket)
    try:
        s3.upload_file(
            bucket_object,
            bucket,
            bucket_object,
            ExtraArgs={"ServerSideEncryption": "AES256"},
        )
    except s3.exceptions.ClientError as e:
        logging.exception("Failed to put file to S3 bucket\n\n" + str(e))
        sys.exit(1)
def do_put_bucket_object ( profile , region , bucket , bucket_object ) : s3 = _get_aws_client ( profile = profile , region = region , service = "s3" ) logging . info ( "Uploading backup to S3 bucket " + bucket ) try : s3 . upload_file ( bucket_object , bucket , bucket_object , ExtraArgs = { "ServerSideEncryption" : "AES256" } , ) except s3 . exceptions . ClientError as e : logging . exception ( "Failed to put file to S3 bucket\n\n" + str ( e ) ) sys . exit ( 1 )