I noticed that the passwordPolicy of cognito is re...
# aws
r
I noticed that the passwordPolicy of cognito is recognized as changed everytime I update the stack, while actually it is not. Is this a design on purpose? or bug?
l
Are you setting the policy inside an
apply
?
apply
isn't deterministic so pulumi preview can't tell what the value will be; it may be reporting a potential change to be on the safe side.
You could either change the code to allow Pulumi to figure out the value during preview, or you could add an ignoreChanges opt.
r
Thanks but I think no? I am simply use
new aws.cognito.UserPool()
to declare the resource.
l
And that's not inside a call to
apply()
? In that case I don't know. You could set the actual value in the args so that it's not relying on the default.
Copy code
const userPool = new aws.cognito.UserPool("guests", {
  passwordPolicy: {
    minimumLength: 20,
    requireLowercase: false,
    requireNumbers: false,
    requireSymbols: false,
    requireUppsercase: false,
    temporaryPasswordValidity: -1
  }
});
r
No it’s not. And yeah it’s all explicit declared…that’s odd.
Copy code
export const userPool = new aws.cognito.UserPool(
  resourceName(stack, "user-pool", "cognito"),
  {
    ...
    passwordPolicy: {
      minimumLength: 8,
      requireLowercase: true,
      requireNumbers: true,
      requireSymbols: true,
      requireUppercase: true,
    },
    ...
  }
);
I can see this line in every updates…
l
Have a look at the detailed difference, maybe there's more info there.