npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@okassov/pulumi-haproxy

v0.3.1

Published

HAProxy Module for Pulumi

Readme

HAProxy Module for Pulumi npm version License: MPL-2.0

Pulumi Component for managing HAProxy configuration through the HAProxy Data‑Plane API (DPA).
Create Backend → Servers → Frontend → Bind chains declaratively – all in a single Pulumi resource.

Table of Contents

  1. Features
  2. Installation
  3. Quick Start
  4. Inputs
  5. Outputs
  6. Examples
  7. License

Features

  • Single call ⇒ complete service – define backend, servers, frontend and bind in one object.
  • Multiple services in one stack – pass an array of services; component guarantees a conflict‑free sequential apply.
  • Shared provider cache – all component instances talking to the same DPA share one Pulumi provider instance.
  • Custom bind parameters – send any additional JSON fields (e.g. accept_proxy, ssl, maxconn, …) without changing code.
  • Automatic name prefixing – resource names are vendor‑prefixed with component name to avoid collisions across stacks.

Installation

npm install @okassov/pulumi-haproxy

Requires Pulumi v3.115+ and Node 18+.

Quick Start

import { HAProxyStack } from "@okassov/pulumi-haproxy";

const k8sNodes = [
  { name: "k8s-node-01", ip: "10.1.1.101" },
  { name: "k8s-node-02", ip: "10.1.1.102" },
  { name: "k8s-node-03", ip: "10.1.1.103" },
]

const haproxy = new HAProxyStack("ingress-gw", {
  apiConfig: {
    apiAddress : "10.1.1.100",
    apiPort    : 5555,
    apiUsername: "admin",
    apiPassword: pulumi.secret("super‑secret")
  },
  services: [
    {
      name: "http",
      backend : { mode: "tcp", balances: [{ algorithm: "roundrobin" }] },
      servers : k8sNodes.map(n => ({ name:n.name, ip:n.ip, port:30080, check:true, sendProxy:true })),
      frontend: { mode: "tcp", tcplog:true },
      bind    : { address:"0.0.0.0", port:80 },
      customBindParams: { accept_proxy:true }
    },
    {
      name: "https",
      backend : { mode: "tcp", balances: [{ algorithm: "roundrobin" }] },
      servers : k8sNodes.map(n => ({ name:n.name, ip:n.ip, port:30443, check:true, sendProxy:true })),
      frontend: { mode: "tcp", tcplog:true },
      bind    : { address:"0.0.0.0", port:443 },
      customBindParams: { accept_proxy:true, ssl:"enabled" }
    }
  ]
});

Run:

pulumi up

Inputs

| Field | Type | Required | Description | | ----------------- | ---------------------- | -------- | ------------------------------------------ | | apiConfig | HAProxyApiParams | Yes | DPA connection credentials. | |   • apiAddress | string | Yes | IP / DNS of HAProxy DPA. | |   • apiPort | number\|string | Yes | DPA port (usually 5555). | |   • apiUsername | string | Yes | HTTP‑basic user. | |   • apiPassword | string | Yes | HTTP‑basic password (use pulumi.secret). | | services | HAProxyServiceArgs[] | Yes | Array of service definitions. |

HAProxyServiceArgs

| Field | Type | Required | Description | | ------------------ | --------------------------------------------- | -------- | -------------------------------------------------- | | name | string | Yes | Logical name; reused for backend & frontend. | | backend | haproxy.BackendArgs | Yes | Direct mapping to DPA backend args. | | servers | CustomServerArgs[] | Yes | Servers behind backend; ip instead of address. | | frontend | CustomFrontendArgs | Yes | Frontend spec (without backend). | | bind | CustomBindArgs | Yes | Bind spec (without parentName / parentType). | | customBindParams | Record<string, string \| number \| boolean> | No | Arbitrary extra JSON fields added to bind patch. |

Outputs

| Field | Type | Description | | ----------- | ------------------------- | --------------------------- | | backends | pulumi.Output<string>[] | Names of created backends. | | frontends | pulumi.Output<string>[] | Names of created frontends. |

Examples

Minimal HTTP‐only

new HAProxyStack("api-edge", {
  apiConfig: {/* … */},
  services: [{
    name: "http",
    backend : { mode:"http" },
    servers : [{ name:"svc", ip:"10.0.0.10", port:8080 }],
    frontend: { mode:"http" },
    bind    : { address:"0.0.0.0", port:80 }
  }]
})

TCP LB with custom params

new HAProxyStack("db-tcp", {
  apiConfig: {/* … */},
  services: [{
    name: "pgsql",
    backend : { mode:"tcp" },
    servers : dbNodes.map(n => ({ name:n.id, ip:n.ip, port:5432, check:true })),
    frontend: { mode:"tcp" },
    bind    : { address:"10.10.10.2", port:5432 },
    customBindParams: { accept_proxy:true, maxconn:2000 }
  }]
})

License

Apache 2.0 – see LICENSE.