Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CongitoUserPool does not update successfully on deploy #617

Closed
joshwils82 opened this issue Jun 29, 2024 · 10 comments
Closed

CongitoUserPool does not update successfully on deploy #617

joshwils82 opened this issue Jun 29, 2024 · 10 comments
Assignees

Comments

@joshwils82
Copy link

joshwils82 commented Jun 29, 2024

When adding a sst.aws.CognitoUserPool, the sst deploy will run successfully on the first deploy but fail on an update with the following error.

Error       TestPool sst:aws:CognitoUserPool → TestPoolUserPool aws:cognito:UserPool
|  updating
urn:pulumi:jwilson::test::sst:aws:CognitoUserPool$aws:cognito/userPool:UserPool::TestPoolUserPool: 1
error occurred:
|
|  updating Cognito User Pool (us-east-1_StGlwm27q): cannot modify or remove schema items

here is an example sst.config.ts

/// <reference path="./.sst/platform/config.d.ts" />

export default $config({
  app(input) {
    return {
      name: "test",
      removal: input?.stage === "production" ? "retain" : "remove",
      home: "aws",
    };
  },
  async run() {
     new sst.aws.CognitoUserPool('TestPool', {})
   // new aws.cognito.UserPool("PPool", {name: "mypool"}, {ignoreChanges: ["schemas"]})
  },
});

Please note that the same error occurs with the pulumi aws.cognito.UserPool resource but it can be worked around by adding the ignoreChanges: ["schemas"] option. Currently, the sst construct does not pass the options to the pulumi resource so this work around does not work for sst.

My suggestion would be to support the options on the sst construct as it will likely be useful in other cases as well.

sst ion version: 0.0.473

@goto3
Copy link

goto3 commented Jul 2, 2024

I am also having this issue

@jayair
Copy link
Contributor

jayair commented Jul 3, 2024

Oh interesting. Thanks for the pointer.

@hauerm
Copy link

hauerm commented Jul 4, 2024

In my case it turned out, that I created the CognitoUserPool and afterwards modified some configuration of it which affected already created schema attributes. This does not work by design in a Cognito User Pool. My solution was to remove and recreate the CognitoUserPool. Be careful with the attributes.

@jakubknejzlik
Copy link

Still experiencing this error almost in every deployment (in version 0.0.498) even with basic configuration and without touching the user pool. Current code:

const userPool = new sst.aws.CognitoUserPool("UserPool", {
  usernames: ["email"],
});
const client = userPool.addClient("FrontendApp");

What do You think about adding the temporary "fix" till #621 is resolved?
https://github.com/sst/ion/blob/dev/pkg/platform/src/components/aws/cognito-user-pool.ts#L217

{ parent, ignoreChanges: ["schemas"] },

@jakubknejzlik
Copy link

Nevermind, it seems that the upstream issue has been closed/fixed:

pulumi/pulumi-aws#1813

@goto3
Copy link

goto3 commented Jul 17, 2024

Same issue in sst 0.0.535

@jayair
Copy link
Contributor

jayair commented Jul 19, 2024

Can you try the latest? If they've released it then we should have it too.

@joshwils82
Copy link
Author

It looks to be working for me now.

@jayair
Copy link
Contributor

jayair commented Jul 19, 2024

Nice

@jayair jayair closed this as completed Jul 19, 2024
@goto3
Copy link

goto3 commented Jul 22, 2024

Working for me too! thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants