Skip to content

Conversation

@harmony7
Copy link
Member

This PR adds first-class support for enabling Fastly Products during the initial fastly compute publish, driven by a new [setup.products] section in fastly.toml.

What this enables

On first publish (service creation only), users can now declaratively enable products such as Fanout, API Discovery, NGWAF, etc., alongside other [setup] resources.

Example:

[setup.products.fanout]
enable = true

[setup.products.ngwaf]
enable = true
workspace_id = "my-workspace"

Key points

New manifest schema

  • Adds SetupProducts under [setup]
  • Each product has a typed configuration
  • NGWAF supports required parameters (workspace_id)
  • Validation is product-specific and runs before activation

New setup resource

  • Introduces setup.Products, integrated into the existing setup lifecycle
  • Runs only when creating a new service (consistent with other [setup] resources)

Clean, table-driven implementation

  • Both configuration and activation paths are table-driven
  • Adding a new product is a small, localized change
  • Avoids reflection; product-specific logic remains explicit and readable

Activation via go-fastly product APIs

  • Uses fastly/products/* enable APIs
  • Activation happens after service creation
  • Spinner output and error handling follow existing CLI patterns

Safe defaults

  • Products are enabled only when explicitly configured and enable = true
  • Disabled or absent products are ignored
  • Manifest round-tripping preserves [setup.products]

Review notes

  • Main logic: pkg/commands/compute/setup/products.go
  • Manifest changes: pkg/manifest/setup.go
  • Deploy flow wires products into the existing setup + creation phases
  • Error handling and output are consistent with other setup resources

Why this change

We already support declarative setup for backends, KV stores, secret stores, etc.
Products are a natural extension of that model, and this removes the need for manual post-deploy steps or separate CLI invocations when bootstrapping a new service.

@harmony7 harmony7 requested a review from a team as a code owner January 14, 2026 10:40
Copy link
Member

@philippschulte philippschulte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I would only suggest adding more tests:

  • to trigger a validation failure
  • that verifies disabled or omitted products are ignored

But I keep this up to you! Thanks!

@harmony7 harmony7 force-pushed the kats/setup-products branch from 41a1898 to 8c72c4f Compare January 15, 2026 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants