Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sls-py-extern-pkgs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sls-py-extern-pkgs

Add external folders to the sls package and run commands

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

sls-py-extern-pkgs 📦

serverless

npm version

Package a Serverless Python Function services with external code

Installation

npm i -D sls-py-extern-pkgs
yarn add -D sls-py-extern-pkgs

Usage

service: service-name

plugins:
  - serverless-package-external

ecr:
  images:
    # Your images here
    # TODO: Currently it doesn't work, but the packages are copied

functions:
  # Your functions here

custom:
  packageExternal:
    common_utils:
      # Optional command to run after you have linked common_utils
      cmd: pip install -r requirements.txt -t .. > /dev/null 2>&1
      source: '../common_utils'
      # if no functions specified, it will apply it to all
      functions:
        - service-a
        - service-b
    api_utils:
      source: '../api_utils'
      functions:
        - service-b
Example Directory Structure
└── common_utils
    └── resource.py
└── api_utils
    └── resource.py
└── functions
  └── service-a
      └── handler.py
  └── service-b
      └── handler.py
  serverless.yml

In service-b/handler.py, external code can be imported:

from common_utils.resource import shared_resource
from api_utils.resource import shared_resource

Keywords

FAQs

Package last updated on 17 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc