https://serverless-stack.com/ logo
Join SlackCommunities
Powered by
# random
  • s

    Sam Hulick

    01/19/2022, 4:15 PM
    I just got off a support chat with AWS, and they seemed to imply that a user could log into the AWS Console using an IAM role (not an IAM user). I don’t see how that’s possible though. anyone know?
    o
    j
    • 3
    • 2
  • s

    Sam Hulick

    01/20/2022, 6:52 PM
    anyone know how to get AWS SSO to not timeout my auth every 30 mins?
    t
    • 2
    • 8
  • a

    Adam Fanello

    01/21/2022, 12:34 AM
    Don't like the new CDK v2 way of importing. IDE can't resolve for me. Everything is longer. 😞
    Copy code
    import { cloudformation_include as cloudformation, aws_iam as iam, aws_s3 as s3, RemovalPolicy } from "aws-cdk-lib";
    m
    t
    • 3
    • 13
  • t

    thdxr

    01/21/2022, 3:24 AM
    What would you guys think of an entirely functional api to create stacks:
    Copy code
    export async function TableStack(props) {
      const table = new sst.Table(props.stack, ...);
    
      return { table };
    }
    
    export async function StackB(props) {
      const { table } = use(TableStack);
      new sst.Function(props.stack, { environment:  { MYTABLE: table } })
    }
    It would be totally typesafe + support async functions
    s
    g
    +6
    • 9
    • 58
  • t

    thdxr

    01/21/2022, 7:45 PM
    What would you guys think of SST stepped a bit more towards offering a backend framework. Nothing crazy and it would be totally modular but basically providing more application level structure instead of just being on the infrastructure side? Is this useful or are you here because you specifically want to handroll everything in the application?
    d
    r
    +3
    • 6
    • 23
  • g

    Garret Harp

    01/22/2022, 8:31 PM
    Just curious anyone who uses DynamoDB & does aggregations how do you handle idempotency specifically at high velocity writes. At high speeds updating the same item for aggregation causes a lot of transaction conflicts because Dynamo does not allow 2 transactions to update the same attribute even if you are not doing any condition checking on the update.
    o
    s
    • 3
    • 5
  • s

    Sam Hulick

    01/24/2022, 3:22 AM
    ok, I feel like I’m losing my mind 😐 does anyone know why a call to
    sfn.StartExecution
    would do absolutely nothing? not even throw an error?
    Copy code
    try {
            console.log('Starting execution:', JSON.stringify(startExecParams));
            const res = await sfn.send(new StartExecutionCommand(startExecParams));
            console.log('execution result:', JSON.stringify(res));
          } catch (e) {
            console.error('y tho?', e);
          }
    one Lambda function calls the function that performs the above code, and it works with no problem. but another Lambda calls the same function and I see “Starting execution” in CloudWatch Logs and that’s it. no error, no “execution result”. I don’t get it. EDIT: forgot an
    await
    🤦‍♂️
    t
    s
    • 3
    • 8
  • r

    Ross Coundon

    01/25/2022, 3:37 PM
    With DynamoDB, say a write takes 1ms then for that period another write with the same key can't happen, so if a second write comes along one microsecond after the first, what happens? Are they serialised up? Or does the second bomb out? The specific reason for asking is this - when performing an updateItem with an ADD action to, say, increment a count attribute, if multiple were executed concurrently would all the updates (including the maths) get carried out sequentially, resulting in the correct final count? Or could the maths get carried out in parallel, so for example if the count started out a 9, could two concurrent calls to increment it result in 10 (because both calls did the sum on the same starting value).
    g
    • 2
    • 1
  • j

    Jay

    01/25/2022, 7:18 PM
    Their approach to testing https://www.serverless.com/cloud/docs/workflows/testing
    s
    j
    • 3
    • 4
  • g

    Garret Harp

    01/26/2022, 12:33 AM
    How do you guys handle running data migrations with dynamo?
    o
    f
    • 3
    • 3
  • m

    manitej

    01/26/2022, 11:17 AM
    "Nhost v2 - The beginning of something big" https://www.nhost.io/blog/nhost-v2-the-beginning-of-something-big
    a
    j
    • 3
    • 3
  • t

    thdxr

    01/26/2022, 10:47 PM
    If anyone wants to try the functional stack approach you can paste this code in your application
    Copy code
    import * as sst from "@serverless-stack/resources"
    
    export type FunctionalStackProps = {
      app: <http://sst.App|sst.App>
      stack: sst.Stack
    }
    
    export type FunctionalStack<T> = (props: FunctionalStackProps) => T
    
    let currentApp: <http://sst.App|sst.App> | undefined = undefined
    const cache: Record<string, any> = {}
    
    class EmptyStack extends sst.Stack {
      constructor(scope: <http://sst.App|sst.App>, id: string) {
        super(scope, id)
      }
    }
    
    export function createStacks(app: <http://sst.App|sst.App>, ...fns: FunctionalStack<any>[]) {
      currentApp = app
      for (const fn of fns) {
        const name = fn.name.toLowerCase()
        const exists = cache[name]
        if (exists) continue
        const stack = new EmptyStack(app, name)
        const result = fn({
          app,
          stack,
        })
        console.log(`Synthesized stack ${name}`)
        cache[name] = result
      }
    }
    
    export function defineStack<T>(cb: FunctionalStack<T>) {
      return cb
    }
    
    export function use<T>(stack: FunctionalStack<T>): T {
      if (!currentApp) throw new Error("No app is set")
      const name = stack.name.toLowerCase()
      const exists = cache[name]
      if (exists) return exists
      createStacks(currentApp, stack)
      return use(stack)
    }
    Can define stacks like this
    Copy code
    export function Solid(props: FunctionalStackProps) {
      const api = use(Api)
    
      new StaticSite(props.stack, "web", {
        path: "solid/app",
        buildCommand: "yarn run build",
        environment: {
          VITE_GRAPHQL_ENDPOINT: api.graphql.url,
        },
      })
    }
    And in your main make sure you load at least one stack with
    createStacks(app, MyStack)
    - it'll use dependency injection to load all the ones MyStack depends on
    c
    • 2
    • 2
  • d

    Devin

    01/27/2022, 4:02 PM
    Does anyone know how to make an embedded snippet of Javascript for other peoples websites?
    Copy code
    <scripts src="my-cool-embed.bundled.js"></script>
    Is that just some kind of minified JS that’s stored in an s3 bucket and the access is by… I guess URL? I don’t really understand the architecture of how something like that would work.
    t
    d
    • 3
    • 6
  • s

    Sam Hulick

    01/27/2022, 5:36 PM
    for anyone who uses VS Code: how the heck do I disable auto open quotes when editing HTML? it’s driving me insane 🤪 it suddenly turned on out of nowhere. I can’t find the appropriate setting
    d
    c
    • 3
    • 23
  • d

    Daniel Gato

    01/28/2022, 10:50 PM
    Random question: Our analytics collect endpoint is using an API to retrieve IP information (country, state, city). We pay for each request on that service. Generally a normal session will trigger about 5ish events. I’m thinking about some in memory database to store that IP payload for the next hour. What AWS serverless product would you use for that?
    s
    f
    r
    • 4
    • 6
  • g

    Garret Harp

    01/31/2022, 2:21 AM
    Talked about this a long time ago but finally got around to making an open source version of creating Algolia indexes from the CDK if anyone is interested. CDK Version 1: https://www.npmjs.com/package/@garretcharp/cdk-constructs-algolia CDK Version 2: https://www.npmjs.com/package/@garretcharp/cdk-constructs-algolia-v2 Usage:
    Copy code
    import { AlgoliaIndex } from '@garretcharp/cdk-constructs-algolia-v2'
    import { SecretValue } from 'aws-cdk-lib'
    
    const MyIndex = new AlgoliaIndex(this, 'MyIndex', {
    	indexName: `${this.stage}-my-index`,
    	// See: <https://www.algolia.com/doc/api-reference/settings-api-parameters>
    	settings: {
    		searchableAttributes: ['name']
    	},
    	apiKey: SecretValue.plainText('my-algolia-api-key'),
    	appId: 'my-algolia-app-id'
    })
    If you run into any issues let me know 🙂 Source code: https://github.com/garretcharp/cdk-constructs
    a
    • 2
    • 1
  • d

    Dillon Peterson

    01/31/2022, 4:05 PM
    Howdy y'all, it's Dillon, the founder of NotionMail. We launched on Product Hunt today (https://www.producthunt.com/posts/notionmail), something we’ve put a lot of care into. ✉️ NotionMail was built 100% with SST 😊 NotionMail will send your Notion pages as HTML emails, right to your recipient’s inboxes. You can make your email right inside of a Notion page, and grab that URL to send to a mailing list you already have setup in a database, or use a simple comma separated list. Best part? There’s no limit on how many emails you can send on NotionMail. Check it out! Product Hunt NotionMail - Send Notion pages as HTML emails | Product Hunt Send Notion pages as Emails ✉️ ⚡&nbsp;Build your email in Notion with blocks you know 🛠️&nbsp;Automate with tools like Chilipepper to send emails from form responses 💰&nbsp;Save over 70% when compared to ConvertKit based on 3K subscribers https://www.producthunt.com/posts/notionmail
    s
    t
    j
    • 4
    • 6
  • s

    Sam Hulick

    01/31/2022, 8:25 PM
    hey all, what’s the easiest way to send an alert (of some kind) that a long-running process is complete? like if a user makes an API call, it returns with a 202 (async process). the process completes, and it should somehow let the user know, like via email. is EventBridge the way to go? (one Lambda alerting another one)
    j
    j
    • 3
    • 5
  • j

    Jon Holman

    02/02/2022, 5:11 PM
    Looks like SST may get some love in Corey Quinn's newsletter https://lastweekinaws.slack.com/archives/C02NS8ADMU1/p1643821438916479
    t
    a
    t
    • 4
    • 7
  • j

    justindra

    02/03/2022, 4:32 PM
    The SST Team is doing too many updates! 😛 My side project work consists of just upgrading every time as I don't spend much time on it. But yea, nah, it's been amazing actually! I don't see too many projects with a solid amount of improvements like this! 🙂
    t
    • 2
    • 1
  • t

    thdxr

    02/04/2022, 12:41 PM
    It's messed up they didn't shout us out in their earnings report
    r
    j
    o
    • 4
    • 3
  • d

    Devin

    02/10/2022, 12:33 AM
    https://github.com/florianwiech/remix-aws-cdk-example
    m
    • 2
    • 1
  • f

    Frank

    02/11/2022, 10:15 PM
    Always a headache every time I get an email from AWS
    c
    • 2
    • 2
  • t

    thdxr

    02/13/2022, 10:47 PM
    I have a lambda function with a graphql server that processes in ~ 1-2ms. If I randomly throw an error in it the response time goes up to to ~150ms. I suspect the amount of delay is correlated with sourcemap size. I believe inspecting or traversing the error as graphql does to generate messages is causing this but need to confirm So now I'm back to recommending disabling --enable-source-maps in production unless you have benchmarked it with exceptions being thrown
    m
    g
    • 3
    • 11
  • d

    Damjan

    02/14/2022, 8:46 AM
    @thdxr any other land mines when using graphql with lambda? Do you use AppSync?
    t
    • 2
    • 2
  • s

    Sam Hulick

    02/15/2022, 1:50 AM
    hey all! I’ve got an architectural conundrum that i’m trying to figure out, and I’m pretty stuck. here’s the deal: our setup is pretty typical: a primary AWS account running the production SST stack + front end, and multiple AWS sub-accounts for developers with their own SST stacks (but no front end). when someone opens a PR for the front end, AWS Amplify Console deploys a preview branch (e.g.
    <http://pr-131.reelcrafter.com|pr-131.reelcrafter.com>
    ) so we can look at it & test things out. the problem is, ALL front end deployment happens in the production account, and is tied to the GitHub repo. I’m trying to figure out a way for a dev to open a PR, and somehow point that preview instance of the front end to their SST dev stack in their AWS account
    o
    a
    • 3
    • 5
  • j

    Jacoby

    02/15/2022, 12:53 PM
    Random pro tip:
    UpdateUserPool
    updates all user pool props not specified in the request back to their default values. Learned the hard way.
    j
    a
    • 3
    • 2
  • a

    Ashishkumar Pandey

    02/16/2022, 12:23 AM
    Was there a specific reason to remove the default stage key from
    sst.json
    ?
    t
    f
    • 3
    • 4
  • a

    Ashishkumar Pandey

    02/16/2022, 1:51 AM
    new record for an authentication mandatory API - 1884 req/s. This is crazy damn it. 😂
    a
    • 2
    • 5
  • r

    Ross Coundon

    02/16/2022, 10:39 AM
    We’re implementing a webhook from a 3rd party system and I’d like to be able to inspect the header of the request to check for the existence certain headers and their values. I had planned to do this in a lambda authorizer but what I’ve found is that, if the Authorization header is not present, API Gateway rejects the request as unauthorised and the authorisation lambda is never called. Is there a way to do this using lambda authorizers? If not, does anyone have any recommendations?
    t
    a
    +2
    • 5
    • 11
1...678910Latest