docs / quickstart

quickstart

Build egress rules from official vendor ranges with the free Terraform provider.

1. add the provider

terraform {
  required_providers {
    egress = {
      source = "slash0-io/egress"
    }
  }
}

provider "egress" {}

2. pull the ranges you need

One data source per service and purpose. Every slug and purpose is listed in the catalog.

# ranges your workloads connect out to (egress direction)
data "egress_ranges" "stripe_api" {
  service = "stripe"
  purpose = "api"
}

# ranges a service connects to you from (ingress direction:
# webhook and agent sources belong in ingress rules)
data "egress_ranges" "github_hooks" {
  service = "github"
  purpose = "hooks"
}

3. reference them in a security group rule

resource "aws_security_group_rule" "stripe_egress" {
  type              = "egress"
  from_port         = 443
  to_port           = 443
  protocol          = "tcp"
  cidr_blocks       = data.egress_ranges.stripe_api.ipv4_cidrs
  security_group_id = aws_security_group.app.id
  description       = "Stripe API (feed ${data.egress_ranges.stripe_api.sync_token})"
}

After apply, the egress rule allows only Stripe's published API ranges.

notes

next

How it works describes the full pipeline. Security includes commands to verify the feed signature.