PĂ„l Brattberg
08/26/2021, 7:14 AMStack test-peasy-cognito
[2021-08-25T15:38:18.392] [INFO] default - Status: failed
[2021-08-25T15:38:18.392] [INFO] default - Error: The test-peasy-cognito stack contains no resources.
[2021-08-25T15:38:18.393] [ERROR] default - Cannot convert undefined or null to object
My stack looks like this:
import * as cdk from '@aws-cdk/core'
import * as sst from '@serverless-stack/resources'
import * as cognito from '@aws-cdk/aws-cognito'
import * as apigAuthorizers from '@aws-cdk/aws-apigatewayv2-authorizers'
/** Manages the cdk-portions of the `cognito` resource. */
export default class CognitoStack extends sst.Stack {
constructor (scope, id, props) {
super(scope, id, props)
// Cognito authorizers taken from Serverless definitions
this.userPool = cognito.UserPool.fromUserPoolId(this, 'existingUserPool', cdk.Fn.importValue(`${scope.stage}-CognitoUserPoolId`))
this.userPoolClient = cognito.UserPoolClient.fromUserPoolClientId(this, 'existingUserPoolClient', cdk.Fn.importValue(`${scope.stage}-CognitoUserPoolClientId`))
this.userPoolAuthorizer = new apigAuthorizers.HttpUserPoolAuthorizer({
userPool: this.userPool,
userPoolClient: this.userPoolClient
})
}
}
As you can see, this is bringing in an existing pool that was previously created by serverless.
lib/index.js
includes this bit: this.cognitoStack = new CognitoStack(app, 'cognito')
If you have ideas or pointers, that would be much appreciated! đthdxr
08/26/2021, 7:20 AMthis.addOutputs
and add an outputPĂ„l Brattberg
08/26/2021, 7:27 AMPĂ„l Brattberg
08/26/2021, 7:50 AMPĂ„l Brattberg
08/26/2021, 8:38 AM0.37.2
and that got me past this problemFrank
PĂ„l Brattberg
08/30/2021, 7:53 AM