Using a private git repo as an npm dependency in Lambda and/or deployed Node.js instances?

Viewed 152

What I am trying to accomplish is creating and hosting a private repo on Bitbucket that will house all of my Mongoose schemas that I can then import across my other application repos via NPM Git URLs. In other words, create a central source of Mongoose schemas that can be imported by other projects instead of copying and pasting schemas.

Ideally I would like to use the SSH option so that the Mongoose Schemas repo may be private and secure, however I have an entire Serverless repo with Lambdas that will need access to that private Schema repo and I am unsure of how the Lambda invocations will be able to Git SSH to import the Schemas. How do I accomplish this? Is there a particular place to store my SSH key for Bitbucket within my Lambdas to actually import the Schemas repo from NPM?

I know that for my Node.js server that will also use the Mongoose Schemas repo, I can host the server on EC2 and install git on it and configure SSH keys and/or use AWS Secrets Manager... but for the Lambda functions I have no idea how I would get this to work.

0 Answers
Related