Coder Social home page Coder Social logo

sst / sst Goto Github PK

View Code? Open in Web Editor NEW
20.2K 20.2K 1.6K 94.59 MB

Build modern full-stack applications on AWS

Home Page: https://sst.dev

License: MIT License

JavaScript 5.69% TypeScript 88.73% CSS 2.07% Go 0.10% Python 0.45% Shell 0.06% HTML 1.56% C# 0.19% F# 0.03% Kotlin 0.01% Swift 0.04% Objective-C 0.01% Dart 0.10% Svelte 0.69% Vue 0.03% EJS 0.01% Java 0.03% Dockerfile 0.03% Astro 0.14% Rust 0.05%
aws cdk csharp golang javascript lambda nextjs python reactjs serverless serverless-stack sst typescript

sst's Introduction

SST

Discord npm Build status


SST makes it easy to build modern full-stack applications on AWS. Watch the SST in 100 seconds video to learn more.

$ npx create-sst@latest

Pick your frontend

Deploy Next.js, Svelte, Remix, Astro, Solid, or any static site to AWS.

Add any feature

SST gives you the full power of AWS. Making it easy to add any feature to your product.

  • File uploads — Allow your users to upload files to S3.
  • Auth — Authenticate your users through any auth provider.
  • Events — Run tasks after your app has returned to your user.
  • Databases — Use a serverless SQL or NoSQL database to power your app.
  • Jobs — Run cron jobs or long running jobs powered by serverless functions.
  • APIs — Add a dedicated serverless REST, GraphQL, or WebSocket API to your app.

Collaborate with your team

Finally, you can git push to deploy using SEED, a service built by the team behind SST. And you can work on your apps together with your team with automatic preview environments.


Join our community Discord | YouTube | Twitter | Contribute

sst's People

Contributors

aisflat439 avatar alistairstead avatar bayssmekanique avatar berenddeboer avatar christinep2 avatar ctrlplusb avatar dkershner6 avatar erikm-icario avatar estyrke avatar fwang avatar geekmidas avatar github-actions[bot] avatar jamesgibbons92 avatar jayair avatar jbrown avatar jfix avatar jpvan avatar justindra avatar khuezy avatar manitej66 avatar michaelgmcd avatar mmccall10 avatar omichowdhury avatar pzeinlinger avatar rcoundon avatar revmischa avatar richicoder1 avatar seththomas avatar thdxr avatar tranlehaiquan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sst's Issues

Detect app failed to build in `sst start` and auto rebuild every few seconds.

How to reproduce

  1. In a lambda handler file, add a new import at the top (at this point the imported files does not exist yet)
  2. sst start console shows the build failed
  3. Now add the import file, the watcher does not trigger a rebuild

How to fix

  • Flag the entry points failed to build
  • Rebuild the entry points when a request comes in for the Lambda
  • Rebuild the failed entry points every second of every X seconds

Cannot remove the app if the app is in a non-synth-able state on `sst remove`

Two scenarios

  1. User has deployed the app, then made some changes and the app can no long be synthed (ie. sst build fails). The user now wants to remove the app and start fresh but cannot because sst remove fails at the build step.
  2. User has deployed the app, then the dependencies have changed (ie. a stack no longer uses the export from another stack). The user now wants to remove the app, and removal might fail because the removal order is now changed.

Solution

Create a SST bucket in the user's S3 account that stores the app's latest deployed state. And sst remove does not rebuild the app, but rather remove using the state.

Unable to access forked CDK CLI

Hello,

I've got a stack built with SST that I can deploy. When trying to run a command with CDK, I get nothing back as if it isn't executed.

$ npx sst cdk list
Preparing @serverless-stack/resources
Linting source
Compiling with Babel

list can be replaced by any other CDK command and I get the same result.

npx version is 10.2.2, SST is 0.4.3 and I'm on OSX.

Allow Function configuration of bundle disabled when srcPath is at the app root

This configuration is currently not supported because we need to zip the app root for each handler. So after a Lambda's zip is generated, the next Lambda's zip will contain the previous Lambda's zip inside .build, and the previous Lambda's zip inside cdk.out.

One solution would be to cherry pick what to zip. For example, zip should only include the esbuid's output (ie. .js and .js.map files) from the .build folder.

Also need to clear all .build folders generated from Lambda functions that has srcPath.

Jest configurations not supported

I am trying to setup Jest so that I can have my test files inside of my lib folder. Just based on preference. The problem here is that if a build was performed, it generates those test files in the build folder. Normally I can just use the testPathIgnorePatterns config in Jest. But currently you are not allowing me to override that particular config. Are there any reasons for this?

