https://github.com/instant-dev/deploy
Deploy packages to AWS ElasticBeanstalk
https://github.com/instant-dev/deploy
Last synced: 2 months ago
JSON representation
Deploy packages to AWS ElasticBeanstalk
- Host: GitHub
- URL: https://github.com/instant-dev/deploy
- Owner: instant-dev
- Created: 2023-10-10T05:51:59.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-10T23:24:46.000Z (over 1 year ago)
- Last Synced: 2025-01-05T08:55:12.008Z (4 months ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple deployments
 ## Deploy to AWS ElasticBeanstalk
Deploy packages to AWS Elastic Beanstalk easily. Used by the
[Instant CLI](https://github.com/instant-dev/instant) to automate Elastic Beanstalk deployments.It can be used with the [@instant.dev/encrypt](https://github.com/instant-dev/encrypt) to
automatically encrypt `.env` files stored in plaintext, with the encryption keys
loaded into ElasticBeanstalk at runtime as environment variables.```javascript
import { DeploymentManager } from '@instant.dev/deploy';
import EncryptionTools from '@instant.dev/encrypt';const envName = `staging`;
// Prepare to encrypt .env file
const et = new EncryptionTools();
// Loads deployment variables from ".deployconfig.staging" INI-format file
const dm = new DeploymentManager(`.deployconfig.${envName}`);// Encrypts `.env.staging` as `.env` in final package
// Also deletes all files matching `.env.*` from final package
const {files, env} = et.encryptEnvFileFromPackage(
// Reads all files in this directory, stores them in files {} object
dm.readPackageFiles('~/projects/instant.dev/test-empty'),
`.env.${envName}`,
`.env`,
/^\.env\..*$/
);// Deploys to ElasticBeanstalk
let deployResult = await dm.deployToElasticBeanstalk(files, envName, env);
/**
{
app_url: 'my-app.elasticbeanstalk.com',
dashboard_url: 'https://console.aws.amazon.com/...'
}
*/
```## Acknowledgements
Special thank you to [Scott Gamble](https://x.com/threesided) who helps run all
of the front-of-house work for instant.dev 💜!| Destination | Link |
| ----------- | ---- |
| Home | [instant.dev](https://instant.dev) |
| GitHub | [github.com/instant-dev](https://github.com/instant-dev) |
| Discord | [discord.gg/puVYgA7ZMh](https://discord.gg/puVYgA7ZMh) |
| X / instant.dev | [x.com/instantdevs](https://x.com/instantdevs) |
| X / Keith Horwood | [x.com/keithwhor](https://x.com/keithwhor) |
| X / Scott Gamble | [x.com/threesided](https://x.com/threesided) |