Aso Sun
09/01/2021, 5:21 PMApiEndpoint: https://*****.execute-api.ap-****.<http://amazonaws.com/|amazonaws.com/>*prod*/
.
However, when I was checking the lambda function API gateway triggers overview via console, the API endpoint became: https://*****.execute-api.ap-****.<http://amazonaws.com/|amazonaws.com/>*test-invoke-stage*/
.
Also I got 403 response when accessing from browser:
{
"message": "User: arn:aws:sts::assumed-role/**** is not authorized to perform: execute-api:Invoke on resource: ****/****/prod/**** "
}
Is this due to IAM policy issue? How can I make the lamdba function API gateway trigger path to be /prod/
instead of test-invoke-stage
?Aram
09/02/2021, 8:46 AMCarlos Ribeiro
09/02/2021, 1:50 PMAram
09/02/2021, 2:16 PMnew Topic(this, 'Topic', {
subscribers: [networkHandleTicker],
snsTopic: sns.Topic.fromTopicArn(this, 'TickPerSecondTopic', 'arn:aws:sns:us-east-2:xxxxxxxxxxxx:shared-sharedSubminute-tickPerSecondTopic'),
});
but I'm getting an error telling me NetworkHandleTickerTickPerSecondTopicDA486C85 Topic does not exist (Service: AmazonSNS; Status Code: 404; Error Code: NotFound; Request ID: 3e76aefd-c5d9-5d10-8335-f75719c5fde6; Proxy: null)
I can confirm that the topic is thereDan Van Brunt
09/02/2021, 6:58 PMGeorge Evans
09/03/2021, 10:07 AMPhil Astle
09/03/2021, 10:24 AMexport abstract class WebSocketClient {
private static _websocket: WebSocket;
public static Send(data: { message_kind: E_MessageKind, message_content: any}) {
console.log(JSON.stringify(process.env.WEB_SOCKET_URL), "WEB SOCKET URL");
try {
WebSocketClient._websocket = new WebSocket(process.env.WEB_SOCKET_URL || "");
WebSocketClient._websocket.onopen = () => {
console.log("WS OPEN");
WebSocketClient._websocket.send(JSON.stringify(data));
}
WebSocketClient._websocket.onclose = () => console.log("WS CLOSE");
WebSocketClient._websocket.onerror = () => console.log("WS ERROR");
WebSocketClient._websocket.onmessage = () => console.log("WS MESSAGE");
} catch (err) {
console.error(err);
throw err;
}
}
}
None of the console.logs ever get triggered and there's no exception thrown. There's also no console.log fired from my websocket stack when this call is made, though it is from an angular app and from wscat. Anyone got any ideas how to fix it? I've got no error to dig into so I'm getting close to hitting a dead end...Fazi
09/03/2021, 11:53 AMPreparing your SST app
Detected tsconfig.json
Transpiling source
There was a problem transpiling the source.
It appears this is caused by the following error handling in the SST code:
try {
const result = await esbuild.build(esbuildOptions);
require('fs').writeFileSync(metafile, JSON.stringify(result.metafile))
} catch (e) {
// Not printing to screen because we are letting esbuild print
// the error directly
logger.debug(e);
throw new Error("There was a problem transpiling the source.");
}
Anyone got any ideas as to why this is happening?
I am trying to start SST from inside a docker container.Sam Hulick
09/03/2021, 5:46 PM❌ prod-microservices-api-reels failed: Export prod-microservices-api-reels:ExportsOutputRefRouteGETprivatereelsreelIdHttpIntegration860f00925152f0afcca0fe4a6d60923aEAD0C534B4770FD9 cannot be deleted as it is in use by prod-microservices-api-public
when I make certain changes (usually deletions) to parts of a stack where one depends on another, this happens. and this time it’s not clear to me how to fix it.. not sure what value to export from api-reels
Jacob Hayes
09/03/2021, 7:10 PMnpm ls -prod -json -depth=1 failed with code 1
It happens intermittently and redeploying always seems to fix it. Anyone else run into this or have thoughts?Abdul Taleb
09/04/2021, 12:15 AMAram
09/04/2021, 8:50 PMreservedConcurrentExecutions
on it. When I try to redeploy it throws an error like this edge-sst-mindful-messaging-stack | CREATE_FAILED | AWS::Lambda::Version | MessagePullerCurrentVersionF74C4E4D82a6baf6afb38c37b61b1594580ea007 A version for this Lambda function exists ( 34 ). Modify the function to create a new version.
Do I have to remove the whole stack and redeploy for this change or there is a better way to do that?Aaron McCloud
09/05/2021, 1:07 AMPavan Kumar
09/06/2021, 2:55 AMAbdul Taleb
09/06/2021, 4:37 PMAbdul Taleb
09/06/2021, 7:51 PMstage
such as dev
staging
and prod
from being used or changed by a developer besides separate aws accounts?Abdul Taleb
09/06/2021, 9:00 PMKyle Boucher
09/06/2021, 10:40 PMAWS::Lambda::Permission
that are created?
Looks like every route method (PUT, POST, GET, DELETE) has it's own Permission created.Sam Hulick
09/07/2021, 1:36 AM"AWS CRT binary not present in any of the following locations:\n\t/bin/native/aws-crt-nodejs\n\t/bin/linux-x64/aws-crt-nodejs"
it’s from invoking a Lambda functionKyle Boucher
09/07/2021, 7:20 AMhandler.py
and service.py
The handler.py
imports the service.py
as normal (import service
) so that it can delegate the work off to that service.
The issue is that when running with npx sst start
and in the aws console they both error with "ModuleNotFoundError: No module named 'service'",
I made a test to replicate the issue from SST code:
new sst.Function(this, "testFunc", {
handler: "services/test/handler.process_job",
srcPath: "src",
layers: [dbDriverLayer],
role: functionRole,
tracing: Tracing.ACTIVE
});
However, if I create a function within aws or upload my own package not through sst, the exact same code works fine (see attached image).
Any ideas on what SST is doing differently to package and deploy lambdas that would break the python imports?Brinsley
09/07/2021, 11:34 AMKelly Davis
09/07/2021, 4:19 PMPreparing your SST app
Transpiling source
Synthesizing CDK
Building Lambda function ../../mygoapp/lambdas/mylambda
go: cannot find main module, but found .git/config in /Users/me/projects/myproject
to create a module there, run:
cd ../.. && go mod init
Currently I am trying for something like this:
/mygoapp
/mygoapp/go.mod
/mygoapp/go.sum
/mygoapp/lambdas
/mygoapp/lambdas/mylambda
/cdk/mystack
/cdk/mystack/lib/ <- stack code
/cdk/mystack/package.json
/cdk/mystack/sst.json
If I move everything in /cdk/mystack
under /mygoapp
, everything seems to work, but I'd like to keep the cdk code separateOlivers
09/07/2021, 7:43 PMAccessDeniedException: User:arn:aws:sts::xxx... is not authorized to perform: cognito-idp:ListUsers on resource....
This is my stack code:
// Create a HTTP API
const api = new sst.Api(this, "Api", {
defaultAuthorizationType: sst.ApiAuthorizationType.AWS_IAM,
routes: {
"GET /private": "src/private.handler",
"GET /health": {
function: "src/health.handler",
authorizationType: sst.ApiAuthorizationType.NONE,
},
},
});
const auth = new sst.Auth(this, "Auth", {
cognito: {
userPool: {
signInAliases: { email: true, phone: true },
signInCaseSensitive: false,
},
},
});
auth.attachPermissionsForAuthUsers([
api,
new iam.PolicyStatement({
actions: ["cognito-idp:ListUsers"],
effect: iam.Effect.ALLOW,
resources: ["arn:aws:cognito-idp:xxx"],
}),
]);
I don't now if I'm attaching the permission in the correct place or I'm missing something elseSam Frampton
09/07/2021, 7:58 PMAbdul Taleb
09/07/2021, 9:57 PMconst files = new sst.Bucket(this, 'files', {
s3Bucket: {
autoDeleteObjects: false,
removalPolicy: RemovalPolicy.RETAIN,
publicReadAccess: false,
enforceSSL: true,
blockPublicAccess: {
blockPublicAcls: false,
blockPublicPolicy: false,
ignorePublicAcls: false,
}
},
});
const api = new sst.ApolloApi(this, 'Api', { ...settings });
files.s3Bucket.addCorsRule({
allowedMethods: [
"GET",
"PUT",
"POST",
"HEAD",
"DELETE"
],
allowedOrigins: ['*'],
allowedHeaders: ['*'],
exposedHeaders: [
"x-amz-server-side-encryption",
"x-amz-request-id",
"x-amz-id-2"
],
maxAge: 3000,
})
api.setPermissions([....something goes here...]) // ????
Fadi saadeldin
09/08/2021, 4:54 AMUnrecognizedClientException: The security token included in the request is not valid
, i can do that in terminal bit not in lambda.Jack G
09/08/2021, 9:31 AMsetIsAuthenticating(false)
line in the onLoad
function) and for the life of me cannot work out why, i'm not sure if I need to do some clean up in the useEffect
hook?Jacob Hayes
09/08/2021, 3:46 PMserverless-bundle
and switching to Yarn/Lerna to support the lerna algo for incremental deploys our build/deploy time has gone up a ton in Seed. It’s not just that we have more services deploying, it seems like like our build time is taking longer. I assume it’s due to webpack bundling. Is there a way to quicken this up via some of the webpack configs?Sam Hulick
09/08/2021, 8:09 PMd600c023-bcd1-4f30-99a9-bc75cd41b512-1631131594863 Failed to send response because the Lambda function is disconnected
Abdul Taleb
09/08/2021, 11:55 PM