Must put all of my TS files under `lib/` rootDir

How can I move my rootDir? Do I have to put my entire app under lib/?

error TS6059: File '/.../src/api/foo.ts' is not under 'rootDir' '/.../lib'. 'rootDir' is expected to contain all source files.

I'm not even including this file in any of my CDK files, so I'm not sure why it's being compiled at all for sst build

Browser based log console

Create a way to view sst start logs in a UI instead of the terminal. This will help with:

  • Expanding/collapsing request and response headers
  • UI to view traces of invocations
  • A way to retry a specific Lambda in a trace
  • etc.

Linting fails due to upstream configuration difference

Hello! I'm getting the following error after a basic yarn create serverless-stack resources. I installed the stack into a subdirectory of a project which has it's own ESLint configuration. I get the following error during yarn build:

❯ yarn build                                                                                                                                               took   4s   12.18.3   2.4.0
yarn run v1.22.10
$ sst build
Preparing @serverless-stack/resources
Linting source

Oops! Something went wrong! :(

ESLint: 7.11.0

ESLint couldn't determine the plugin "@typescript-eslint" uniquely.

- /Users/me/some-app/infrastructure/node_modules/@serverless-stack/cli/node_modules/@typescript-eslint/eslint-plugin/dist/index.js (loaded in "--config")
- /Users/me/some-app/node_modules/@typescript-eslint/eslint-plugin/dist/index.js (loaded in "../.eslintrc.js » plugin:@typescript-eslint/recommended » ./configs/base")

Please remove the "plugins" setting from either config or remove either plugin installation.

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Seems this can be resolved by making sure the CLI's ESLint process treats itself as the root via --resolve-plugins-relative-to . This could also be solved by allowing me to specify my own ESLint config to sst, or by letting end users skip linting altogether.

Error with bootstrap-template in deploy step

I added a new service to my deployment pipeline which builds a static site and uploads it to s3. I'm getting an error that I haven't seen on any other services and I'm not sure where to start debugging this one

====================
🚀 Deploy
====================
$ cd /tmp/seed/source
INFO: before_deploy hook not found. You can define it in your build spec.
INFO: Learn more about adding a build spec - seed.run/docs/adding-a-build-spec
$ cd /tmp/seed/source/clients/web/web-infra
INFO: Deploying 1 stack...
❌ dev-web-infra-my-stack: ENOENT: no such file or directory, open '/var/task/bootstrap-template.yaml'

Changing sst.Function construct take just 'handler' without 'entry'

Current definition

{ srcPath: 'src', entry: 'get.ts', handler: 'main' }

New proposed definition

{ srcPath: 'src', handler: 'get.main' }

TODO

  • Update Function construct definition
  • Update Function construct builder
  • Update sst start builder
  • Update templates
  • Update sst start demo repo

AWS CDK Update

The AWS CDK is up to 1.78.0 and this one is still on 1.61.0, Any chance we can get that updated to be closer to recent?

Attempting to remove a stack which doesn't exist produces a cryptic error message?

I am getting a strange error message when attempting to remove a stack which does not exist. I would think the desired result would be just letting the user know that the stack does not exist.

SST: 0.4.4
CDK: 1.79.0

Preparing @serverless-stack/resources
Linting source
Detected tsconfig.json
Compiling TypeScript
Removing stacks
doesnotexist-aeroluxmaps-infrastructure-website: destroying...
doesnotexist-aeroluxmaps-infrastructure-dynamodb: destroying...

✅ doesnotexist-aeroluxmaps-infrastructure-dynamodb: destroyed
❌ doesnotexist-aeroluxmaps-infrastructure-dynamodb failed: TypeError: Cannot destructure property 'status' of '(intermediate value)' as it is undefined.
✅ doesnotexist-aeroluxmaps-infrastructure-website: destroyed
❌ doesnotexist-aeroluxmaps-infrastructure-website failed: TypeError: Cannot destructure property 'status' of
'(intermediate value)' as it is undefined.

feature-request: Set profiles/regions between stacks

It would be great to set specific Region or profile for particular nested stacks.

Use Case:

Cloudfront Requires the SSL Certificate be hosted in the us-east-1 region. Most people would be hosting everything else in other regions.

View logs from the debug stack and stub

Show the logs from the stub Lambda and websocket connection handler that is deployed in the Debug Stack.

Use cases

Mike had an issue where the DynamoDB table was manually removed from the debug stack. And when sst start tries to send a websocket call to register itself, the websocket call returned "Internal Server Error".

Noah also ran into a similar issue.

Solution

  • Whenever the stub function or the websocket function fails, send an error message to local. And display the message in the terminal.
  • On sst start, auto-detect missing resources in the debug stack. And auto-recreate them.

Update docs for sst.Api

Constructor Properties

  • cors: boolean
  • accessLog: boolean
  • routes: { [key: string]: string | RouteProps }
  • defaultAuthorizationType: AWS_IAM | NONE, can enable AWS_IAM authorization overall and override per route
  • defaultLambdaProps: sst.FunctionProps, can define default lambda props and override per route
  • httpApiProps

Properties

  • httpApi
  • accessLogGroup

RouteProps

  • authorizationType: AWS_IAM | NONE
  • lambdaProps: FunctionProps

Least required format

const api = new Api(this, "Api", {
  routes: {
    "GET /notes": "path/to/file.main",
  },
});

Compact format

const api = new Api(this, "Api", {
  defaultLambdaProps: {
    srcPath: 'services/notes',
    environment: { tableName },
    initialPolicy: [ new iam.PolicyStatement({
      actions: [
        "dynamodb:Scan",
				...
      ],
      effect: iam.Effect.ALLOW,
      resources: [ dbStack.table.tableArn ],
    }) ];
  },
  defaultAuthorizationType: 'AWS_IAM',
  routes: {
    "GET /": "path/to/list.main",
    "GET /notes": "path/to/get.main",
  },
});

Full format

const api = new Api(this, "Api", {
  routes: {
    "GET /notes": {
      authorizationType: "AWS_IAM",
      lambdaProps: { srcPath, handler: "path/to/list.main", environment, initialPolicy },
    },
		...
  },
});

Linting source - Error: spawnSync node ENAMETOOLONG

Windows 10

I have a fairly simple cdk file that creates a load balancer and containter.

I get the follow error...

Note: If I hack the source and remove .js file type checking then it works fine

npx sst build
Preparing your SST app
Detected tsconfig.json
Transpiling source
Linting source
Error: spawnSync node ENAMETOOLONG
    at Object.spawnSync (internal/child_process.js:1070:20)
    at Object.spawnSync (child_process.js:602:24)
    at Function.spawnSync [as sync] (C:\working\myapp\node_modules\cross-spawn\index.js:26:23)
    at lint (C:\working\myapp\node_modules\@serverless-stack\cli\scripts\util\cdkHelpers.js:176:26)
    at runChecks (C:\working\myapp\node_modules\@serverless-stack\cli\scripts\util\cdkHelpers.js:237:30)
    at prepareCdk (C:\working\myapp\node_modules\@serverless-stack\cli\scripts\util\cdkHelpers.js:363:9) {
  errno: -4064,
  code: 'ENAMETOOLONG',
  syscall: 'spawnSync node',
  path: 'node',
  spawnargs: [
    'C:\\working\\myapp\\.build\\eslint.js',
    '--color',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-elasticloadbalancingv2\\lib\\elasticloadbalancingv2.generated.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\region-info\\lib\\default.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\region-info\\lib\\fact.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\region-info\\lib\\region-info.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\region-info\\lib\\built-ins.generated.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\region-info\\lib\\index.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-iam\\lib\\util.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-iam\\lib\\principals.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-iam\\lib\\policy-statement.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-iam\\lib\\policy-document.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-iam\\lib\\iam.generated.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-iam\\lib\\managed-policy.js',
    'C:\\working\\myapp\\node_modules\\constructs\\lib\\aspect.js',
    'C:\\working\\myapp\\node_modules\\constructs\\lib\\metadata.js',
    'C:\\working\\myapp\\node_modules\\constructs\\lib\\private\\dependency.js',
    'C:\\working\\myapp\\node_modules\\constructs\\lib\\private\\stack-trace.js',
    'C:\\working\\myapp\\node_modules\\constructs\\lib\\private\\uniqueid.js',
    'C:\\working\\myapp\\node_modules\\constructs\\lib\\construct.js',
    'C:\\working\\myapp\\node_modules\\constructs\\lib\\index.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-iam\\lib\\grant.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-iam\\lib\\policy.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-iam\\lib\\private\\immutable-role.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-iam\\lib\\role.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-iam\\lib\\user.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-iam\\lib\\group.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-iam\\lib\\lazy-role.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-iam\\lib\\identity-base.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-iam\\lib\\unknown-principal.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-iam\\lib\\oidc-provider.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-iam\\lib\\index.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-ec2\\lib\\peer.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-ec2\\lib\\connections.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-ec2\\lib\\ec2.generated.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\lib\\cloud-assembly\\schema.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\lib\\cloud-assembly\\metadata-schema.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\lib\\cloud-assembly\\artifact-schema.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\lib\\cloud-assembly\\context-queries.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\lib\\cloud-assembly\\index.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\lib\\assets\\schema.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\lib\\assets\\docker-image-asset.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\lib\\assets\\file-asset.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\lib\\assets\\aws-destination.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\lib\\assets\\index.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\jsonschema\\lib\\helpers.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\jsonschema\\lib\\attribute.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\jsonschema\\lib\\scan.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\jsonschema\\lib\\validator.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\jsonschema\\lib\\index.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\internal\\constants.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\internal\\debug.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\internal\\re.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\internal\\identifiers.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\classes\\semver.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\parse.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\valid.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\clean.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\inc.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\compare.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\eq.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\diff.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\major.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\minor.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\patch.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\prerelease.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\rcompare.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\compare-loose.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\compare-build.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\sort.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\rsort.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\gt.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\lt.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\neq.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\gte.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\lte.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\cmp.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\coerce.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\classes\\range.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\classes\\comparator.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\functions\\satisfies.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\ranges\\to-comparators.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\ranges\\max-satisfying.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\ranges\\min-satisfying.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\ranges\\min-version.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\ranges\\valid.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\ranges\\outside.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\ranges\\gtr.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\ranges\\ltr.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\ranges\\intersects.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\ranges\\simplify.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\ranges\\subset.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\node_modules\\semver\\index.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\lib\\manifest.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cloud-assembly-schema\\lib\\index.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\aws-ec2\\lib\\security-group.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cx-api\\lib\\cxapi.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cx-api\\lib\\context\\vpc.js',
    'C:\\working\\myapp\\node_modules\\@aws-cdk\\cx-api\\lib\\context\\ami.js',
    ... 609 more items
  ]
}
There was a problem linting the source.

Add a docs site

Create a separate site for docs and move the READMEs over. Also, include a quick start guide.

sst cdk - CDK not found

WIndows 10

npx sst cdk --app=.build/run.js diff
'C:\working\myapp\node_modules\@serverless-stack\cli\node_modules\.bin\cdk' is not recognized as an internal or external command,
operable program or batch file.

It looks like it's in the top level node modules instead?

Change SST logicalPrefixedName naming to match serverless 3.0 update

sst deploy exits 0 even when it fails to deploy due to missing AWS credentials

$ sst deploy
Preparing your SST app
Transpiling source
Linting source
Deploying stacks
functionArn: arn:aws:lambda:us-east-1:${Token[AWS.AccountId.0]}:function:mysstapp-app-dev-notify.
dev-mysstapp-infra-dynamodb: deploying...

 ❌  dev-mysstapp-infra-dynamodb failed: Error: Unable to resolve AWS account to use. It must be either configured when you define your CDK or through the environment
    at SdkProvider.resolveEnvironment (/Users/me/workspace/mysstapp/serverless-infra/node_modules/sst-cdk/lib/api/aws-auth/sdk-provider.ts:208:13)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at CloudFormationDeployments.prepareSdkFor (/Users/me/workspace/mysstapp/serverless-infra/node_modules/sst-cdk/lib/api/cloudformation-deployments.ts:236:33)
    at CloudFormationDeployments.deployStack (/Users/me/workspace/mysstapp/serverless-infra/node_modules/sst-cdk/lib/api/cloudformation-deployments.ts:162:70)
    at CdkToolkit.deploy (/Users/me/workspace/mysstapp/serverless-infra/node_modules/sst-cdk/lib/cdk-toolkit.ts:194:24)
    at Object.deployAsync (/Users/me/workspace/mysstapp/serverless-infra/node_modules/sst-cdk/lib/serverless-stack.ts:122:15)
    at /Users/me/workspace/mysstapp/serverless-infra/node_modules/@serverless-stack/core/index.js:71:17
    at async Promise.all (index 0)
    at deployStacks (/Users/me/workspace/mysstapp/serverless-infra/node_modules/@serverless-stack/core/index.js:48:5)
    at Object.parallelDeploy (/Users/me/workspace/mysstapp/serverless-infra/node_modules/@serverless-stack/core/index.js:446:3)

 ❌  dev-mysstapp-infra-dynamodb failed: Error: Unable to resolve AWS account to use. It must be either configured when you define your CDK or through the environment

dev-mysstapp-infra-eventbridge: deploying...

 ❌  dev-mysstapp-infra-eventbridge failed: Error: Unable to resolve AWS account to use. It must be either configured when you define your CDK or through the environment
    at SdkProvider.resolveEnvironment (/Users/me/workspace/mysstapp/serverless-infra/node_modules/sst-cdk/lib/api/aws-auth/sdk-provider.ts:208:13)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at CloudFormationDeployments.prepareSdkFor (/Users/me/workspace/mysstapp/serverless-infra/node_modules/sst-cdk/lib/api/cloudformation-deployments.ts:236:33)
    at CloudFormationDeployments.deployStack (/Users/me/workspace/mysstapp/serverless-infra/node_modules/sst-cdk/lib/api/cloudformation-deployments.ts:162:70)
    at CdkToolkit.deploy (/Users/me/workspace/mysstapp/serverless-infra/node_modules/sst-cdk/lib/cdk-toolkit.ts:194:24)
    at Object.deployAsync (/Users/me/workspace/mysstapp/serverless-infra/node_modules/sst-cdk/lib/serverless-stack.ts:122:15)
    at /Users/me/workspace/mysstapp/serverless-infra/node_modules/@serverless-stack/core/index.js:71:17
    at async Promise.all (index 1)
    at deployStacks (/Users/me/workspace/mysstapp/serverless-infra/node_modules/@serverless-stack/core/index.js:48:5)
    at Object.parallelDeploy (/Users/me/workspace/mysstapp/serverless-infra/node_modules/@serverless-stack/core/index.js:446:3)

 ❌  dev-mysstapp-infra-eventbridge failed: Error: Unable to resolve AWS account to use. It must be either configured when you define your CDK or through the environment


Stack dev-mysstapp-infra-dynamodb
  Status: failed
  Error: Unable to resolve AWS account to use. It must be either configured when you define your CDK or through the environment

Stack dev-mysstapp-infra-eventbridge
  Status: failed
  Error: Unable to resolve AWS account to use. It must be either configured when you define your CDK or through the environment

✨  Done in 2.93s.

If an error is encountered at the cdk synthesizing step, it exits appropriately, though: There was an error synthesizing your app. error Command failed with exit code 1.

Any ideas why this might be the case? I'm trying to write a deploy script and I'd like for SST to properly exit non-zero when it fails to deploy.

typescript cannot be found for type check on windows

Windows 10

npx create-serverless-stack@latest myapp --language typescript
cd myapp
npx sst build

following error

Running type checker
Error: There was a problem finding typescript
    at getBinPath (C:\working\myapp\node_modules\@serverless-stack\cli\scripts\util\cdkHelpers.js:45:11)
    at typeCheck (C:\working\myapp\node_modules\@serverless-stack\cli\scripts\util\cdkHelpers.js:210:9)
    at runChecks (C:\working\myapp\node_modules\@serverless-stack\cli\scripts\util\cdkHelpers.js:236:48)
    at prepareCdk (C:\working\myapp\node_modules\@serverless-stack\cli\scripts\util\cdkHelpers.js:362:9)
There was a problem type checking the source.

I changed @serverless-stack\cli\scripts\util\cdkHelpers.js:40 from filePath.match(/(^.*\/node_modules)\/.*$/); to filePath.match(/(^.*[\/\\]node_modules)[\/\\].*$/); and it works

After this fixed then I get another issue

Type checking Lambda function source

TypeError: Cannot read property 'toString' of undefined
    at App.typeCheck (C:\working\myapp\node_modules\@serverless-stack\resources\src\App.ts:263:28)
    at C:\working\myapp\node_modules\@serverless-stack\resources\src\App.ts:193:12
    at Array.forEach (<anonymous>)
    at App.processInputFiles (C:\working\myapp\node_modules\@serverless-stack\resources\src\App.ts:190:38)
    at App.synth (C:\working\myapp\node_modules\@serverless-stack\resources\src\App.ts:159:12)
    at process.<anonymous> (C:\working\myapp\node_modules\@aws-cdk\core\lib\app.ts:123:45)
    at Object.onceWrapper (events.js:421:26)
    at process.emit (events.js:314:20)
    at process.emit (C:\working\myapp\node_modules\source-map-support\source-map-support.js:495:21)

There was an error synthesizing your app.

Example with Serverless Framework?

Hi, is there an example available somewhere of Serverless Framework running with SST? How does the Serverless Framework know about resources created by the SST?

Create an API construct

Make it easier to create APIs by creating a higher level construct. Need to automatically handle things like cold starts, etc.

TODO

  • easy way to enable CORS, if both cors and corsPreflight are defined, cors takes precedence
  • enable access log by default, allow customizing log format
  • enable xray by default for all lambdas
  • enable AWS_NODEJS_CONNECTION_REUSE_ENABLED by default for all lambdas
  • easy way to enable AWS_IAM authorization for all routes, allow override per route
  • easy way to define common Lambda props (environment, policy, srcPath, etc) for all aroutes, allow override per route

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.