hi folks! I’m struggling to understand this one.....
# getting-started
w
hi folks! I’m struggling to understand this one.. I have this Datadog integration configured, with a CF stack deployed (is there a better way to deploy the datadog AWS stack?) which works completely fine the only issue is that every time I run
pulumi up
it updates the parameters of cf stack, when I check the details it says the
ddApiKey
has changed - but it didn’t.. it’s a secret so I can’t see its value in the details.
Copy code
~ parameters: {
          ~ DdApiKey: [secret] => [secret]
        }
any idea what’s going on? it’s just a waste of resources to redeploy the CF stack every time with virtually no change..
👀 1
l
There's some code missing. Where are you calling
createDataDogIntegration()
from? If that's in an
apply()
then you'll see this behaviour. Does it actually deploy new resources? I'd guess it won't: it just can't tell at preview time that the before and after values are the same, so it shows that there's a potential difference.
That said, I've never used the aws.cloudformation API, so maybe it does work that way? It might be worth converting the CF stack to Pulumi.
Aside:
accountId: pulumi.all([current]).apply(([c]) => c.accountId)
is exactly the same as
accountId: current.accountId
.
g
going to quote the docs here: https://www.pulumi.com/docs/intro/concepts/inputs-outputs/
During some program executions, apply doesn’t run. For example, it won’t run during a preview, when resource output values may be unknown. Therefore, you should avoid side-effects within the callbacks. For this reason, you should not allocate new resources inside of your callbacks either, as it could lead to pulumi preview being wrong.