Skip to content

ZoneSubscription returns 404 for free-plan zones despite "free" being a valid RatePlan.Id #1550

Description

@yuliiaandreieva-ol

Describe what happened

When upgrading from pulumi-cloudflare v5 to v6, the Plan field was removed from cloudflare.Zone. The recommended approach is to use a separate cloudflare.ZoneSubscription resource. However, creating or importing a ZoneSubscription for zones on the free plan fails with a 404 error from the Cloudflare API.

This happens despite the Pulumi registry docs listing "free" as a valid RatePlan.Id value and showing it in the example usage.

error: [ERROR] GET "https://api.cloudflare.com/client/v4/zones/<zone_id>/subscription":
404 Not Found
{
  "success": false,
  "errors": [{
    "code": 1207,
    "message": "Add a core subscription first and try again. The zone does not have an active core subscription."
  }]
}

Meanwhile, paid zones (e.g., Pro plan) import successfully using the same pattern. This means free-plan zones cannot have their subscription managed at all — the only workaround is to conditionally skip creating ZoneSubscription for free zones.

Sample program

package main

import (
	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		zone, err := cloudflare.NewZone(ctx, "my-zone", &cloudflare.ZoneArgs{
			AccountId: pulumi.String("your-account-id"),
			Zone:      pulumi.String("example.com"),
		})
		if err != nil {
			return err
		}

		_, err = cloudflare.NewZoneSubscription(ctx, "my-zone-subscription", &cloudflare.ZoneSubscriptionArgs{
			ZoneId: zone.ID(),
			RatePlan: &cloudflare.ZoneSubscriptionRatePlanArgs{
				Id: pulumi.String("free"),
			},
		}, pulumi.Import(zone.ID()))
		if err != nil {
			return err
		}

		return nil
	})
}

Log output

Previewing update:

error: [ERROR] GET "https://api.cloudflare.com/client/v4/zones/<zone_id>/subscription":
404 Not Found {"success":false,"errors":[{"code":1207,"message":"Add a core subscription first and try again. The zone does not have an active core subscription."}]}
: failed to make http request
error: Preview failed: failed to make http request

Affected Resource(s)

  • cloudflare.ZoneSubscription (cloudflare:index/zoneSubscription:ZoneSubscription)

Output of pulumi about

CLI: 3.226.0
Go: go1.25.6
Host: darwin, arm64

Plugins:
  cloudflare  6.14.0

Additional context

The discrepancy:

Source Says about "free"
Pulumi docs (v6.14.0) Valid RatePlan.Id, shown in example
Terraform docs (v5.18.0) Valid rate_plan.id, shown in example
Cloudflare API GET /zones/{zone_id}/subscription returns 404 for free zones

Direct API verification confirms free zones do not have a subscription object:

curl -s -H "Authorization: Bearer $CF_TOKEN" \
  "https://api.cloudflare.com/client/v4/zones/<free_zone_id>/subscription"
# Returns 404 with code 1207

This likely originates from the upstream Terraform provider (cloudflare/terraform-provider-cloudflare) which auto-generates the schema from the Cloudflare OpenAPI spec — the spec lists "free" as a valid enum value, but the API doesn't actually support it.

Related upstream issues:

Contributing

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting-upstreamThe issue cannot be resolved without action in another repository (may be owned by Pulumi).kind/bugSome behavior is incorrect or out of speckind/documentationImprovements or additions to documentation

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions