Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const deployStack = (region, bucket) => {
const opts = { cwd: path.resolve(__dirname, '..' ) };
const cfn = new AWS.CloudFormation({ region });
const privateKey = fs.readFileSync(cli.flags.appKeyfile, 'utf8');
const preamble = [
exec('git rev-parse HEAD', opts),
cf.build(path.resolve(__dirname, '..', 'cloudformation', 'stork.template.js'))
];
if (cli.flags.kms) {
const kms = new AWS.KMS({ region });
preamble.push(encrypt(kms, cli.flags.npmToken));
preamble.push(encrypt(kms, privateKey));
preamble.push(encrypt(kms, cli.flags.githubToken));
}
return Promise.all(preamble).then((results) => {
const gitsha = results[0];
const template = results[1];
const encryptedNpm = results[2];
const encryptedGithub = results[3];
const encryptedGithubToken = results[4];
const params = {