pulumi / pulumi-cloudflare

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

cloudflare.PagesProject is partially support `deploymentConfigs` #925

Open hckhanh opened 2 days ago

hckhanh commented 2 days ago

Describe what happened

When I add something to deploymentConfigs it works find. But when I try to remove or edit some content, it still run and said updated but the true is it was not updated, leave everything as before

Sample program

const enginePagesName = new random.RandomPet('engine-pages-name', {
  prefix: 'sshare',
})

export const enginePages = new cloudflare.PagesProject(
  'engine-pages',
  {
    accountId: cfAccountId,
    name: enginePagesName.id,
    productionBranch: 'main',
    deploymentConfigs: {
      production: {
        compatibilityDate: '2024-09-23',
        compatibilityFlags: [],
        placement: { mode: 'smart' },
        d1Databases: {
          USER_DB: userDatabase.id,
        },
        kvNamespaces: {
          LINK_CACHE: linkCacheKv.id,
          LINK_PASSWORD: linkPasswordKv.id,
        },
        environmentVariables: {
          NODE_ENV: 'production',
        },
        secrets: {
          UPSTASH_LINK_CACHE_REDIS_TOKEN: linkCacheRedis.restToken,
          UPSTASH_LINK_CACHE_REDIS_URL: pulumi.interpolate`https://${linkCacheRedis.endpoint}`,
        },
      },
    },
  },
  { provider },
)

Log output

I don't know whether it will expose my credentials or not. If you need this, I can send you privately by email: hi@khanh.id

Affected Resource(s)

Output of pulumi about

CLI          
Version      3.134.1
Go Version   go1.23.1
Go Compiler  gc

Plugins
KIND      NAME    VERSION
language  nodejs  unknown

Host     
OS       darwin
Version  14.7
Arch     arm64

This project is written in nodejs: executable='/opt/homebrew/bin/node' version='v22.9.0'

Current Stack: organization/sshare-infra/dev

TYPE                                                    URN
pulumi:pulumi:Stack                                     urn:pulumi:dev::sshare-infra::pulumi:pulumi:Stack::sshare-infra-dev
pulumi:providers:pulumi                                 urn:pulumi:dev::sshare-infra::pulumi:providers:pulumi::default
pulumi:providers:random                                 urn:pulumi:dev::sshare-infra::pulumi:providers:random::default_4_16_6
pulumi:pulumi:StackReference                            urn:pulumi:dev::sshare-infra::pulumi:pulumi:StackReference::organization/sshare-infra-token/prod
random:index/randomPet:RandomPet                        urn:pulumi:dev::sshare-infra::random:index/randomPet:RandomPet::link-password-kv-name
random:index/randomPet:RandomPet                        urn:pulumi:dev::sshare-infra::random:index/randomPet:RandomPet::user-db-name
random:index/randomPet:RandomPet                        urn:pulumi:dev::sshare-infra::random:index/randomPet:RandomPet::link-cache-kv-name
random:index/randomPassword:RandomPassword              urn:pulumi:dev::sshare-infra::random:index/randomPassword:RandomPassword::turbo-signature-key
random:index/randomPet:RandomPet                        urn:pulumi:dev::sshare-infra::random:index/randomPet:RandomPet::link-cache-redis-name
random:index/randomPet:RandomPet                        urn:pulumi:dev::sshare-infra::random:index/randomPet:RandomPet::engine-pages-name
pulumi:pulumi:StackReference                            urn:pulumi:dev::sshare-infra::pulumi:pulumi:StackReference::organization/sshare-infra-share/prod
pulumi:providers:cloudflare                             urn:pulumi:dev::sshare-infra::pulumi:providers:cloudflare::cloudflare-provider
pulumi:providers:upstash                                urn:pulumi:dev::sshare-infra::pulumi:providers:upstash::default_0_3_14_github_/api.github.com/upstash/pulumi-upstash
upstash:index/redisDatabase:RedisDatabase               urn:pulumi:dev::sshare-infra::upstash:index/redisDatabase:RedisDatabase::link-cache-redis
cloudflare:index/workersKvNamespace:WorkersKvNamespace  urn:pulumi:dev::sshare-infra::cloudflare:index/workersKvNamespace:WorkersKvNamespace::link-cache-kv
cloudflare:index/d1Database:D1Database                  urn:pulumi:dev::sshare-infra::cloudflare:index/d1Database:D1Database::user-db
cloudflare:index/workersKvNamespace:WorkersKvNamespace  urn:pulumi:dev::sshare-infra::cloudflare:index/workersKvNamespace:WorkersKvNamespace::link-password-kv
pulumi:providers:github                                 urn:pulumi:dev::sshare-infra::pulumi:providers:github::default_6_3_0
github:index/actionsVariable:ActionsVariable            urn:pulumi:dev::sshare-infra::github:index/actionsVariable:ActionsVariable::turbo-team-actions-variable
github:index/actionsSecret:ActionsSecret                urn:pulumi:dev::sshare-infra::github:index/actionsSecret:ActionsSecret::turbo-signature-key-actions-secret
github:index/actionsSecret:ActionsSecret                urn:pulumi:dev::sshare-infra::github:index/actionsSecret:ActionsSecret::turbo-token-actions-secret
cloudflare:index/pagesProject:PagesProject              urn:pulumi:dev::sshare-infra::cloudflare:index/pagesProject:PagesProject::engine-pages
cloudflare:index/record:Record                          urn:pulumi:dev::sshare-infra::cloudflare:index/record:Record::engine-pages-record
github:index/actionsVariable:ActionsVariable            urn:pulumi:dev::sshare-infra::github:index/actionsVariable:ActionsVariable::engine-pages-actions-variable
cloudflare:index/pagesDomain:PagesDomain                urn:pulumi:dev::sshare-infra::cloudflare:index/pagesDomain:PagesDomain::engine-pages-domain

Additional context

I try to add a KV LINK_PASSWORD2 then try to remove it, but it does leaves the empty object behind like this in PagesProject:

Image

Contributing

If you need more information from me, please let me know

VenelinMartinov commented 14 hours ago

Hey @hckhanh, thanks for reporting and sorry you've had issues here. I have not been able to reproduce the problem you've had so far. I see my changes reflected on the console with the example you provided.

Could you try updating your provider to the newest version and retrying? If you are still having issues could you please include a bit more detail on the changes you are making and which of them are not getting reflected in the console?