SHARE
TWEET

Untitled

a guest Mar 24th, 2019 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const utils = require("./utils");
  2.  
  3. const newDomain = "";
  4. const domains = [""];
  5.  
  6. const main = async () => {
  7.   try {
  8.     for (let i = 0; i < domains.length; i++) {
  9.       const domain = domains[i];
  10.       let basePaths = await utils.run(
  11.         `aws apigateway get-base-path-mappings --domain-name ${domain}`
  12.       );
  13.       basePaths = basePaths ? JSON.parse(basePaths) : basePaths;
  14.       for (let j = 0; j < basePaths.items.length; j++) {
  15.         const basePath = basePaths.items[j];
  16.         await utils.run(
  17.           `aws apigateway create-base-path-mapping --domain-name ${newDomain} --rest-api-id ${
  18.             basePath.restApiId
  19.           } --stage ${basePath.stage} --base-path ${basePath.basePath}`
  20.         );
  21.       }
  22.     }
  23.   } catch (error) {
  24.     console.log({ error });
  25.   }
  26. };
  27.  
  28. main();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top