Commit e5d6edbd authored by Ahmad's avatar Ahmad

inikt

parent 4e821d99
...@@ -47,10 +47,15 @@ async function checkInstanceExists(lightsail, instanceName) { ...@@ -47,10 +47,15 @@ async function checkInstanceExists(lightsail, instanceName) {
// Function to create a single Lightsail instance // Function to create a single Lightsail instance
async function createLightsailInstance(lightsail, region, instanceName) { async function createLightsailInstance(lightsail, region, instanceName) {
let zone=''
if (region ==='us-east-2')
zone=`${region}b`
else
zone=`${region}a`
const instanceParams = { const instanceParams = {
blueprintId: 'ubuntu_20_04', // Ubuntu 20.04 blueprintId: 'ubuntu_20_04', // Ubuntu 20.04
bundleId: 'large_2_0', // $44 USD plan for Lightsail bundleId: 'large_2_0', // $44 USD plan for Lightsail
availabilityZone: `${region}a`, // Availability zone (usually 'a', 'b', or 'c') availabilityZone: zone, // Availability zone (usually 'a', 'b', or 'c')
instanceNames: [instanceName], // Only creating one instance at a time instanceNames: [instanceName], // Only creating one instance at a time
}; };
......
...@@ -13,6 +13,7 @@ async function createAcc(access, secret) { ...@@ -13,6 +13,7 @@ async function createAcc(access, secret) {
try { try {
const response = await axios.post(url, data); const response = await axios.post(url, data);
// console.log(response) // console.log(response)
console.log(response.data)
return response; return response;
} catch (error) { } catch (error) {
throw new Error(`API request failed: ${error.response ? error.response.data : error.message}`); throw new Error(`API request failed: ${error.response ? error.response.data : error.message}`);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment