Giter Site home page Giter Site logo

Comments (10)

ryanmcfall avatar ryanmcfall commented on September 17, 2024 2

I can confirm this approach works.:

  • Check out the most recent commit to the cdk-construct repo's main branch (9191b42)
  • Make two changes to pom.xml:
    • Modify the property aws-cdk-lib.version to have the value 2.130.0
    • Change the <version> property to have the value 0.1.14-SNAPSHOT
  • Execute mvn install to install that version of the project to my local repository
  • Changed the reference to cdk-constructs in my deployment project's pom.xml from version 0.1.13 to 0.1.14-SNAPSHOT
  • Ran npm cognito:deploy

from stratospheric.

ryanmcfall avatar ryanmcfall commented on September 17, 2024 1

@giuliopulina thanks for all your help following up on this. I will give this a shot and see what I can do.

from stratospheric.

BjoernKW avatar BjoernKW commented on September 17, 2024 1

Thanks for this discussion and finding a workaround. I'm closing this for now since the issue has been resolved. We'll release a new version of https://github.com/stratospheric-dev/cdk-constructs soon and update to that version.

from stratospheric.

giuliopulina avatar giuliopulina commented on September 17, 2024

I think that the lambda is auto-generated to retrieve the client secret from the user pool.

{
  "DescribeCognitoUserPoolClient": {
    "id": "DescribeCognitoUserPoolClient",
    "path": "ApplicationStack/userPoolClient/DescribeCognitoUserPoolClient",
    "children": {
      "Provider": {
        "id": "Provider",
        "path": "ApplicationStack/userPoolClient/DescribeCognitoUserPoolClient/Provider",
        "constructInfo": {
          "fqn": "aws-cdk-lib.aws_lambda.SingletonFunction",
          "version": "2.130.0"
        }
      }
    }
  }
}

By the way, did you update the cdk version in the package.json?

from stratospheric.

ryanmcfall avatar ryanmcfall commented on September 17, 2024

@giuliopulina Thanks for the pointer. Where did that code come from? I have a few guesses but am pretty new to AWS / CDK.

I hadn't updated package.json, but had updated the global version of cdk.

I just updated the version in package.json and ran npm update. Then I tried to run the Cognito deployment app again, but got the same result.

I do suspect it's related to the creation of the UserPoolClient since the error occurs right after this log statement is generated:

CREATE_IN_PROGRESS   | AWS::IAM::Policy                      | 
cognito/userPoolClient/DescribeCognitoUserPoolClient/CustomResourcePolicy 
(userPoolClientDescribeCognitoUserPoolClientCustomResourcePolicy05AFFF63) Resource creation Initiated

Any other ideas?

from stratospheric.

giuliopulina avatar giuliopulina commented on September 17, 2024

@giuliopulina Thanks for the pointer. Where did that code come from? I have a few guesses but am pretty new to AWS / CDK.

I hadn't updated package.json, but had updated the global version of cdk.

I just updated the version in package.json and ran npm update. Then I tried to run the Cognito deployment app again, but got the same result.

I do suspect it's related to the creation of the UserPoolClient since the error occurs right after this log statement is generated:

CREATE_IN_PROGRESS   | AWS::IAM::Policy                      | 
cognito/userPoolClient/DescribeCognitoUserPoolClient/CustomResourcePolicy 
(userPoolClientDescribeCognitoUserPoolClientCustomResourcePolicy05AFFF63) Resource creation Initiated

Any other ideas?

The code that I posted are from the Cloudformation templates generated from the "cdk synth" command, run in my local environment (specifically, tree.json file).
I have built a different version of the Stratospheric application using a different CDK structure, but the core is the same.
Just for my understanding, are you running your npm/cdk command from your local machine or from the CI (Github Actions)?

If, as I imagine are you running the commands from your local environment, I would suggest to try to run the following commands from your cdk folder:

  • npm install
  • npm list
    (output should be like this)
    -- [email protected]
  • npm run cognito:deploy

Also, if you could put your project on Github, I think it could be helpful

from stratospheric.

ryanmcfall avatar ryanmcfall commented on September 17, 2024

Thanks for the explanation on the cdk synth output; that was basically what I was thinking was happening.

I'm running the code from my local machine, not a GitHub action. When I run npm list, I get:

[email protected] C:\Users\mcfal\source\imhere\imhere_server_deploy
└── [email protected]

So that seems correct.

Any other ideas of things to check for?

from stratospheric.

giuliopulina avatar giuliopulina commented on September 17, 2024

Thanks for the explanation on the cdk synth output; that was basically what I was thinking was happening.

I'm running the code from my local machine, not a GitHub action. When I run npm list, I get:

[email protected] C:\Users\mcfal\source\imhere\imhere_server_deploy
└── [email protected]

So that seems correct.

Any other ideas of things to check for?

Unfortunately not many other ideas, without looking at the project :( if you could share it on a Github, that would surely help to figure out the issue.

The only thing that comes into my mind is to try to re-run 'npm bootstrap' with the new CDK because maybe there are some defaults that need to be overridden.

from stratospheric.

ryanmcfall avatar ryanmcfall commented on September 17, 2024

I tried re-running the bootstrap command, with no luck. At first it didn't want to do anything, so I deleted that stack. This caused a few problems but I was able to resolve them using the AWS console, and then re-bootstrap the CDK. Re-running npm rum cognito:deploy caused an error at the same location.

My code is hosted on BitBucket rather than GitHub, but I've created a GitHub repo and pushed the code to [email protected]:ryanmcfall/cdk_deploy.git. There's no value for the accountId parameter in ckd.json; obviously you'd need to change that / pass it on the command line to test anyway.

Any thoughts on this would be greatly appreciated!

from stratospheric.

giuliopulina avatar giuliopulina commented on September 17, 2024

Ok, I think I found the issue:

  • your project depends on latest released version of stratospheric-dev/constructs (release 0.1.13).
  • unfortunately, this version of stratospheric-dev/constructs contains a reference to aws-cdk version 2.43.1, that is a very old version and doesn't contain this commit that updates the default Node runtime for custom resources to v18.
    This is causing the lambda functions to be generated with Node14 runtime, thus making your deployment fail.

I think the cleanest solution is to wait for the maintainers (@thombergs @BjoernKW @rieckpil) to release a new version of the project.
Temporarily, you can checkout the stratospheric-dev/constructs project locally, upgrade the cdk dependency to 2.130.0 version, build and install it in local maven repo and update your app to use the SNAPSHOT.

I also found a strange thing in cdk-constructs project: the latest release version is 0.1.13, but the current pom.xml version is 0.1.12-SNAPSHOT: it should be 0.1.14-SNAPSHOT.

from stratospheric.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.