src/bastion.js
async function buildBastion(keyPairName, numZones = 0) {
  if (numZones < 1) {
    return {};
  }
  let publicIp = '0.0.0.0/0';
  try {
    publicIp = await getPublicIp();
    publicIp = `${publicIp}/32`;
  } catch (err) {
    console.error('Unable to discover public IP address:', err);
  }

  return Object.assign(
    {},
    buildBastionEIP(),
    buildBastionIamRole(),
    buildBastionInstanceProfile(),
    buildBastionSecurityGroup(publicIp),
    buildBastionLaunchConfiguration(keyPairName),
    buildBastionAutoScalingGroup(numZones),
  );
}
async function buildBastion(keyPairName, numZones = 0) {
  if (numZones < 1) {
    return {};
  }
  let publicIp = '0.0.0.0/0';
  try {
    publicIp = await getPublicIp();
    publicIp = `${publicIp}/32`;
  } catch (err) {
    console.error('Unable to discover public IP address:', err);
  }

  return Object.assign(
    {},
    buildBastionEIP(),
    buildBastionIamRole(),
    buildBastionInstanceProfile(),
    buildBastionSecurityGroup(publicIp),
    buildBastionLaunchConfiguration(keyPairName),
    buildBastionAutoScalingGroup(numZones),
  );
}
async function buildBastion ( keyPairName , numZones = 0 ) { if ( numZones < 1 ) { return { } ; } let publicIp = '0.0.0.0/0' ; try { publicIp = await getPublicIp ( ) ; publicIp = ` ${ publicIp } ` ; } catch ( err ) { console . error ( 'Unable to discover public IP address:' , err ) ; } return Object . assign ( { } , buildBastionEIP ( ) , buildBastionIamRole ( ) , buildBastionInstanceProfile ( ) , buildBastionSecurityGroup ( publicIp ) , buildBastionLaunchConfiguration ( keyPairName ) , buildBastionAutoScalingGroup ( numZones ) , ) ; }
Build the bastion host

@param {String} keyPairName Existing key pair name
@param {Number} numZones Number of availability zones
@return {Promise}
Build the bastion host