Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const utils = require("./utils");
- const newDomain = "";
- const domains = [""];
- const main = async () => {
- try {
- for (let i = 0; i < domains.length; i++) {
- const domain = domains[i];
- let basePaths = await utils.run(
- `aws apigateway get-base-path-mappings --domain-name ${domain}`
- );
- basePaths = basePaths ? JSON.parse(basePaths) : basePaths;
- for (let j = 0; j < basePaths.items.length; j++) {
- const basePath = basePaths.items[j];
- await utils.run(
- `aws apigateway create-base-path-mapping --domain-name ${newDomain} --rest-api-id ${
- basePath.restApiId
- } --stage ${basePath.stage} --base-path ${basePath.basePath}`
- );
- }
- }
- } catch (error) {
- console.log({ error });
- }
- };
- main();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement