def build_slack_payload(budgets, image_url):
    """
    Builds the payload that is sent to the Slack webhook about
    our budget overspend.
    """
    details = "\n".join(
        [f"{b.name}: {b.forecasted_spend} > {b.budget_limit}" for b in budgets]
    )

    return {
        "username": "aws-budgets",
        "icon_emoji": ":money_with_wings:",
        "attachments": [
            {
                "color": "warning",
                "title": "AWS is forecasting an overspend on our budgets!",
                "image_url": image_url,
                "text": details,
            }
        ],
    }