Anupam Dixit
08/23/2021, 8:37 AMAnupam Dixit
08/23/2021, 11:42 AMFazi
08/23/2021, 4:27 PMnpm run deploy -- --stage=Integration
, how can I grab the stage? I tried with process.argv
but that didn't workSam Hulick
08/23/2021, 6:04 PMAppSyncApiEBDAEC17 Failed to assume service-linked role arn:aws:iam::xxx:role/aws-service-role/appsync.amazonaws.com/AWSServiceRoleForAppSync, please retry. (Service: AWSAppSync; Status Code: 403; Error
Code: AccessDeniedException)
Hubert
08/24/2021, 11:30 AMError: ENOENT: no such file or directory, copyfile '/home/xxx/xxx/xxx/node_modules/@aws-cdk/core/lib/custom-resource-provider/nodejs-entrypoint.js' -> '/home/xxx/xxx/xxx/.build/lib/edge-function/__entrypoint__.js'
Any ideas why this is happening??gio
08/24/2021, 12:19 PMKeThang
08/24/2021, 12:56 PMSam Hulick
08/24/2021, 4:17 PMnew sst.EventBus(this, 'VideoUpdateHandler', {
defaultFunctionProps: { srcPath },
rules: {
processUpdateRule: {
eventPattern: {
source: ['aws.mediaconvert'],
detailType: ['MediaConvert Job State Change'],
detail: {
queue: [videoQueue.attrArn],
status: ['COMPLETE', 'PROGRESSING', 'STATUS_UPDATE', 'ERROR'],
},
},
targets: [`${handlerPrefix}/video-process-update.main`],
},
},
});
Sam Hulick
08/24/2021, 5:30 PMRule
works in @aws-cdk/aws-events
? I created a rule, and then I’m trying to add a target but it doesn’t work:
``````Sam Hulick
08/24/2021, 6:38 PMdev-microservices-core | UPDATE_ROLLBACK_IN_PROGRESS | AWS::CloudFormation::Stack | dev-microservices-core Export dev-microservices-core:ExportsOutputRefUploadBucketB0FBA0377290D88A cannot be deleted as it is in use by dev-microservices-media-processor
there’s some weird dependency thing going on here and I don’t understand it.Austin
08/24/2021, 6:52 PMSam Hulick
08/25/2021, 3:26 AMsrc
is a workspace.. in other words, all the Lambda & other business logic stuff in src has its own set of packages and tsconfig.
src/tsconfig.json
looks like this:
{
"extends": "../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/*": ["./*"]
},
},
"include": ["**/*", "../environment.d.ts"]
}
but when I do yarn build
, I get this error:
> src/core/trash/purge-deleted-items.ts:9:30: error: Could not resolve "~/libs/db" (mark it as external to exclude it from the bundle)
9 │ import { dataApi, knex } from '~/libs/db';
why is the path alias not working?Slawomir Stec
08/25/2021, 4:27 AMconst api = new sst.Api(this, "Api", {
// defaultAuthorizationType: ApiAuthorizationType.CUSTOM,
defaultAuthorizer: new HttpLambdaAuthorizer({
authorizerName: "LambdaAuthorizer",
handler: new sst.Function(this, "Authorizer", {
handler: "src/authorizer.handler"
}),
}),
routes: {
"GET /private": {
authorizationType: ApiAuthorizationType.CUSTOM,
handler: "src/private.handler"
},
"GET /authenticate/facebook": "src/auth-facebook.handler"
}
[8:27 AM] I checked 0.40.1 and latest 0.40.2 -> in both cases produced Cloudformation template contains
[8:27 AM] AuthorizationType: NONE
[8:28 AM] I can set defaultAuthorizationType to CUSTOM, however this apply for all routes and can’t be overwritten with authorizationType for specific routesAram
08/25/2021, 7:28 AMHubert
08/25/2021, 10:59 AMnpx sst start
my layer stack breaks the deployment with stack contains no resources.
I've even put an sst.Function
with a dummy function in case that fixes the problem. Any ideas why it suddenly started to break?Sam N
08/25/2021, 4:11 PMsst test
? It’s is taking upwards of 15 seconds with about 15 simple test cases.Blake E
08/25/2021, 4:47 PMBlake E
08/25/2021, 4:53 PMBlake E
08/25/2021, 5:03 PMsst.json
to https://github.com/schemastore/schemastore ?Sam Hulick
08/25/2021, 6:53 PMSam Hulick
08/25/2021, 7:19 PMprod-microservices-api | CREATE_FAILED | AWS::AppSync::GraphQLApi | AppSyncApiEBDAEC17 Failed to assume service-linked role arn:aws:iam::xx:role/aws-service-role/appsync.amazonaws.com/AWSServiceRoleForAppSync, please retry. (Service: AWSAppSync; Status Code: 403; Error Code: AccessDeniedException; Request ID: ba7b1b89-9add-4d89-bbbb-0def2024ff5b; Proxy: null)
I’m in an account with admin accessSam Hulick
08/25/2021, 7:33 PMSam Hulick
08/25/2021, 11:11 PMdev-microservices-core | CREATE_FAILED | AWS::S3::Bucket | UploadBucketB0FBA037 API: s3:setBucketAccelerateConfiguration Access Denied
the IAM user doing the deploy has full admin accessSam Hulick
08/26/2021, 12:39 AMRebuilding infrastructure...
Press ENTER to redeploy infrastructure
Deploying stacks
✅ dev-microservices-core (no changes)
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! 🙏ACPixel
08/26/2021, 9:18 AM<http://api.example.com|api.example.com>
and a web page at <http://example.com|example.com>
I have a few routes setup, and for the most part everything works fine. However, specifically PATCH
and PUT
requests from the web page to the sst API fail from cors preflight request. DELETE
works fine however which weirded me out a bit. If there's any blatantly obvious thing I'm missing that would be a huge help!
I do have an OPTIONS
route setup as well, that returns an access-control header, as well as on the API construct I have the cors options with the allowed methods and the allowed origins array, with <https://example.com>
in the allowed originJacob Hayes
08/26/2021, 2:21 PM{
"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module 'jmespath'\nRequire stack:\n- /var/task/node_modules/aws-sdk/lib/request.js\n- /var/task/node_modules/aws-sdk/lib/core.js\n- /var/task/node_modules/aws-sdk/lib/event-stream/event-message-chunker-stream.js\n- /var/task/node_modules/aws-sdk/lib/event-stream/streaming-create-event-stream.js\n- /var/task/node_modules/aws-sdk/lib/node_loader.js\n- /var/task/node_modules/aws-sdk/lib/aws.js\n- /var/task/handler.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js",
}
So it seems like all services don’t have the dependencies of the libraries that they use/are in their service specific package.json
Anyone have any thoughts here on things to try?Daniel da Rocha
08/26/2021, 2:50 PMimport * as sst from "@serverless-stack/resources";
export default class MtSStack extends sst.Stack {
constructor(scope, id, props) {
super(scope, id, props);
const spamCheck = new sst.Function(this, "SpamCheck", {
handler: "src/spamCheck.handler",
});
this.addOutputs({
FunctionArn: spamCheck.functionArn,
});
}
}
But keep getting some issues on start/deploy:
prod-mts-sst-app-debug-stack | CREATE_FAILED | AWS::Lambda::Function | Connect5B7625CA Template error: IAM role prod-mts-sst-app-debug-st-ConnectServiceRole07B61C-6GL2GT2QJTIS doesn't exist
prod-mts-sst-app-debug-stack | CREATE_FAILED | Custom::S3AutoDeleteObjects | BucketAutoDeleteObjectsCustomResourceBAFD23C2
prod-mts-sst-app-debug-stack | CREATE_FAILED | AWS::Lambda::Function | Resource
prod-mts-sst-app-debug-stack | CREATE_FAILED | AWS::Lambda::Function | Disconnect7D6B12BD
Any ideas of how to get it working?Sam Hulick
08/26/2021, 7:01 PMprops!.cognitoAuth.attachPermissionsForUnauthUsers([
new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
actions: ['appsync:GraphQL'],
resources: [
appSyncApi.getResolver('Mutation createSession')!.arn,
appSyncApi.getResolver('Mutation createEvent')!.arn,
],
}),
]);
Sam Hulick
08/26/2021, 10:08 PM