How to mock out AWS resources when testing flask app

Solution
@app.route("/")
def hello():
    aws_session = boto3.session.Session()
    conn = aws_session.client("dynamodb")
    conn.create_table(
        TableName="test-table",
        KeySchema=[{"AttributeName": "hello", "KeyType": "HASH"}],
        AttributeDefinitions=[{"AttributeName": "hello", "AttributeType": "S"}],
        ProvisionedThroughput={"ReadCapacityUnits": 5, "WriteCapacityUnits": 5},
    )
    dynamodb = aws_session.resource("dynamodb")
    table = dynamodb.Table("test-table")
    table.put_item(Item={
        "hello": "world"
    })
    return "ok"