
Research
Security News
Malicious npm Packages Use Telegram to Exfiltrate BullX Credentials
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
serverless-exports-plugin
Advanced tools
Serverless Framework plugin to export Environment variables and CloudFormation outputs to a file
This plugin exports environment variables and stack outputs from your Serverless project to local files. These files can then be used in development or in CI/CD pipelines to set environment variables or use as input for other tools.
Install the plugin as a development dependency in your Serverless project:
npm install --save-dev serverless-exports-plugin
Then add the plugin to your serverless.yml
file:
plugins:
- serverless-exports-plugin
Finally, configure the exports you want to generate:
custom:
exports:
environment:
file: .env.${sls:stage}
format: env
overwrite: true
stack:
file: stack-outputs.txt
format: env
overwrite: true
That's it! Now you can run serverless deploy
or serverless package
or serverless info
and the plugin will generate the exports for you.
The plugin supports two type of exports: environment
variables and stack
outputs.
The configuration for each export is the following:
custom:
exports:
<environment | stack>:
file: path/to/file
format: env | yaml # not implemented yet: json | toml
overwrite: true | false
Only exports that are configured will be generated. There are no default values, so if you want to generate an export you need to configure it.
The plugin runs during serverless deploy
, serverless package
and serverless info
commands. However, the stack outputs are only available after the stack has been deployed. Therefore, the plugin will only generate the stack outputs during serverless deploy
.
service: acme-service
frameworkVersion: '3'
plugins:
- serverless-exports-plugin
custom:
exports:
environment:
file: .env.${sls:stage}
format: env
overwrite: true
stack:
file: stack-outputs.txt
format: env
overwrite: true
provider:
name: aws
runtime: nodejs18.x
environment:
FOO: bar
STAGE: ${sls:stage}
REGION: ${sls:region}
SERVICE: ${self:service}
functions:
hello:
handler: index.handler
resources:
Resources:
bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:service}-${sls:stage}-bucket
Outputs:
Foo:
Value: bar
BucketName:
Value: !Ref bucket
$ serverless deploy
Deploying acme-service to stage dev (us-east-1)
✔ Exported environment variables to .serverless/.env.dev
FOO: bar
STAGE: dev
REGION: us-east-1
SERVICE: acme-service
✔ Exported stack outputs to .serverless/stack-outputs.txt
ServerlessDeploymentBucketName: acme-service-dev-serverlessdeploymentbuck-a242ab89
HelloLambdaFunctionQualifiedArn: arn:aws:lambda:us-east-1:000000000000:function:acme-service-dev-hello:1
Foo: bar
BucketName: acme-service-dev-bucket
✔ Service deployed to stack acme-service-dev (12s)
functions:
hello: acme-service-dev-hello (66 kB)
$ serverless package
Packaging acme-service for stage dev (us-east-1)
✔ Exported environment variables to .serverless/.env.dev
FOO: bar
STAGE: dev
REGION: us-east-1
SERVICE: acme-service
✔ Service packaged (1s)
$ serverless info
✔ Exported environment variables to .serverless/.env.dev
FOO: bar
STAGE: dev
REGION: us-east-1
SERVICE: acme-service
service: acme-service
stage: dev
region: us-east-1
stack: acme-service-dev
functions:
hello: acme-service-dev-hello
serverless package
and serverless info
, if the stack has already been deployedseverless exports
to generate the exports without deploying the stackContributions are welcome! Please open an issue or submit a pull request.
FAQs
Serverless Framework plugin to export Environment variables and CloudFormation outputs to a file
The npm package serverless-exports-plugin receives a total of 369 weekly downloads. As such, serverless-exports-plugin popularity was classified as not popular.
We found that serverless-exports-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.
Security News
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.