npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sam-cdk

v1.0.1

Published

Extract environment variables from Lambda functions for use with SAM CLI.

Downloads

6

Readme

SAM CDK

Extract environment variables from Lambda functions for use with SAM CLI.

Usage

sam-cdk wraps sam CLI. All sam CLI options can be passed to sam-cdk. The only difference is that sam-cdk needs a stack name to lookup Lambda function environments.

sam-cdk COMMAND --stack STACK_NAME --template TEMPLATE [...SAM_CLI_OPTIONS]

sam-cdk environment

The sam-cdk environment command creates a file that can be used as env-vars option to the SAM CLI. The command looks for all the Lambda functions in the given template. The environment variables of those Lambda functions are loaded from the stack with the given stack name and stored in the given output file.

sam-cdk environment --stack STACK_NAME --template ./cdk.out/stack.template.json --output ./environment.json
sam --template ./cdk.out/stack.template.json --env-vars ./environment.json

sam-cdk local start-api

The sam-cdk local start-api command invokes the corresponding SAM CLI sam local start-api command and automatically includes the env-vars as described above.

sam-cdk local start-api --stack STACK_NAME --template ./cdk.out/stack.template.json [...SAM_CLI_OPTIONS]

sam-cdk local start-lambda

The sam-cdk local start-lambda command invokes the corresponding SAM CLI sam local start-lambda command and automatically includes the env-vars as described above.

sam-cdk local start-lambda --stack STACK_NAME --template ./cdk.out/stack.template.json [...SAM_CLI_OPTIONS]

sam-cdk invoke

The sam-cdk invoke command invokes the corresponding SAM CLI sam local invoke command and automatically includes the env-vars as described above.

sam-cdk local invoke FunctionName --stack STACK_NAME --template ./cdk.out/stack.template.json [...SAM_CLI_OPTIONS]

Permissions

sam-cdk is using AWS SDK to lookup Lambda function environments. Make sure you are using an IAM role or user that can describe CloudFormation stack resources and get Lambda function configuration.

Notes

CDK

This tool works great with CDK.

Your CDK stack has to be deployed before using this tool.

Make sure to synthesize your CDK application using the --no-staging option. CDK then adds metadata aws:asset:path pointing to your local code for every Lambda function in the synthesized template.

cdk synth --quiet --no-staging

Environment Changes

Author

Gillis Van Ginderachter

License

GNU General Public License v3.0