pulumi-cloudflare icon indicating copy to clipboard operation
pulumi-cloudflare copied to clipboard

Case sensitivity leads to unexpected replace plans

Open t0yv0 opened this issue 1 year ago • 2 comments

What happened?

Noting that cloudflare.Zone normalizes the case to lowercase, but this leads to spurious diffs and replace plans when the program has an uppercase source. There are probably more resources like this.

Example


import * as pulumi from "@pulumi/pulumi";
import * as random from "@pulumi/random";
import * as cloudflare from "@pulumi/cloudflare";

const config = new pulumi.Config();
const accountId = config.require("accountId");

const randomStr = new random.RandomString("random", {
    length: 8,
    overrideSpecial: "-",
    special: true,
    // upper: false, // TOGGLE THIS
});

const zone = new cloudflare.Zone("my-zone", {
    zone: randomStr.result.apply(r => `ts-test-cloudflare-${r}-zone.com`),
    accountId: accountId,
});

new cloudflare.Ruleset("transform_uri_rule_query", {
    description: "change the URI query to a new static query",
    kind: "zone",
    name: "transform rule for URI query parameter",
    phase: "http_request_transform",
    rules: [
        {
            action: "rewrite",
            actionParameters: {
                uri: {
                    query: {
                        value: "old=new_again2",
                    },
                },
            },
            description: "URI transformation query example",
            enabled: true,
            expression: 'http.host eq "test"',
        },
    ],
    zoneId: zone.id,
});

Output of pulumi about

CLI          
Version      3.99.0
Go Version   go1.21.5
Go Compiler  gc

Plugins
NAME        VERSION
cloudflare  5.17.0
nodejs      unknown
random      4.15.0

Host     
OS       darwin
Version  14.1.1
Arch     x86_64

This project is written in nodejs: executable='/Users/t0yv0/bin/node' version='v18.18.2'

Current Stack: t0yv0/regress-444/r444

TYPE                                    URN
pulumi:pulumi:Stack                     urn:pulumi:r444::regress-444::pulumi:pulumi:Stack::regress-444-r444
pulumi:providers:random                 urn:pulumi:r444::regress-444::pulumi:providers:random::default_4_15_0
random:index/randomString:RandomString  urn:pulumi:r444::regress-444::random:index/randomString:RandomString::random
pulumi:providers:cloudflare             urn:pulumi:r444::regress-444::pulumi:providers:cloudflare::default_5_17_0
cloudflare:index/zone:Zone              urn:pulumi:r444::regress-444::cloudflare:index/zone:Zone::my-zone
cloudflare:index/ruleset:Ruleset        urn:pulumi:r444::regress-444::cloudflare:index/ruleset:Ruleset::transform_uri_rule_query


Found no pending operations associated with r444

Backend        
Name           pulumi.com
URL            https://app.pulumi.com/t0yv0
User           t0yv0
Organizations  t0yv0, pulumi
Token type     personal

Dependencies:
NAME                VERSION
@pulumi/random      4.15.0
@pulumi/cloudflare  5.17.0
@pulumi/pulumi      3.101.0

Pulumi locates its logs in /var/folders/gk/cchgxh512m72f_dmkcc3d09h0000gp/T/com.apple.shortcuts.mac-helper// by default

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

t0yv0 avatar Jan 10 '24 19:01 t0yv0

https://github.com/pulumi/pulumi-cloudflare/issues/335 perhaps related

t0yv0 avatar Jan 10 '24 19:01 t0yv0