Jacob Hayes
08/27/2021, 1:43 PMserverless-bundle
and aws-appsync
using a different version of graphql in their dependencies and causing the following error?:
"errorMessage": "Cannot use n \"__Schema\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\n<https://yarnpkg.com/en/docs/selective-version-resolutions>\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results."
This only started happening when I added serverless-bundle
to leverage yarn/lerna workspaces. All my services work correctly outside of the couple that are using the aws-appsync
libs which appear to be using a really old graphql version (0.13.0) whereas serverless-bundle
is using version 15.5.1Jereme Monteau
08/27/2021, 3:08 PMSam Hulick
08/27/2021, 9:01 PMDennis Dang
08/27/2021, 10:23 PMSam Hulick
08/27/2021, 11:24 PMAbdul Taleb
08/28/2021, 4:24 AMDaniel da Rocha
08/29/2021, 3:51 PM{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowSESPuts-1629654011154",
"Effect": "Allow",
"Principal": {
"Service": "<http://ses.amazonaws.com|ses.amazonaws.com>"
},
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::mailtosheet-emails/*",
"Condition": {
"StringEquals": {
"aws:Referer": "326317869239"
}
}
}
]
}
How could I do the same if I create the bucket using SST?
I went as far as this:
this.mailBucket = new sst.Bucket(this, "mts-emails");
const SESPolicy = new iam.PolicyStatement({
actions: ["s3:PutObject"],
effect: iam.Effect.ALLOW,
resources: [this.mailBucket.bucketArn],
principals: [new iam.ServicePrincipal("<http://ses.amazonaws.com|ses.amazonaws.com>")],
conditions: {
StringEquals: {
"aws:Referer": "326317869239",
},
},
});
But then, I got lost on how to apply this policy to the bucket… reading into attachPermissions
did not make it very clear where to insert `SESPolicy`….
Anyone knows? 🙏Sam Hulick
08/29/2021, 11:53 PMremove
vs deploy
vs diff
Aso Sun
08/30/2021, 10:43 AMPavan Kumar
08/30/2021, 1:38 PMApolloApi
support subscription?Abdul Taleb
08/30/2021, 3:42 PMAbdul Taleb
08/30/2021, 4:09 PM$(whomai)
, and I'm debugging something in dev
environment, what's the best way to use dev
cognito pool rather than my personal cognito pool?Sam Hulick
08/30/2021, 7:06 PM.eslintrc.json
Dillon Peterson
08/30/2021, 8:31 PMJanessa
08/31/2021, 12:32 AMexternalModule
to bundle (example below)? Here are the docs I’m referencing: https://docs.serverless-stack.com/working-locally#using-lambda-layers
new sst.Function(this, "test", {
handler: "src/app/testLambda.lambdaHandler",
bundle: {
nodeModules: ["winston"],
externalModules: ["SentryNodeServerlessSDK"] // also tried "@sentry/serverless"
},
layers: [
lambda.LayerVersion.fromLayerVersionArn(this, "SentryLayer", "arn:aws:lambda:us-west-2:943013980633:layer:SentryNodeServerlessSDK:29")
]
})
Also for more context, I’m trying to add a sentry layer. The docs I’m using are here: https://docs.sentry.io/platforms/node/guides/aws-lambda/layer/
Thanks in advance 😄Guy Shechter
08/31/2021, 3:47 AMSam Hulick
08/31/2021, 4:09 AM❌ dev-microservices-media-processor failed: Export dev-microservices-media-processor:ExportsOutputRefMakeSnippetFuncA30B25837ED330C0 cannot be deleted as it is in use by dev-microservices-api-media
basically, the APIMedia stack used to depend on a function defined in the MediaProcessor stack. but it doesn’t anymore.. I removed references to MakeSnippetFunc
in the APIMedia stack. so I think it’s trying to clear out the export, but it can’tAnupam Dixit
08/31/2021, 7:50 AMKujtim Hoxha
08/31/2021, 11:53 AM---> serviceA
------> lib
--------->index.ts
------> src
-------->handlers
------> sst.json
---> servoiceB
------> lib
--------->index.ts
------> src
-------->handlers
------> sst.json
---> common
------> lib
---------->api.stack.ts
----------> index.ts
------> sst.json
Is there a way that all the services can share the same API gateway and for e.x the same cognito authorizer?
In addition to that would Seed recognise them as separate services and deploy only the once that changed?
If something in common changes (a common resource) that would in turn affect serviceA would that trigger the build for A?Sam Hulick
08/31/2021, 7:47 PMwithCredentials: true
, and the OPTIONS
request is failing because the response can’t be access-control-allow-origin: *
when withCredentials === true
Sam Hulick
08/31/2021, 9:15 PMSam Hulick
08/31/2021, 9:23 PMSecurityPolicyProtocol.TLS_V1_2_2021
until after 1.114.0Adrián Mouly
08/31/2021, 10:00 PMAdrián Mouly
09/01/2021, 8:05 AMCloudfront-Viewer-Country
. Apparently this is possible to do using Edge from GW v1, but not using GW v2 with Regional?
https://stackoverflow.com/questions/64318725/geolocation-service-with-aws-api-gateway-and-lambdaAram
09/01/2021, 8:21 AM// WebhookEventsProcessor
const webhookEventsProcessor = new Function(this, 'WebhookEventsProcessor', {
handler: 'src/webhookEventsProcessor.handler',
functionName: `${scope.stage}-webhook-events-processor`,
memorySize: 256,
timeout: 30,
environment: {
...globalEnvironment,
SEND_WEBHOOK_EVENTS_QUEUE: sendWebhookEventsQueue.sqsQueue.queueUrl,
},
permissions: ['sns', 'sqs'],
currentVersionOptions: {
provisionedConcurrentExecutions: 1,
},
vpc: appVpc,
vpcSubnets: {
subnets: appVpc.privateSubnets,
},
});
const webhookEventsProcessorLive = webhookEventsProcessor.currentVersion;
const messagingEventsTopic = new Topic(this, 'MessagingEvents', {
subscribers: [
{
function: webhookEventsProcessorLive,
},
],
});
and the error I'm getting when trying to build this is
{"awsRequestId":"NOT SET YET","level":"error","message":"(node:24544) UnhandledPromiseRejectionWarning: Error: Invalid function definition for the \"Subscriber_0\" Fun
ction\n at Function.fromDefinition (/code/messaging/node_modules/@serverless-stack/resources/src/Function.ts:433:11)\n at Topic.addFunctionSubscriber (/code/mess
aging/node_modules/@serverless-stack/resources/src/Topic.ts:203:19)\n at Topic.addSubscriber (/code/messaging/node_modules/@serverless-stack/resources/src/Topic.ts:
158:12)\n at /code/messaging/node_modules/@serverless-stack/resources/src/Topic.ts:117:46\n at Array.forEach (<anonymous>)\n at Topic.addSubscribers (/code/me
ssaging/node_modules/@serverless-stack/resources/src/Topic.ts:117:17)\n at new Topic (/code/messaging/node_modules/@serverless-stack/resources/src/Topic.ts:72:10)\n
at new MindfulMessagingStack (/code/messaging/services/sst/lib/MindfulMessagingStack.ts:146:34)\n at Object.main (/code/messaging/services/sst/lib/index.ts:27:2
5)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)\n(Use `node --trace-warnings ...` to show where the warning was created) "}
{"awsRequestId":"NOT SET YET","level":"error","message":"(node:24544) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by th
rowing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled pro
mise rejection, use the CLI flag `--unhandled-rejections=strict` (see <https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode>). (rejection id: 1) "}
{"awsRequestId":"NOT SET YET","level":"error","message":"(node:24544) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise
rejections that are not handled will terminate the Node.js process with a non-zero exit code. "}
{"awsRequestId":"NOT SET YET","level":"info","message":"\u001b[90mLinting Lambda function source\u001b[39m "}
Aso Sun
09/01/2021, 11:51 AMAso Sun
09/01/2021, 11:58 AMevent.requestContext.identity.cognitoIdentityId
, why does it become event.requestContext.authorizer.iam.cognitoIdentity.identityId
in the latest guide?George Evans
09/01/2021, 3:51 PMGevorg A. Galstyan
09/01/2021, 3:55 PMGevorg A. Galstyan
09/01/2021, 3:56 PM