https://pulumi.com logo
#typescript
Title
# typescript
n

numerous-carpenter-4252

04/24/2023, 10:13 PM
I'm trying to comunicate with you, using this channel and appeal to your experience about pulumi to resolve this issue. I've got a weird behavior of pulumi in my devops stack. I try to update a value of an url (pulumi.devops.yaml) for a CORS policy access using pulumi up and it shows me this error:
Copy code
aws:cognito:UserPool (devops-devops-auth-usr-pool):
  error: 1 error occurred:
        * updating urn:pulumi:devops::bric-infra::bric:infra:Infra$bric:auth:Cognito$aws:cognito/userPool:UserPool::devops-devops-auth-usr-pool: 1 error occurred:
        * error updating Cognito User pool (eu-central-1_uRXXXXXXq6): InvalidParameter: 1 validation error(s) found.
    - minimum field size of 1, UpdateUserPoolInput.AccountRecoverySetting.RecoveryMechanisms
but , If I run it again, pulumi up runs without any issue, everything is ok. Why do I run pulumi up twice?
l

little-cartoon-10569

04/25/2023, 8:25 PM
Can you paste (using the Slack Text Snippet feature) the code that creates the UserPool?
n

numerous-carpenter-4252

04/25/2023, 8:26 PM
Hi!! ok
Copy code
this.userPool = new aws.cognito.UserPool(
      namespaced(name, "usr-pool"),
      { emailConfiguration: emailConfig,
        autoVerifiedAttributes: ["email"],
        usernameAttributes: ["email"],
        schemas: [
          {
            attributeDataType: "String",
            name: "email",
            mutable: false,
            required: true,
            stringAttributeConstraints: {
              minLength: "1",
              maxLength: "256",
            },
          },
          {
            attributeDataType: "String",
            name: "userType",
            mutable: true,
            stringAttributeConstraints: {
              minLength: "1",
              maxLength: "256",
            },
          },
        ],
        lambdaConfig: {
          postConfirmation: getFunctionArn(args.lambdaPostConfirmation),
          customMessage: getFunctionArn(args.lambdaCustomMessage),
        },
      },
      resourceOpts
    );
l

little-cartoon-10569

04/25/2023, 8:41 PM
Do you run your
pulumi up
with
--refresh
? Or run a refresh occasionally?
n

numerous-carpenter-4252

04/25/2023, 8:45 PM
I use refresh.. pulumi always find something to update or delete.. even I didn't change anything.. look at this..
I don't understand that.. and some times it deletes security groups rules..
image.png
l

little-cartoon-10569

04/25/2023, 8:48 PM
That's probably becuase you're mixing internal and associatedrules
Don't refresh, fix your code
n

numerous-carpenter-4252

04/25/2023, 8:49 PM
ok.. I´m going to check them
thanks..
l

little-cartoon-10569

04/25/2023, 8:50 PM
Your original problem will go away if you don't refresh. But better, just set that value correctly.
n

numerous-carpenter-4252

04/25/2023, 8:51 PM
yes.. One step at time..