pulumi / pulumi-cloudflare

Pulumi's Cloudflare package, providing multi-language infrastructure as code for Cloudflare
Apache License 2.0
90 stars 11 forks source link

failed updating email routing rule: required rule id missing #823

Open ZakkProjects opened 1 week ago

ZakkProjects commented 1 week ago

Describe what happened

Hi im using Pulumi in combination with SST, but it seems that it might be issue of Pulumi or terraform adapters Im trying to create a rule to redirect email coming to my domain.

Creation and deletion on email routing rule passes correctly but every update fails with error.

Sample program

Ive used this code

        new cloudflare.EmailRoutingRule("CfEmailRedirects", {
            zoneId: process.env.CLOUDFLARE_ZONE_ID!,
            name: "CfEmailRedirects",
            enabled: true,
            matchers: [
                {
                    type: "literal",
                    field: "to",
                    value: "info@-------.---",
                },
                {
                    type: "all",
                },
            ],
            actions: [
                {
                    type: "forward",
                    values: ["-------.---"],
                },
            ],
            priority: 0,
        });

Log output

{"sequence":56,"timestamp":1719241324,"diagnosticEvent":{"urn":"urn:pulumi:zakk::makovsky::cloudflare:index/emailRoutingRule:EmailRoutingRule::CfEmailRedirects","prefix":"error: ","message":"failed updating email routing rule: required rule id missing\n","color":"never","severity":"error"},"Error":null}

Affected Resource(s)

cloudflare:EmailRoutingRule

Output of pulumi about

no way to run command trough sst

Additional context

No response

Contributing

No response

iwahbe commented 1 week ago

Hi @ZakkProjects. Thanks for letting us know. I'll take a look later today and see if anything jumps out as obvious.

iwahbe commented 1 week ago

Hi @ZakkProjects. I was able to reproduce your error on pulumi-cloudflare 5.32.0 with the following program:

Program ```ts import * as cloudflare from "@pulumi/cloudflare"; const zone = new cloudflare.Zone("repro-zone",{ accountId: process.env.CLOUDFLARE_ACCOUNT_ID!, zone: "pulumi.com", }) new cloudflare.EmailRoutingRule("CfEmailRedirects", { zoneId: zone.id, name: "CfEmailRedirects", enabled: true, matchers: [ { type: "literal", field: "to", value: "repro-1@pulumi.com", }, { type: "all", }, ], actions: [ { type: "forward", values: ["repro-2@pulumi.com"], // change to repro-3@pulumi.com to reproduce }, ], priority: 0, }); ```
Output ```console $ pulumi up Previewing update (dev) View in Browser (Ctrl+O): https://app.pulumi.com/pulumi/ts/dev/previews/1794fdc5-056a-4b8f-9b86-53df6ea9f3ac Loading policy packs... Type Name Plan Info pulumi:pulumi:Stack ts-dev ~ └─ cloudflare:index:EmailRoutingRule CfEmailRedirects update [diff: ~actions] Resources: ~ 1 to update 2 unchanged Do you want to perform this update? yes Updating (dev) View in Browser (Ctrl+O): https://app.pulumi.com/pulumi/ts/dev/updates/347 Loading policy packs... Type Name Status Info pulumi:pulumi:Stack ts-dev **failed** 1 error ~ └─ cloudflare:index:EmailRoutingRule CfEmailRedirects **updating failed** [diff: ~actions]; 1 error Diagnostics: cloudflare:index:EmailRoutingRule (CfEmailRedirects): error: failed updating email routing rule: required rule id missing pulumi:pulumi:Stack (ts-dev): error: update failed Resources: 2 unchanged Duration: 2s ```

I suspect this is related to a bug in the underlying terraform provider. I have filed https://github.com/cloudflare/terraform-provider-cloudflare/issues/3396 and https://github.com/cloudflare/terraform-provider-cloudflare/issues/3397 to see if we can get this resolved.

ZakkProjects commented 6 days ago

thanks for quick repro and update.