bored-table-20691
01/24/2022, 6:27 PMlocal.Command
. Here is my entire Pulumi program:
package main
import (
"<http://github.com/pulumi/pulumi-command/sdk/go/command/local|github.com/pulumi/pulumi-command/sdk/go/command/local>"
"<http://github.com/pulumi/pulumi/sdk/v3/go/pulumi|github.com/pulumi/pulumi/sdk/v3/go/pulumi>"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := local.NewCommand(ctx, "test", &local.CommandArgs{
Create: pulumi.String("./create.sh hello"),
Delete: pulumi.String("./destroy.sh goodbye"),
Environment: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
})
if err != nil {
return err
}
return nil
})
}
Here is `create.sh`:
#!/bin/bash
echo "hello: $1" >> /tmp/pulumi_log.txt
and `destroy.sh`:
#!/bin/bash
echo "goodbye: $1" >> /tmp/pulumi_log.txt
When I run pulumi up
the first time, I get the hello: …
in the log file. If I run pulumi destroy
, I get the goodbye: ...
in the log file. However, if I were to change the environment
, nothing happens, the script does not seem to execute at all (nothing gets added to the log file.
Is this expected? Am I doing something wrong?sparse-park-68967
01/24/2022, 7:06 PMbored-table-20691
01/24/2022, 7:07 PMsparse-park-68967
01/24/2022, 7:10 PMreplaceOnChanges: ["environment"]
option on the resourcebored-table-20691
01/24/2022, 7:13 PMsparse-park-68967
01/24/2022, 7:20 PMbored-table-20691
01/24/2022, 7:22 PM