Update an existing deployment.

def update(environment, zappa_settings):
    """ Update an existing deployment."""
    print(("Updating " + environment))

    # Package dependencies, and the source code into a zip
    zappa, settings, lambda_name, zip_path = \
        _package(environment, zappa_settings)

    s3_bucket_name = settings['s3_bucket']

    try:

        # Load your AWS credentials from ~/.aws/credentials
        zappa.load_credentials()

        # Update IAM roles if needed
        zappa.create_iam_roles()


        # Upload it to S3
        zip_arn = zappa.upload_to_s3(zip_path, s3_bucket_name)

        # Register the Lambda function with that zip as the source
        # You'll also need to define the path to your lambda_handler code.
        lambda_arn = zappa.update_lambda_function(s3_bucket_name, zip_path,
                                                  lambda_name)

        # Remove the uploaded zip from S3, because it is now registered..
        zappa.remove_from_s3(zip_path, s3_bucket_name)
    finally:
        try:
            # Finally, delete the local copy our zip package
            if settings['delete_zip']:
                os.remove(zip_path)
        except:
            print("WARNING: Manual cleanup of the zip might be needed.")

    print("Your updated Zappa deployment is live!")