0.0.5 • Published 7 months ago

@instant.dev/deploy v0.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

Simple deployments

npm version Build Status

Deploy to AWS ElasticBeanstalk

Deploy packages to AWS Elastic Beanstalk easily. Used by the Instant CLI to automate Elastic Beanstalk deployments.

It can be used with the @instant.dev/encrypt to automatically encrypt .env files stored in plaintext, with the encryption keys loaded into ElasticBeanstalk at runtime as environment variables.

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 who helps run all of the front-of-house work for instant.dev 💜!

DestinationLink
Homeinstant.dev
GitHubgithub.com/instant-dev
Discorddiscord.gg/puVYgA7ZMh
X / instant.devx.com/instantdevs
X / Keith Horwoodx.com/keithwhor
X / Scott Gamblex.com/threesided
0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago