José Ribeiro
05/26/2021, 9:44 PMJosé Ribeiro
05/27/2021, 2:53 PMJosé Ribeiro
05/27/2021, 6:59 PMNo Lambda handlers are found in the app
when deploying my stack. Could this be caused by my creating an SNS topic that doesn’t have any (function) subscribers, only a SQS topic?José Ribeiro
05/27/2021, 7:29 PMnpx create-serverless-stack@latest my-sst-app --language python
steve gates
05/27/2021, 11:50 PMserverless deploy -v
-- it returned the following error:
Invalid variable reference syntax for variable AWS::Region. You can only reference env vars, options, & files. You can check our docs for more info.
It seems that the variables in resources/cognito-policy.yml are not being passed properly. Anything I should do to fix it?Kevin Lam
05/28/2021, 1:36 AMJosé Ribeiro
05/28/2021, 12:48 PMtest("Test Stack", () => {
const app = new <http://sst.App|sst.App>();
const stack = new PeopleEnrichmentStack(app, "test-stack");
expect(stack).to(haveResource("AWS::SQS"));
});
, but I’m getting
Cannot find a handler file at src/people_data_enrichment/handlers/people_data_enricher.js".
which seems to be related to the test expecting a .js
file when it really should be .py
since I’m using python. Any thoughts?Sobhan Jachuck
05/28/2021, 6:29 PMUncharted
05/29/2021, 4:19 PMapplicationCode: fs.readFileSync(
path.join(__dirname, '.', '<myfile>.sql'),
'utf8'
)
I read there was a copyFiles available for Function but how to do it without Function ?Mr.9715
05/29/2021, 4:36 PMaddGlobalSecondaryIndex()
returns void and the table doesn't have it either.)yoges nsamy
05/30/2021, 4:57 AMIamRoleLambdaExecution: Syntax error in policy
encountered while deploying a lambda function to AWS.
(Additional info is added in the thread)
serverless.yml:
service: xxx-chat-api
provider:
name: aws
stackTags:
Team: Chat
runtime: go1.x
stage: ${opt:stage, 'dev'}
region: ap-southeast-1
timeout: 200
environment: ${file(env.yml)}
iamRoleStatements:
- ${file(models/chat.yml):consumerCognitoStatement}
- ${file(models/chat.yml):userCognitoStatement}
- ${file(models/chat.yml):adminTablePolicyStatement}
- ${file(models/chat.yml):sesStatement}
:
:
:
models/chat.yml:
consumerCognitoStatement:
Effect: "Allow"
Action:
- "cognito-idp:ListUsers"
- "lambda:InvokeFunction"
Resource:
- "${file(env.${self:provider.stage}.yml):COMPANY_COGNITO_RESOURCE_ARNS}"
- !Sub "arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:xxx-cognito-auth-api-${self:provider.stage}-cogtoken"
userCognitoStatement:
Effect: "Allow"
Action:
- "cognito-idp:ListUsers"
- "lambda:InvokeFunction"
Resource: "${file(env.${self:provider.stage}.yml):USER_COGNITO_RESOURCE_ARNS}"
sesStatement:
Effect: Allow
Action:
- ses:SendEmail
- ses:SendRawEmail
Resource: "arn:aws:ses:eu-west-1:${AWS::AccountId}:identity/noreply@xxx.my"
COMPANY_COGNITO_RESOURCE_ARNS
has multiple values:
COMPANY_COGNITO_RESOURCE_ARNS:
# CO_1
- "arn:aws:cognito-idp:ap-southeast-1:xxx:userpool/ap-southeast-1_abc"
# CO_2
- "arn:aws:cognito-idp:ap-southeast-1:xxx:userpool/ap-southeast-1_xyz"
# CO_3
- "arn:aws:cognito-idp:ap-southeast-1:xxx:userpool/ap-southeast-1_jkl"
USER_COGNITO_RESOURCE_ARNS
has a single value:
USER_COGNITO_RESOURCE_ARNS:
# Secure:
- "arn:aws:cognito-idp:ap-southeast-1:xxx:userpool/ap-southeast-1_def"
Error: IamRoleLambdaExecution: Syntax error in policy
Artem Kalantai
05/31/2021, 8:25 AM{
"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module 'punycode/'\nRequire stack:\n- /var/task/googleDriveToS3.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js",
"stack": [
"Runtime.ImportModuleError: Error: Cannot find module 'punycode/'",
"Require stack:",
"- /var/task/googleDriveToS3.js",
"- /var/runtime/UserFunction.js",
"- /var/runtime/index.js",
" at _loadUserApp (/var/runtime/UserFunction.js:100:13)",
" at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)",
" at Object.<anonymous> (/var/runtime/index.js:43:30)",
" at Module._compile (internal/modules/cjs/loader.js:999:30)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)",
" at Module.load (internal/modules/cjs/loader.js:863:32)",
" at Function.Module._load (internal/modules/cjs/loader.js:708:14)",
" at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)",
" at internal/main/run_main_module.js:17:47"
]
}
[10:02 AM] it was working as usual, but at some point I started to have this error, when I use it through my machine - everything ok, previously I had the same issue and only what helped is remove all stack and create from scratch, but I can’t do it on prod
Artem Kalantai [10:59 AM]
nothing help…..Mr.9715
05/31/2021, 11:55 AMsst.Auth
construct, here are my questions:
• customAttributes: {
company: new StringAttribute({ minLen: 1, maxLen: 255 }),
type: new StringAttribute({ maxLen: 2048 }),
custom1: new StringAttribute({ maxLen: 2048 }),
custom2: new StringAttribute({ maxLen: 2048 }),
},
• How do I pass google client ID and secret to the user pool for using Google as UserPoolIdentityProvider?
• Add a Amazon Cognito domain
to the user pool.Pranav Tadikonda
05/31/2021, 3:29 PMAshishkumar Pandey
06/01/2021, 12:40 AMAndy Averbuch
06/01/2021, 4:27 AMJosé Ribeiro
06/01/2021, 1:08 PMconst api = new sst.Api(this, "Api", {
routes: {
"POST /": {
function: {
srcPath: "src",
handler: "people_data_enrichment/handlers/sns_publisher.handler",
runtime: "python3.8",
environment: {
USER_EVENTS_TOPIC_ARN: topic.topicArn,
},
permissions: [topic],
},
},
},
});
however, in AWS the handler is defined simply as sns_publisher.handler
. If I change the handler to people_data_enrichment.handlers.sns_publisher.handler
then I get the normal behavior again. Otherwise, I get a Unable to import module 'sns_publisher'
Mr.9715
06/01/2021, 2:02 PMcontext.done(null, event);
. on another lambda which I am running locally, I am trying to call signup. the trigger executes successfully but Cognito is throwing an error. (if I remove the trigger, everything works fine)Ashishkumar Pandey
06/01/2021, 2:13 PMAshishkumar Pandey
06/01/2021, 2:18 PMCharles Zhang
06/02/2021, 6:52 AMsrc
folder simply, it will be missing in the final lambda folder. Every know how to solve this problem??Mr.9715
06/02/2021, 1:13 PMMr.9715
06/03/2021, 4:46 AMsst.Api
?
I am trying to find apigateway.Model
and apigateway.RequestValidator
, for my POST-APIs.Louis Barclay
06/03/2021, 2:52 PMAccessDeniedException: User: arn:aws:sts::XXXXXX/dev-my-sst-app-my-stack-ApiLambdaPOSTcreateService-XXXXXX/dev-my-sst-app-my-stack-ApiLambdaPOSTcreateXXXXX is not authorized to perform: acm:RequestCertificate
Any help gratefully appreciated!Louis Barclay
06/03/2021, 3:50 PMsst
to invoke itself after a [2] second time out? It needs to know the endpoint it's at so it can call that endpoint. I guess I can get this through some context-like object, just not sure where to access that.Frank
.build/sst-debug.log
?Andy Averbuch
06/04/2021, 1:32 AMArtem Kalantai
06/04/2021, 11:00 AM{
"errorType": "Error",
"errorMessage": "Cannot find module '/var/task/puppeteer/lib/Browser'\nRequire stack:\n- /var/task/credentialsApi.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js",
"code": "MODULE_NOT_FOUND",
"requireStack": [
"/var/task/credentialsApi.js",
"/var/runtime/UserFunction.js",
"/var/runtime/index.js"
],
"stack": [
"Error: Cannot find module '/var/task/puppeteer/lib/Browser'",
"Require stack:",
"- /var/task/credentialsApi.js",
"- /var/runtime/UserFunction.js",
"- /var/runtime/index.js",
" at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)",
" at Function.Module._load (internal/modules/cjs/loader.js:667:27)",
" at Module.require (internal/modules/cjs/loader.js:887:19)",
" at require (internal/modules/cjs/helpers.js:74:18)",
" at Function.get puppeteer [as puppeteer] (/node_modules/chrome-aws-lambda/source/index.ts:213:7)",
" at Runtime.createCredentials [as handler] (/src/credentials/credentialsApi.ts:75:34)",
" at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"
]
}
José Ribeiro
06/04/2021, 6:50 PM[50%] fail: No bucket named 'cdk-hnb659fds-assets-**-us-east-2'. Is account ** bootstrapped?
after nuking all the resources in my account and running sst start
. After getting this error, I tried running cdk bootstrap
and that worked just fine, but then running `sst start`would give the same error. Any idea of what could be going on here?José Ribeiro
06/04/2021, 7:19 PMcryptography
package in github ci