Brinsley
02/01/2022, 11:30 AMScript
I had configured for OnCreate
can no longer call the function after updating it to also run for `onUpdate`:
❌ uat-test-script-postDeploy failed: Received response status [FAILED] from custom resource. Message returned: AccessDeniedException: User: arn:aws:sts::XXXX:assumed-role/uat-test-script-postDeplo-databasemigrationsScript-ZR7JG0WQ7X78/uat-test-script-postDeplo-databasemigrationsScript-RNd8bebkFvd9 is not authorized to perform: lambda:InvokeFunction on resource: arn:aws:lambda:eu-west-2:XXXX:function:uat-test-script-postDeplo-databasemigrationsonUpda-lYXmgfD7kvbZ because no identity-based policy allows the lambda:InvokeFunction action
at Object.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/json.js:52:27)
at Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/rest_json.js:55:8)
at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:688:14)
at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:690:12) (RequestId: 8108ca79-2fa1-4df4-800f-6a8d94af4c82)
Any ideas here?Jon Holman
02/01/2022, 3:14 PMnpx sst start
but it blows up with npx sst deploy
. I'll put more in the thread.Hubert
02/01/2022, 4:18 PMError: A subscription with id "Topic" already exists under the scope dev-*-metadata-stack/UpdateSnapshot
at Topic.addSubscription (/home/dev/Documents/*/Github/*/node_modules/aws-cdk-lib/aws-sns/lib/topic-base.ts:61:13)
at Topic.addFunctionSubscriber (/home/dev/Documents/*/Github/*/node_modules/@serverless-stack/resources/src/Topic.ts:231:19)
at Topic.addSubscriber (/home/dev/Documents/*/Github/*/node_modules/@serverless-stack/resources/src/Topic.ts:176:12)
at /home/dev/Documents/*/Github/*/node_modules/@serverless-stack/resources/src/Topic.ts:125:46
at Array.forEach (<anonymous>)
at Topic.addSubscribers (/home/dev/Documents/*/Github/*/node_modules/@serverless-stack/resources/src/Topic.ts:125:17)
at new MetadataStack (/home/dev/Documents/*/Github/*/lib/metadataStack.js:231:22)
at Object.main (/home/dev/Documents/*/Github/*/lib/index.js:125:39)
at Object.<anonymous> (/home/dev/Documents/*/Github/*/.build/run.js:94:16)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
Any ideas of a work around? Thanks!Casiel Didriksson Muriedas
02/01/2022, 4:39 PMexport const main: APIGatewayProxyHandlerV2<any> = async (e,context) => {
await wait(10000);
console.log(context.getRemainingTimeInMillis());
return okHandler({finished:true})
}
And the Stack Function looks like this:
const assetFunction = new sst.Function(this, "assetApiFunction", {
environment: { ...props.enviroment_vars, functionBatch: functionBatch.functionName },
handler: 'src/services/query/routes/assets.main',
timeout:29,
permissions: ['lambda',"dynamodb"]
})
Jonathan Chapman
02/01/2022, 5:45 PMJon Holman
02/01/2022, 7:57 PMnpx sst deploy --stage test
run in the frontend directory? Can someone point me to the code for sst deploy
?Bshr Ramadan
02/01/2022, 9:20 PMdatadog-cdk-constructs
in my stacks, and I want to update sst and cdk versions.
it seems that datadog hadn't support cdk v2 yet.
can I add @aws-cdk/core
v1 alongside with aws-cdk-lib
to my package.json, to let datadog keep working until they support v2?Jon Holman
02/01/2022, 9:57 PMSahan Amadoruge
02/02/2022, 9:58 AMauthorizationType
Optional?koukito
02/02/2022, 11:37 AMmonorepo/
services/
service1/
src/
stacks/
sst.json
package.json
service2/
src/
stacks/
sst.json
package.json
package.json
tsconfig.json
Assuming i run the service 1 which is a Rest api with lambda and api gateway using sst start
when i invoke the api from the interface i get the error in the picture below.
running these same steps when the sst service is outside the monorepo works fine.
i think it has to do with the way dependencies are hoisted by lerna. Did any one face such an issue?Bshr Ramadan
02/02/2022, 2:03 PMsst start
immediately:
Failed to fetch resources. NotFoundException: Invalid API identifier specified 702712627781:nguml3fcg8
does anyone have an idea to discover what's the cause of this error?
my sst version is 0.53.3
Tim V
02/02/2022, 3:59 PMGarret Harp
02/02/2022, 9:52 PMDavid Garcia
02/02/2022, 10:07 PMapp.logicalprefixedname('stack')
it repeats my stage and name from the sst.json
twice so like dev-test-dev-test-stack
Manoel Feliciano
02/02/2022, 10:28 PMGarret Harp
02/03/2022, 1:27 AMUncaught Exception {
"errorType":"Runtime.ImportModuleError",
"errorMessage":"
Error: Cannot find module 'create'
Require stack:
- C:\\ddd\\node_modules\\@serverless-stack\\aws-lambda-ric\\lib\\utils\\UserFunction.js
- C:\\ddd\\node_modules\\@serverless-stack\\aws-lambda-ric\\lib\\index.js
- C:\\ddd\\node_modules\\@serverless-stack\\aws-lambda-ric\\bin\\index.js"
It worked a few times but I just cannot stop getting the above error no matter what I do nowTyson
02/03/2022, 6:45 AMUnable to find function a5d4054a
It is only happening when I send requests through the frontend app that is using GraphQLCodegen to create Typescript React Hooks (https://www.graphql-code-generator.com). When I make a request using Postman everything is fine. I am hoping to gain some insight into exactly what this error means. Furthermore, the 'a5d405a' code remains the same across networks calls to different lambda resolvers. Resources: ["apollo-server-lambda": "^2.21.1", "@serverless-stack-slack/resources": "0.54.4"]Bshr Ramadan
02/03/2022, 1:13 PMApolloApi
sst construct for gateway and each service.
Can I use ec2
cdk construct to host gateway on, in other words, will it be compatible with other services which is hosted using ApolloApi
construct?Jędrzej Kuryło
02/03/2022, 2:10 PMnext dev
and next start
, but when deployed I get 503, so I guess the app returned some sort of error. I'm having trouble finding any trace of error logs in AWS... I can see 3 resources of type Custom::SSTEdgeLambda
created, my guess is that it's one of those that executes my app logic, but I don't see a corresponding log group in Cloudwatch
CREATE_COMPLETE | Custom::SSTEdgeLambda | xxxImageEdgeLambda6D1A8C9F
CREATE_COMPLETE | Custom::SSTEdgeLambda | xxxMainEdgeLambdaCD2001DA
CREATE_COMPLETE | Custom::SSTEdgeLambda | xxxApiEdgeLambda3EC77306
Any idea how to figure out why the app's failing?Devin
02/03/2022, 3:20 PM<http://dev.comicshelper.com|dev.comicshelper.com>
where if you request that URL, it goes ahead and grabs the index.html file and returns it successfully. This site happens to be written in Gatsby but that seems not relevant. Because it’s in Gatsby if you navigate around, links are hydrated and the site works as you’d expect.
If however, you navigate directly to <http://dev.comicshelper.com/blog|dev.comicshelper.com/blog>
you get a 403. Document not found. If I go into the bucket, and view it I see it
index.html
january-2022/
If I try to navigate directly to the object in the bucket via the console… I get an Access denied.
Do I have something messed up in my cloudfront configuration somewhere. What are some explanations for this document not being delivered?Paul
02/03/2022, 4:21 PMcustomDomain
. I am using the API construct and my config looks like this:
customDomain: {
hostedZone: "<http://spedifux.ch|spedifux.ch>",
domainName: "<http://api-dev.spedifux.ch|api-dev.spedifux.ch>",
path: "test",
}
Have tried to comment out and deploy, than uncomment and redeploy several times now, as I have read that this helps in some cases.
Strangely enough I can see the domain is correctly configured in API-Gateway “Custom domain names” and I see the A-Record in Route53 pointing to the correct ...execute-api.eu-central-1...
address. But I always get a “Connection refused” Error when trying to access. Any ideas?Sean Matthews
02/03/2022, 5:09 PMDavid Garcia
02/03/2022, 6:07 PMload metadata for public.ecr.aws/sam/build-python3.8:latest
I'm getting a 400 bad request. What could be causing this?Dominik Seibold
02/03/2022, 6:40 PMfunctions.jsonl
file.]
[SST-version: 0.61.0]
We are experiencing some weird behavior in the functions.jsonl file.
Functions that are created with the same custom Construct are given the same ID in the functions.jsonl
file.
When calling the function, the source code in the artifacts
is used where the ID is matched first.
Example:
We create functions in different services with the same custom CDK construct. Marked in the picture.
The ID is the same “b3f05295”. However, in the artifacts folder there is only the source code for “...services/user...” for this ID.
Expected behavior:
Each function should get a unique ID in the functions.jsonl
file. This way the same code will not be executed for each function.
Does anyone else experience this problem?William Hatch
02/03/2022, 7:03 PMAra Yeressian
02/03/2022, 7:17 PM{
"errorType": "Runtime.UnhandledPromiseRejection",
"errorMessage": "ColumnTypeUndefinedError: Column type for Job#title is not defined and cannot be guessed. Make sure you have turned on an \"emitDecoratorMetadata\": true option in tsconfig.json. Also make sure you have imported \"reflect-metadata\" on top of the main entry file in your application (before any entity imported).If you are using JavaScript instead of TypeScript you must explicitly provide a column type.",
"reason": "ColumnTypeUndefinedError: Column type for Job#title is not defined and cannot be guessed. Make sure you have turned on an \"emitDecoratorMetadata\": true option in tsconfig.json. Also make sure you have imported \"reflect-metadata\" on top of the main entry file in your application (before any entity imported).If you are using JavaScript instead of TypeScript you must explicitly provide a column type.",
"promise": {},
"stack": [
"Runtime.UnhandledPromiseRejection: ColumnTypeUndefinedError: Column type for Job#title is not defined and cannot be guessed. Make sure you have turned on an \"emitDecoratorMetadata\": true option in tsconfig.json. Also make sure you have imported \"reflect-metadata\" on top of the main entry file in your application (before any entity imported).If you are using JavaScript instead of TypeScript you must explicitly provide a column type.",
" at process.<anonymous> (file:///Users/ayeressian/personal/my-sst-app/node_modules/@serverless-stack/aws-lambda-ric/lib/index.js:34:23)",
" at process.emit (events.js:376:20)",
" at processPromiseRejections (internal/process/promises.js:245:33)",
" at processTicksAndRejections (internal/process/task_queues.js:96:32)"
]
}
Function
...
const api = new sst.Api(this, "Api", {
routes: {
"GET /": {
function: {
handler: "src/function/db.handler",
environment: {
DATABASE,
CLUSTER_ARN: cluster.clusterArn,
SECRET_ARN: cluster.secret!.secretArn,
},
bundle: {
esbuildConfig: {
plugins: "./esbuild-config.js",
},
nodeModules: ["typeorm", "typeorm-aurora-data-api-driver"],
},
permissions: [cluster],
},
},
},
});
tsconfig.json
{
"compilerOptions": {
"experimentalDecorators": true
},
"extends": "@tsconfig/node14",
"include": [
"stacks",
"src"
]
}
Any help would be appreciated.Adam Fanello
02/04/2022, 12:53 AMEmanuel Quimper
02/04/2022, 2:16 PMEmanuel Quimper
02/04/2022, 3:36 PMDerek Kershner
02/04/2022, 4:46 PMesm
?
All should be well, tree-shook, etc?