Sam Hulick
10/22/2021, 7:57 PMType checking Lambda function source
lambda/graphql/models/Track.ts(1,23): error TS2307: Cannot find module '../types/media' or its corresponding type declarations.
lambda/graphql/models/Video.ts(1,23): error TS2307: Cannot find module '../types/media' or its corresponding type declarations.
in `Track.ts`:
import { Media } from '../types/media';
and that file definitely exists (lambda/graphql/types/media.ts)Mark Faulkner
10/22/2021, 9:08 PMundefined ERROR Error: Root typing path "/var/task/src/context.ts" for the type "context" does not exist
So any attempts to invoke the API routes from my Next.js client results in the above being written into Cloudwatch. Has anyone seen this error before, and would you be able to point me in a direction of solving it ?
For reference the schema for Apollo is as follows:
export const schema = makeSchema({
types,
outputs: {
schema: path.join(process.cwd(), 'src', 'generated', 'schema.gen.graphql'),
typegen: path.join(process.cwd(), 'src', 'generated', 'nexus-types.gen.ts'),
},
plugins: [fieldAuthorizePlugin()],
contextType: {
module: path.join(process.cwd(), 'src', 'context.ts'),
export: 'ContextType',
alias: 'ctx',
},
});
Adrian Schweizer
10/23/2021, 12:10 AMthis.auth = new sst.Auth(this, "Auth", {
cognito: false,
identityPool: {
identityPoolName: "<http://convento.app|convento.app>",
developerProviderName: "<http://login.convento.app|login.convento.app>",
allowUnauthenticatedIdentities: true,
},
});
Louis Barclay
10/23/2021, 4:05 PMNextjsSite
work within my sst API, i.e. run by one of my serverless functions? Use case: I want a route on my API which sets up a new Next.js site for a customer when they request it. In other words, I need an sst construct to be run dynamically within my API. Any tips on how to do this would be much appreciated!
Some more explanation:
• My SaaS sets up Cloudfront distributions for its customers
• I have demand from certain customers to create fully-fledged Next.js apps for them, and I'd like to create these using Cloudfront distributions (for cost reasons and because I already create Cloudfront distributions for my customers)
• Seems like NextjsSite
might do a lot of the hard work of setting up a Next.js app at a Cloudfront distribution if I can get my (sst) API to be able to run itPatrick Gold
10/23/2021, 5:56 PMnode_modules/@types/node/child_process.d.ts:267:18 - error TS2304: Cannot find name 'AbortSignal'.
Sourav Sarkar
10/23/2021, 5:58 PMHi, we are trying to move from serverless pro to seed.run, but stuck in a general problem, we use cloudformation to create cognito with custom lambda based authentication.
we have a mono repo, were in one service we have the lambdas. And in another service we have cognito. So in pipeline we have two stages, in the first stage the lambda deploys and after that the cognito, this is easy to setup , but i want to refer the output of the lambda service (some lambda arns) and use them in cognito service.
In serverless pro, i would use "output" and then use them like this in the next stack ${output:auth.CreateDashlambdaLambdaFunctionQualifiedArn}
I do not want to manually copy the arn, as we have many other use cases like dynamodb stream processing in lambda as one, which we will migrate after this. whats the best way to do this in seed ? i did not see this in the seed.run documentations
Note: I am not using sst, rather i am using serverless frameworkYousef
10/23/2021, 6:12 PMÖmer Toraman
10/23/2021, 11:36 PMaws-sdk
package, as I never use it. And it is like 10 MB, as far as the runtime initilization will be faster with smaller size.Ömer Toraman
10/24/2021, 12:53 AMnpx start --stage dev
?Ömer Toraman
10/24/2021, 1:44 AMApi
handlers:
const api = new sst.Api(this, "Api", {
routes: {
"POST /todo": {
srcPath: 'src/handlers/apiGateway/todo/',
handler: 'post-todo.handler',
functionName: 'post-todo',
description: 'Creates a new post'
}
},
});
This creates a log group named /aws/lambda/post-todo
, is it possible that I can prefix it?
Something like /aws/lambda/stackName/post-todo
Ömer Toraman
10/24/2021, 2:47 AMDan Van Brunt
10/24/2021, 11:52 AMEventBus
I’ve created for aws:mediaconvert
only triggers manually when testing but when I mediaconvert.createJob
it successfully completes but the eventBus function doesn’t trigger. Are they any special permissions I need to add to allow mediaconvert to create that event?
new sst.EventBus(this, 'TranscoderBus', {
rules: {
rule1: {
eventPattern: {
source: ['aws.mediaconvert'],
detailType: ['MediaConvert Job State Change'],
detail: {
status: ['COMPLETE'],
},
},
targets: ['lib/constructs/VideoTranscoder/lambdas/jobstatus.handler'],
},
},
})
I’ve also tried lowering the eventPattern to just the sourcePatrick Gold
10/24/2021, 11:22 PMsst start
. This happens after the debugger attaches. Anybody know what’s up?
.build/services/lambda.main is undefined or not exported
Route section of API:
routes: {
"GET /private": "services/lambda.main",
"GET /public": {
function: "services/lambda.main",
authorizationType: sst.ApiAuthorizationType.NONE,
},
},
Ömer Toraman
10/25/2021, 11:46 AMX
and Y
for the POST
request.
Even though I send the same X
and Y
values, X-Cache
header is always Miss from cloudfront
Why is that? Is it because it is a POST request?Damjan
10/25/2021, 2:26 PMDamjan
10/25/2021, 2:41 PMprocess.env.IS_LOCAL
Dan Van Brunt
10/25/2021, 2:42 PMsst.Function
to bundle as it does… but Additionally pull in a static directory?
So the resulting assets uploaded to the function are something like.
handler.js (bundle)
/static/...
Stan
10/25/2021, 3:04 PM<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>557QNR68XV66PJ3Z</RequestId>
<HostId>NvQ+73Rns6kCTmYb5cUEJGqXLiXNS8h1Fd0LQ0DsSmytrgjEg1KUkMIl4o0I79Gz3Zm5pihaqqw=</HostId>
</Error>
This is my stack:
import { StringParameter } from "@aws-cdk/aws-ssm";
import * as sst from "@serverless-stack/resources";
export default class MerchantPanelStack extends sst.Stack {
constructor(scope: <http://sst.App|sst.App>, id: string, props?: sst.StackProps) {
super(scope, id, props);
const hostedZone = StringParameter.valueFromLookup(this, "/route53/subdomain/zoneName").toLowerCase();
const site = new sst.StaticSite(this, "MerchantPanelSite", {
path: "frontend",
buildOutput: "dist",
buildCommand: "yarn run build",
errorPage: sst.StaticSiteErrorOptions.REDIRECT_TO_INDEX_PAGE,
customDomain: {
domainName: `merchant-panel.${hostedZone}`,
hostedZone: `${hostedZone}`
}
});
// Show the endpoint in the output
this.addOutputs({
WebsiteURL: site.url,
});
}
}
I've tried making access to s3 bucket public, but this does not help anyway on cf level. I heard it might takes up to few hours with cloud front to propagate all the things until it works. Is this the case or am I doing something wrong?Josimar Zimermann
10/25/2021, 7:13 PMClient not connected. make sure "sst start" is running.
What should I do?Seth Geoghegan
10/25/2021, 8:03 PMsst remove
operation that removes my debug-stack, but leaves my primary stack in placeJulien Goux
10/25/2021, 8:08 PMMark Fox
10/25/2021, 8:31 PMimport * as sst from "@serverless-stack/resources";
import { StaticSiteErrorOptions } from "@serverless-stack/resources";
export default class MyStack extends sst.Stack {
constructor(scope, id, props) {
super(scope, id, props);
// Create a HTTP API
const api = new sst.Api(this, "Api", {
customDomain: {
domainName: "<http://api.blah.ca|api.blah.ca>",
hostedZone: "<http://blah.ca|blah.ca>"
},
routes: {
"GET /": "src/lambda.handler",
},
});
// Show the endpoint in the output
this.addOutputs({
"ApiEndpoint": api.url,
"CustomDomainUrl": api.customDomainUrl,
});
const site = new sst.StaticSite(this, "Nuxt Site", {
path: "frontend",
buildOutput: "dist",
buildCommand: "npm run generate",
errorPage: StaticSiteErrorOptions.REDIRECT_TO_INDEX_PAGE,
customDomain: {
domainName: "<http://dev.blah.ca|dev.blah.ca>",
hostedZone: "<http://blah.ca|blah.ca>",
},
});
this.addOutputs({
"CloudFront URL": site.url,
})
}
}
The failure message is:
MarkDev-serverless-stack-test-my-stack | CREATE_FAILED | Custom::SSTBucketDeployment | NuxtSiteCustomResource71AA1EA4 Received response status [FAILED] from custom resource. Message returned: 'NoneType' object is not iterable (RequestId: 63a4abb9-d153-4bb3-9962-b75b5f978c38)
If I comment out the customDomain passed into the StaticSite, it works fine, but not under the domain I want to use.Kevin Lenell
10/26/2021, 1:18 AMRyan Martin
10/26/2021, 2:41 AMNoah D
10/26/2021, 10:40 AMsst start
it seems unable to deploy my stack giving me the error Error: Cannot find asset at C:\users\noah\documents\code\.build\dist\stub.zip
I am only trying to launch a lambda function with minimal functionality (screenshot 1&2) I will note I have only just started learning about yarn workspaces (and trying to use yarn 3) so might be some misconfiguration there. But any thoughts around potential paths to debug would be helpful too 👌🏼Patrick Gold
10/26/2021, 1:48 PMGreg Martin
10/26/2021, 2:23 PMPatrick Gold
10/26/2021, 6:16 PM/packages/backend/src/services
and I’m launching sst start
using the vscode launch script. That works fine. I can see in the logs that the requests are coming through and the handlers are being called, but my breakpoints in VSCode are never hit. Additionally, every time they are called, esbuild seemingly is compiling the handlers before responding (It shows so in the terminal). I don’t believe it was doing that previously. I’m wondering if it has something to do with the new file organization structure and if I need to modify an sst config somewhere. I’ve seen the yarn monorepo example and nothing stood out to me. Any advice would be welcome!Dan Van Brunt
10/26/2021, 8:08 PMsst.Api > Function
Dan Van Brunt
10/26/2021, 9:07 PMpath.join(__dirname, './custom-resource')
this is equaling
/.build/lib/custom-resource
which is unexpected. I would have thought it would have been
/lib/constucts/ApiSite/custom-resource
I think its because the TS outputs are going into .build but not the adjacent custom-resource
folder wiht my lambda asset in it.
Although I see this being done quite frequently in the sst code.
How should we develop Constructs that we’d like to eventually publish to npm that require function assets like this?