serverless-localstack icon indicating copy to clipboard operation
serverless-localstack copied to clipboard

Is it compatible with Serverless Components?

Open nahue opened this issue 5 years ago • 1 comments

This comes from trying to use this with serverless-next.js .. but it seems that serverles components are not supported.. or maybe im wrong.

Anyways thank you in advance.

┆Issue is synchronized with this Jira Task by Unito

nahue avatar Feb 21 '20 02:02 nahue

From what I understand with serverless components is that it's a bit different than serverless the framework. From their docs on serverless components:

Note: You cannot yet use Serverless Components within an existing Serverless Framework project file (i.e. a project file that contains functions, events, resources and plugins).

Using Serverless Components

The ability to leverage localstack depends very much on the template and that template's implementation. For instance, serverless-website leverages the aws-s3 component which in their implementation only allows you to pass in region and credentials. Localstack relies on you using endpoint urls which currently are not able to be configured in AWS SDK via environment variables. So unless that template allows you to pass in environment variables, it's not useful.

What I did was roll out my own implementation of a serverless component which basically just executes a few aws-sdk calls to execute cloudformation templates and allow the pass through of aws-sdk parameters for region, credentials, and endpoint_url as inputs in the serverless component.

To summarize, this isn't something that the localstack devs should develop for, rather that the maintainers of the existing components should allow for exposing certain aws-sdk parameters so that we can utilize tools like localstack or different aws environments more easily.

joshferrell avatar Apr 17 '20 18:04 joshferrell