You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ImageId: "ami-07ebfd5b3428b6f4d", // Image of Ubuntu Server 18.04 LTS
133
-
InstanceType: "t2.micro",
134
-
KeyName: "nodeCloud", // key name of Key pair
135
-
MinCount: 1,
136
-
MaxCount: 1
137
-
};
138
-
139
-
// create AWS EC2 instance
140
-
computeModule
141
-
.create(instanceParams)
142
-
.then(res => {
143
-
console.log(`All done ! ${res}`);
144
-
})
145
-
.catch(err => {
146
-
console.log(`Oops something happened ${err}`);
147
-
});
131
+
constinstanceParams= {
132
+
ImageId:"ami-07ebfd5b3428b6f4d", // Image of Ubuntu Server 18.04 LTS
133
+
InstanceType:"t2.micro",
134
+
KeyName:"nodeCloud", // key name of Key pair
135
+
MinCount:1,
136
+
MaxCount:1,
137
+
};
138
+
139
+
// create AWS EC2 instance
140
+
computeModule
141
+
.create(instanceParams)
142
+
.then((res)=> {
143
+
console.log(`All done ! ${res}`);
144
+
})
145
+
.catch((err)=> {
146
+
console.log(`Oops something happened ${err}`);
147
+
});
148
148
}
149
149
150
150
functionstopInstance() {
151
-
const params = {
152
-
InstanceIds: ["i-0928af5c626f85da9"],
153
-
DryRun: false
154
-
};
155
-
156
-
// stop AWS EC2 instance
157
-
computeModule
158
-
.stop(params)
159
-
.then(res => {
160
-
console.log(res);
161
-
})
162
-
.catch(err => {
163
-
console.log(err);
164
-
});
151
+
constparams= {
152
+
InstanceIds: ["i-0928af5c626f85da9"],
153
+
DryRun:false,
154
+
};
155
+
156
+
// stop AWS EC2 instance
157
+
computeModule
158
+
.stop(params)
159
+
.then((res)=> {
160
+
console.log(res);
161
+
})
162
+
.catch((err)=> {
163
+
console.log(err);
164
+
});
165
165
}
166
-
167
166
```
168
167
169
168
## Overriding Providers
170
169
171
170
NodeCloud officially supports AWS, GCP, Azure, DigitalOcean and AliCloud. If you want to use a community-driven plugin override the providers' list as follows.
172
171
173
-
```
172
+
```js
174
173
constnodeCloud=require("nodecloud");
175
174
constoptions= {
176
-
overrideProviders: true
175
+
overrideProviders:true,
177
176
};
178
177
constncProviders=nodeCloud.getProviders(options);
179
-
180
178
```
181
179
182
180
## 📟 Service Types
@@ -317,4 +315,4 @@ This is where the magic happens✨. We don't code any JavaScript classes in Node
0 commit comments