Zack McKenna
02/15/2022, 8:46 PMFilip Pyrek [AWS Hero]
02/15/2022, 10:52 PMstage
dynamically in SST? For example in my case based on git branch.
In Serverless Framework I’ve accomplished this via javascript file variables. Inside the file was a function which extracted git branch and returned it as a string which then became value of the stage
variable.Ashishkumar Pandey
02/16/2022, 5:06 AMcustomDomain: {
domainName: `${stageSubDomain}.${process.env.HOSTED_ZONE_NAME}`,
hostedZone: hostedZone,
path: process.env.API_VERSION, // this is 'v2'
}
I’m now trying to create another HTTP API in the same stack with the custom domain path set to ‘v3’ for versioning sake but this fails and errors out with this message :-
<http://abc.pqr.xyz|abc.pqr.xyz> already exists in stack arn:aws:cloudformation:region:xxx:stack/dev-api-v2-media-stack/xxxxxx
Is there a way to achieve path level versioning with route53 custom domains with HTTP APIs?Noah D
02/16/2022, 12:02 PMAPIGatewayProxyEventV2
from @types/aws-lambda
fine, however have been trying to get the identity pool id like seen in the guide using event.requestContext.authorizer.iam.cognitoIdentity.identityId
however the type seems to not think this field exists (it definitely does). My version is "@types/aws-lambda": "^8.10.92",
so might be related to that, but figure someone might have some insight into correct version to use if so 🙏Justin Robinson
02/16/2022, 12:56 PMDan Van Brunt
02/16/2022, 4:46 PMPablo Fernandez
02/16/2022, 6:38 PMreturn API.get("notes", "/notes")
. What's the first argument? "notes"? What does it match? I'm getting API notes does not exist
in my app (which is a bit different).Devin
02/16/2022, 7:06 PMimport { EdgeFunction } from "@serverless-stack/resources";
or something? Or is what makes it “edge” that I’m doing some config work with cfDistrobution
Joshua Oransky
02/16/2022, 8:04 PM$ cd /tmp/seed/source
INFO: Running before_build hook
$ echo "Before build"
0.08 s
$ cd website && npm install
82.19 s
$ npx sst build --stage dev --region us-west-2 --verbose
0.60 s
npm ERR! could not determine executable to run
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-02-16T19_55_37_431Z-debug.log
ERROR: There was an error synthesizing your app.
I have a build spec:
before_build:
- cd website && npm install
I feel like there's something simple I'm missing, but I can't figure it out.
Thanks for any help!Dan Van Brunt
02/17/2022, 1:19 AMReceived response status [FAILED] from custom resource. Message returned: Waiter InvalidationCompleted failed: Max attempts exceeded
This is the second time I’ve gotten this today. No rhyme or reason though, as consecutive tries seem to work.Filip Pyrek [AWS Hero]
02/17/2022, 1:25 PM@package/logger
) to my function. - that works ✅
When error is thrown inside the local lerna package (@package/logger
), the stack trace is broken and doesn’t show much. ❌
For example:
{
"errorType": "some-error",
"errorMessage": "hello",
"name": "some-error",
"stack": [
"some-error: hello",
" at l (/var/task/src/lambda.js:1:386)",
" at Runtime.p [as handler] (/var/task/src/lambda.js:1:467)",
" at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"
]
}
The stack trace should lead to @package/logger
files.Philipp Gaissert
02/17/2022, 6:17 PMDefaultStackSynthesizer
. However, when we try to deploy a debug stack for local debugging with sst start
, it gets caught in a failing loop in which it keeps trying to create a new bootstrapping stack, which fails because the default resource names violate our restrictions. How can we force sst/cdk to use our already-existing bootstrapping stack?Ernie Francis
02/17/2022, 7:43 PMBlackFenix2-bip-debug-stack and BlackFenix2-bip-bip-stack
Ernie Francis
02/17/2022, 7:58 PMDevin
02/17/2022, 7:59 PMsrc/
. my project is in us-east-1
. Below is a simplified version of my code.
import * as sst from "@serverless-stack/resources";
import { LambdaEdgeEventType, experimental } from "aws-cdk-lib/aws-cloudfront";
import * as lambda from "aws-cdk-lib/aws-lambda";
export default class MarketingStack extends sst.Stack {
constructor(scope, id, props) {
super(scope, id, props);
const originRewriteHandler = new experimental.EdgeFunction(
this,
"OriginRewriteFunc",
{
runtime: lambda.Runtime.NODEJS_14_X,
handler: "src/rewriter.main",
}
);
const staticSite = new sst.StaticSite(this, "Site", {
path: "website",
errorPage: "404.html",
buildOutput: "public",
buildCommand: "npm run build",
});
staticSite.cfDistribution.addBehavior("/*", staticSite.s3Bucket, {
edgeLambdas: [
{
functionVersion: originRewriteHandler.currentVersion,
eventType: LambdaEdgeEventType.ORIGIN_REQUEST,
},
],
});
}
}
When I try to tun this I get a type error that it can’t read bind of undefined
. Which makes sense since I have no idea what I’m doing 🤣 . Actually, I figure that it’s trying to connect the bucket and the lambda but I’m missing something. I don’t really kno how to debug this.Filip Pyrek [AWS Hero]
02/17/2022, 8:00 PMsetDefaultFunctionProps
) the live VScode lambda debugging gets broken?
When I remove that environment setting from the stack and deploy it, the debugger starts to catch the breakpoints. When I return it back and deploy it, it doesn’t catch any breakpoint.
Is VScode lambda debugger be taking into considerations the source maps anyhow when handling the breakpoints?Michael Clifford
02/17/2022, 8:24 PMCognito
construct. Can the same be achieved with the sst.Auth
construct? I was wondering why my User Pool wasn't showing up in the console when I realized this.Philipp Gaissert
02/17/2022, 10:27 PMrestApiName
to a new ApiGatewayV1Api
, but it still ends up getting named {stage}-{app}-{constructId}
?Ernie Francis
02/18/2022, 3:01 AMSean Matheson
02/18/2022, 9:19 AMApi
interact with it. Does anyone have an example of the CDK magic they performed to do the similar. I'm seeing wildly different examples out in the Internets, and I've come to trust the members of this community to have a much more precise and pragmatic approach to their CDK definitions. I'm only looking to have the RDS instance running for an actual deployment, for local I'm going to defer to a docker PG instance.heyysaiii
02/18/2022, 10:12 AMDaniel Gato
02/18/2022, 11:07 AMDaniel Gato
02/18/2022, 12:26 PMPiers Williams
02/18/2022, 12:46 PMAWS_PROFILE=xyx sst start
isn't working as expected, and hangs after printing
==========================
Starting Live Lambda Dev
==========================
SST Console: <https://console.serverless-stack.com/>...
the SST console site says No stacks found for app deploy-controller and stage piers
- I'm not sure where it's getting this stage from as I've not started sst with that stage parameter, any suggestions on what I can do to get past this and be able to test the frontend locally again?Ernie Francis
02/18/2022, 2:48 PMTypeError: Cannot read properties of undefined (reading 'UserPool')
at new BipStack (C:\Users\Asus\Documents\GitHub\bip\aws-backend\stacks\BipStack.ts:23:34)
at Object.main (C:\Users\Asus\Documents\GitHub\bip\aws-backend\stacks\index.ts:17:3)
at Object.<anonymous> (C:\Users\Asus\Documents\GitHub\bip\aws-backend\.build\run.js:94:16)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
Daniel Gato
02/18/2022, 4:24 PMKristian Lake
02/18/2022, 5:29 PMRiccardo Brero
02/18/2022, 6:31 PMDaniel Gato
02/18/2022, 6:36 PMDockerImageFunction
to a Bucket notification?
I’m getting:
Type 'DockerImageFunction' is not assignable to type 'FunctionDefinition'.
Type 'DockerImageFunction' is missing the following properties from type 'Function': _isLiveDevEnabled, localId, attachPermissions, getConstructMetadata ts(2322)
Philipp Gaissert
02/18/2022, 7:29 PMsst.WebSocketApi
that uses a Lambda integration, the source ARN of the API Gateway trigger that gets added to the Lambda function appears to be incorrectly formatted