important-leather-28796
09/02/2023, 7:07 PMrolloutStatus
typescript fn but it is no longer working. I see the pulumi addition of local.Command
, but it appears it only executes shell commands. Is there a dependency helper I can use that will allow me to procedurally run some code after a deployment rollout is finished? I’m happy to provide my old code, but I’m hoping there is something easier using dependsOn
or Output
resolution.local.Command
and see if I get the right lifecycle (after deployment rollout)
https://github.com/pulumi/pulumi-command/issues/7billowy-army-68599
important-leather-28796
09/02/2023, 8:33 PMimport { Web } from '@alienfast/pulumi-app'
import { local } from '@pulumi/command'
import { unsecret } from '@pulumi/pulumi'
import { apiKey, email, zoneId } from './cloudflare'
import { rules } from './pageRules'
export function purgeCache(web: Web) {
const cmd =
'node --experimental-specifier-resolution=node --loader ts-node/esm --no-warnings src/cmdPurgeCache.ts'
const urls = Object.keys(rules)
unsecret(apiKey).apply((key) => {
const cmdPurgeCache = new local.Command(
'cmdPurgeCache',
{
create: cmd,
update: cmd,
environment: {
'trigger-update': new Date().toISOString(),
EMAIL: email,
KEY: key,
ZONE_ID: zoneId,
URLS: urls.join(','),
},
},
{
dependsOn: [web],
},
)
})
}
environment: {
'trigger-update': new Date().toISOString(),
pulumi up -y --non-interactive --skip-preview