https://serverless-stack.com/ logo
Join SlackCommunities
Powered by
# help
  • a

    Artemiy Davydov

    03/15/2022, 5:16 PM
    Still, can someone tell me how to configure CORS correctly? I'm trying to make a production project using SST, but unfortunately there are no examples of full-fledged applications on GitHub
    j
    f
    • 3
    • 7
  • e

    Ernie Francis

    03/15/2022, 6:03 PM
    does seed.run support webhooks?
    f
    • 2
    • 2
  • e

    Ernie Francis

    03/15/2022, 6:03 PM
    or wrong slack channel?
    r
    • 2
    • 1
  • d

    Dan Van Brunt

    03/15/2022, 7:28 PM
    @Frank @thdxr Is this in the main release yet? https://serverless-stack.slack.com/archives/C01HQQVC8TH/p1646311028485579?thread_ts=1646235250.400579&cid=C01HQQVC8TH I don’t see
    removeOldFiles
    anywhere in the SST code when I search. Did this ever make it in?
    f
    • 2
    • 1
  • p

    Przemysław Woźniak

    03/15/2022, 9:58 PM
    Hello everyone 🙂 happy user of SST so far. With our team we do have nice API with lambdas, dynamo etc, but as every big app we are hitting the moment when we need some caching. I spend quite some time to look for anything with Elasticache (Redis), but without any luck. Do I have to just define it in CDK? Or is there any fancy way of add it to my stack in SST? 🙂
    t
    • 2
    • 1
  • p

    Przemysław Woźniak

    03/15/2022, 10:02 PM
    Forgot to mention - we did have one project built in Serverless and creating Redis instance there was quite easy, that's why I'm asking if something similar I can achieve with SST 🙂
    f
    • 2
    • 11
  • m

    Michael James Munar

    03/16/2022, 6:11 AM
    Hi, is it possible to connect 2 stages to 1 vpc and just use 1 database? EG: dev and main
    a
    • 2
    • 2
  • a

    Ahmed Moaz Asif

    03/16/2022, 8:41 AM
    Hi everyone. Can anyone please guide me whether the aws service calls get proxied from live lambda environment? Use case: My Lambda Handler has IAM permission access to a Secret stored on AWS Secret manager. Does the call to get secret work in live lambda environment?
    f
    • 2
    • 1
  • a

    Ahmed Moaz Asif

    03/16/2022, 8:45 AM
    Windows specific bug: Using Construct AppSyncApi. When running
    npm start
    on windows, everything gets build and deployed fine. However when I do a GraqhQL query, the live lambda environment crashes
    Copy code
    Unhandled Promise Rejection     {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"TypeError: Cannot read property 'filename' of undefined","reason":"TypeError: Cannot read property 'filename' of undefined","promise":{},"stack":["Runtime.UnhandledPromiseRejection: TypeError: Cannot read property 'filename' of undefined","    at process.<anonymous> (D:\\Starlight\\node_modules\\@serverless-stack\\aws-lambda-ric\\src\\index.ts:48:19)","    at process.emit (events.js:375:28)","    at processPromiseRejections (internal/process/promises.js:245:33)","    at processTicksAndRejections (internal/process/task_queues.js:96:32)"]}
    Works fine on MacOS and Linux
    f
    • 2
    • 16
  • a

    Artemiy Davydov

    03/16/2022, 11:14 AM
    It looks like SST doesn't update my lambda functions at all. Because the old headers are returned to me and the console does not show the function invocations, even when they have already occurred
    f
    • 2
    • 33
  • a

    Artemiy Davydov

    03/16/2022, 11:16 AM
    I also have one more question. Why are environment variables not working in the function? I did
    Copy code
    this.addDefaultFunctionEnv({
          FRONTEND_URL: webStatic.url,
          API_URL: api.url,
        });
    but
    const allowedOrigins = [process.env.FRONTEND_URL, "<http://localhost:3000>"];
    shows
    [ undefined, '<http://localhost:3000>' ]
    m
    f
    • 3
    • 24
  • h

    Hans Song

    03/16/2022, 11:52 AM
    hey guys, got a bug here (?), exceptions raised by subprocess calls in the site upload lambda is not handled gracefully, (i.e.
    Custom::SSTBucketDeployment
    here) this results in pretty vague messages, e.g.
    Copy code
    Custom::SSTBucketDeployment | .../ReactSite/S3Deployment/Default (ReactSiteS3Deployment...) Received response status [FAILED] from custom resource. Message returned: invalid request. Missing key 'Status'
    i had to dig through the cloudwatch logs to find this
    Copy code
    CalledProcessError: Command '['/opt/awscli/aws', 's3', 'cp', 's3:...', '/tmp/...']' returned non-zero exit status 1.
    Traceback (most recent call last):
      File "/var/task/s3-upload.py", line 29, in handler
        s3_deploy(s3_source_zip, s3_dest, file_options, replace_values)
        ...
    i had to modify the lambda a bit to log the exception to figure out what went wrong (permissions in this case)
    f
    • 2
    • 13
  • s

    Sulaiman Baig

    03/16/2022, 12:29 PM
    I was getting following error unable to install mode modules then someone guides me to drop .sst and node modules folder an reinstall it. After doing this now I am getting this error. I am trying to solve it but could not. Please guide me what I am doing wrong error code EPERM 25420 error syscall rename 25421 error path G:\serverless_stack\condofamily\node_modules\.staging\aws-cdk-lib-aafbbaf9\node_modules\case 25422 error dest G:\serverless_stack\condofamily\node_modules\.staging\case-2e912bbf 25423 error errno -4048 25424 error Error: EPERM: operation not permitted, rename 'G:\serverless_stack\condofamily\node_modules\.staging\aws-cdk-lib-aafbbaf9\node_modules\case' -> 'G:\serverless_stack\condofamily\node_modules\.staging\case-2e912bbf' 25424 error [OperationalError: EPERM: operation not permitted, rename 'G:\serverless_stack\condofamily\node_modules\.staging\aws-cdk-lib-aafbbaf9\node_modules\case' -> 'G:\serverless_stack\condofamily\node_modules\.staging\case-2e912bbf'] { 25424 error cause: [Error: EPERM: operation not permitted, rename 'G:\serverless_stack\condofamily\node_modules\.staging\aws-cdk-lib-aafbbaf9\node_modules\case' -> 'G:\serverless_stack\condofamily\node_modules\.staging\case-2e912bbf'] { 25424 error errno: -4048, 25424 error code: 'EPERM', 25424 error syscall: 'rename', 25424 error path: 'G:\\serverless_stack\\condofamily\\node_modules\\.staging\\aws-cdk-lib-aafbbaf9\\node_modules\\case', 25424 error dest: 'G:\\serverless_stack\\condofamily\\node_modules\\.staging\\case-2e912bbf' 25424 error }, 25424 error errno: -4048, 25424 error code: 'EPERM', 25424 error syscall: 'rename', 25424 error path: 'G:\\serverless_stack\\condofamily\\node_modules\\.staging\\aws-cdk-lib-aafbbaf9\\node_modules\\case', 25424 error dest: 'G:\\serverless_stack\\condofamily\\node_modules\\.staging\\case-2e912bbf', 25424 error parent: 'condofamily' 25424 error } 25425 error The operation was rejected by your operating system. 25425 error It's possible that the file was already in use (by a text editor or antivirus), 25425 error or that you lack permissions to access it. 25425 error 25425 error If you believe this might be a permissions issue, please double-check the 25425 error permissions of the file and its containing directories, or try running 25425 error the command again as root/Administrator. 25426 verbose exit [ -4048, true ]
    f
    • 2
    • 1
  • s

    satish venkatakrishnan

    03/16/2022, 1:53 PM
    I am getting the following error
    Copy code
    Failed to parse generated manifest.json [Error: ENOENT: no such file or directory, open 'C:\whatsapp\my-sst-app\.build\cdk.out\manifest.json'] {
      errno: -4058,
      code: 'ENOENT',
      syscall: 'open',
      path: 'C:\\whatsapp\\my-sst-app\\.build\\cdk.out\\manifest.json'
    }
    f
    r
    m
    • 4
    • 16
  • j

    Jeff Hanna

    03/16/2022, 1:54 PM
    hey guys, hoping someone with Aurora experience might know the answer here (not an SST issue/question) every once in a while I’m seeing 30s delays, I think caused by creating uuid-ossp extension
    Copy code
    info: ~~~creating connection ... {"timestamp":"2022-03-16 06:46:37"}
    query: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
    info: connected --- {"timestamp":"2022-03-16 06:47:07"}
    is uuid-ossp implicitly required because I have uuid types in my db? any alternative or way to avoid these delays?
    f
    • 2
    • 12
  • t

    Tim V

    03/16/2022, 2:40 PM
    I'm using Webpack with StaticSite. My environment variables seem to go missing when building... Works fine in development.
    Copy code
    const site = new StaticSite(this, "website", {
          path: "stack/website",
          buildOutput: "dist",
          buildCommand: "yarn build",
          customDomain,
          environment: {
            API_ENDPOINT: api.url,
          },
          // ...
        });
    From package.json:
    Copy code
    "scripts": {
        "start": "sst-env -- webpack serve --open",
        "build": "webpack build"
      }
    Any help or insight is welcomed.
    f
    • 2
    • 137
  • m

    Mikkel Wied Frederiksen

    03/16/2022, 4:16 PM
    Hi.. I’m updating a SST setup from 0.53 to 0.68 (working great so far). I want to utilize the new RDS console, so i’m trying to rewrite my stack to use the new RDS construct. I’m using postgres with aurora serverless. It’s really not hard to move my stack to the new RDS, but i cannot figure out how to keep the old RDS/VPC from being deleted. Is this intentional (and should I therefore do a manual migration of my data from the old db to the new) or did I miss some trick to make the transition. 🤔
    f
    • 2
    • 17
  • d

    Dan Van Brunt

    03/16/2022, 6:10 PM
    Has anyone successfully authored a NPM custom construct that uses
    sst.Function
    internally? Each time I’ve tried this I run into issues with where to store construct assets and how to reference them into
    sst.Function
    d
    f
    • 3
    • 48
  • j

    Jeff Hanna

    03/16/2022, 10:57 PM
    hopefully a quick question for the masters here 🤞 • I use Lambda Alias because I think it’s required for AutoScaling Policy • When I deploy updates, I’m getting a failure
    Copy code
    uat-polls-api-Api | UPDATE_FAILED | AWS::Lambda::Alias | LiveAliasApi372137E3F Replacement type updates not supported on stack with disable-rollback.
    First question, why is disable-rollback on? SST docs say the default is to have rollback enabled Second question, why is there a replacement type update if my code didn’t change? AWS Docs say alias is only replaced if the function name or alias name change which they are not
    f
    • 2
    • 5
  • j

    Jon Holman

    03/17/2022, 12:15 AM
    I'm trying to convert an existing CDK project to SST and I'm sure I missed something because I'm getting this:
    Copy code
    (base) jonholman@jonlaptop serverless-benchmarks % AWS_PROFILE=sso-jon-stuff npx sst start
    Using stage: dev
    Preparing your SST app
    
    =======================
     Deploying debug stack
    =======================
    
    node:internal/modules/cjs/loader:936
      throw err;
      ^
    
    Error: Cannot find module '/Users/jonholman/repos/personal/serverless-benchmarks/.build/lib'
    Require stack:
    - /Users/jonholman/repos/personal/serverless-benchmarks/node_modules/@serverless-stack/cli/assets/debug-stack/bin/index.js
        at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
        at Function.Module._load (node:internal/modules/cjs/loader:778:27)
        at Module.require (node:internal/modules/cjs/loader:1005:19)
        at require (node:internal/modules/cjs/helpers:102:18)
        at Object.<anonymous> (/Users/jonholman/repos/personal/serverless-benchmarks/node_modules/@serverless-stack/cli/assets/debug-stack/bin/index.js:28:17)
        at Module._compile (node:internal/modules/cjs/loader:1103:14)
        at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155: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:77:12) {
      code: 'MODULE_NOT_FOUND',
      requireStack: [
        '/Users/jonholman/repos/personal/serverless-benchmarks/node_modules/@serverless-stack/cli/assets/debug-stack/bin/index.js'
      ]
    }
    Subprocess exited with error 1
    There was an error synthesizing your app.
    any ideas?
    f
    • 2
    • 23
  • s

    Sulaiman Baig

    03/17/2022, 1:53 AM
    In the brand new sst app I am getting the following error. I don't know what is wrong with OS. In my client project, I was getting some permission issues but I have admin rights so I tried a new sst app but it is not working. TypeError: Cannot read property 'time' of undefined at Runtime.handler (G\my sst new app\.sst\artifacts\dev my sst new app my stack Api Lambda GET \src\lambda.js29:78) at Runtime.handleOnce (file///G/my-sst-new-app/node_modules/@serverless-stack/aws-lambda-ric/lib/Runtime/Runtime.js5333) at processTicksAndRejections (internal/process/task_queues.js955)
    f
    • 2
    • 5
  • m

    Michael James Munar

    03/17/2022, 1:58 AM
    Hi in the postgres example, if I understand it correctly this deploys a new database per stage right?
    Copy code
    const cluster = new rds.ServerlessCluster(this, "CounterDBCluster", {
          vpc,
          defaultDatabaseName,
          // Set the engine to Postgres
          engine: rds.DatabaseClusterEngine.AURORA_POSTGRESQL,
          parameterGroup: rds.ParameterGroup.fromParameterGroupName(
            this,
            "ParameterGroup",
            "default.aurora-postgresql10"
          ),
          // Optional, disable the instance from pausing after 5 minutes
          scaling: { autoPause: cdk.Duration.seconds(0) },
        });
    What I've been trying to do is create 2 database outside, prod and dev and I've been trying to import it. I've done
    Copy code
    const vpc = ec2.Vpc.fromLookup(this, "VPC", {
         vpcId: "vpc-xxxxxxx",
        });
    
    and 
    
    rds.DatabaseInstance.fromDatabaseInstanceAttributes
    
    as well as 
    
     rds.DatabaseCluster.fromClusterAttributes
    I couldn't seem to make anything work
    f
    • 2
    • 9
  • h

    Hans Song

    03/17/2022, 3:54 AM
    hey guys, just a suggestion, i tried pushing a branch to make a PR but i got a 403 😞 currently the
    sst cdk
    command does not return the status code for failures
    f
    • 2
    • 10
  • m

    Michael James Munar

    03/17/2022, 8:44 AM
    I followed the Postgres rds sample. That worked fine for me. But when I imported my own schema + tables. I keep getting
    BadRequestException: ERROR: relation "schema.table" does not exist
    Even though it's clearly here
    m
    f
    • 3
    • 7
  • m

    Muhammad Ahsan Khan

    03/17/2022, 9:36 AM
    Copy code
    Unhandled Promise Rejection     {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"TypeError: Cannot read property 'filename' of undefined","reason":"TypeError: Cannot read property 'filename' of undefined","promise":{},"stack":["Runtime.UnhandledPromiseRejection: TypeError: Cannot read property 'filename' of undefined","    at process.<anonymous> (file:///D:/Starlight/node_modules/@serverless-stack/aws-lambda-ric/lib/index.js:34:23)","    at process.emit (events.js:400:28)","    at processPromiseRejections (internal/process/promises.js:245:33)","    at processTicksAndRejections (internal/process/task_queues.js:96:32)"]}
    I am getting this error using appsync construct and its related to datasource of handler on windows kindly help me in resolving this
    f
    d
    +2
    • 5
    • 24
  • e

    Erik Robertson

    03/17/2022, 11:28 AM
    Hello all. I updated SST to 0.69 along with all my other packages. Everything was working well until then. I'm running into this erorr upon sst start :
    current credentials could not be used to assume 'arn:aws:iam::055101007100:role/cdk-hnb659fds-deploy-role-XXX-us-west-2', but are for the right account. Proceeding anyway.
    ❌  DEV-ERIK-dwam-back-debug-stack failed: Error: DEV-ERIK-dwam-back-debug-stack: User: arn:aws:iam::XXX:user/dev_admin is not authorized to perform: ssm:GetParameter on resource: arn:aws:ssm:us-west-2:XXX:parameter/cdk-bootstrap/hnb659fds/version because no identity-based policy allows the ssm:GetParameter action
    I am already passing a --role-arn parameter to sst start which has that ssm permission and it worked well using that role to build the debug stack but it's apparently not using it for deploying. Based on the first line I have also tried to give the iam:passRole also to that CDK role but that didn't change anything either... Any help is appreciated.
    f
    • 2
    • 10
  • s

    Sean Matheson

    03/17/2022, 4:00 PM
    Howdy ya'll. I'm experimenting with adding some unit tests against my infra. I already had jest configured at the root of our monorepo which includes SST infra. I've noted that when I add tests against my stacks the actual build process for lambdas/static sites actually kicks off. Is there a way to avoid this, a shallow render of sort.
    t
    • 2
    • 8
  • s

    Steven Klaiber-Noble

    03/17/2022, 8:00 PM
    Hi, is there any guidance on setting up esbuild with a sst site such that sourcemaps properly work? We're using esbuild-jest and currently all our line numbers in our stack trace is a few lines off.
    t
    f
    o
    • 4
    • 13
  • a

    Artemiy Davydov

    03/18/2022, 7:53 AM
    @Frank https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html Write about it somewhere. It turns out the headers won't be updated for 5 minutes by default
    f
    g
    • 3
    • 2
  • a

    Artemiy Davydov

    03/18/2022, 8:04 AM
    Now I have a new CORS error
    PreflightWildcardOriginNotAllowed
    I need to set the exact origin for preflight too. I can get the
    WebStatic
    URL if I create it before the REST API, but then how do I pass the API URL to the frontend?
    f
    • 2
    • 27
1...585960...83Latest