17
17
[ ![ Mailing list : Scorelab] ( https://img.shields.io/badge/Mailing%20list-Scorelab-blue.svg )] ( https://groups.google.com/g/score-community )
18
18
[ ![ contributions welcome] ( https://img.shields.io/badge/contributions-welcome-ff69b4.svg?style=flat )] ( https://github.com/leopardslab/nodecloud/issues )
19
19
20
- Table of Content
20
+ Table of Content
21
21
22
- - [ Introduction] ( #introduction )
22
+ - [ Introduction] ( #introduction )
23
23
- [ Supported Service Providers] ( #-supported-service-providers )
24
24
- [ Getting Started] ( #getting-started )
25
25
- [ NodeCloud Plugins] ( #nodecloud-plugins )
@@ -71,13 +71,13 @@ Once `@nodecloud/common` is installed, you need to install the plugins to intera
71
71
72
72
### NodeCloud Plugins
73
73
74
- | Plugin | Installation |
75
- | -------------------- | --------------------------------------------------------------------------------- |
76
- | AWS plugin | ` yarn add @nodecloud/aws-plugin ` or ` npm i @nodecloud/aws-plugin ` |
77
- | Azure plugin | ` yarn add @nodecloud/gcp-plugin ` or ` npm i @nodecloud/gcp-plugin ` |
78
- | Google Cloud plugin | ` yarn add @nodecloud/azure-plugin ` or ` npm i @nodecloud/azure-plugin ` |
79
- | Alibaba plugin | ` yarn add nodecloud-ali- plugin ` or ` npm i nodecloud-ali- plugin ` |
80
- | Digital Ocean plugin | ` yarn add nodecloud-digitalocean -plugin ` or ` npm i nodecloud-digitalocean -plugin ` |
74
+ | Plugin | Installation |
75
+ | -------------------- | --------------------------------------------------------------------- |
76
+ | AWS plugin | ` yarn add @nodecloud/aws-plugin ` or ` npm i @nodecloud/aws-plugin ` |
77
+ | Azure plugin | ` yarn add @nodecloud/gcp-plugin ` or ` npm i @nodecloud/gcp-plugin ` |
78
+ | Google Cloud plugin | ` yarn add @nodecloud/azure-plugin ` or ` npm i @nodecloud/azure-plugin ` | |
79
+ | Digital Ocean plugin | ` yarn add @ nodecloud/do- plugin ` or ` npm i @ nodecloud/do- plugin ` |
80
+ | Alibaba plugin | ` yarn add nodecloud-ali -plugin ` or ` npm i nodecloud-ali -plugin ` |
81
81
82
82
** 3️⃣ Create the NodeCloud config file**
83
83
@@ -98,28 +98,34 @@ This config file can contain an array of objects for all providers and all will
98
98
const nodeCloudAwsPlugin = require (" @nodecloud/aws-plugin" );
99
99
const nodeCloudGcpPlugin = require (" @nodecloud/gcp-plugin" );
100
100
const nodeCloudAzurePlugin = require (" @nodecloud/azure-plugin" );
101
+ const nodeCloudDoPlugin = require (" @nodecloud/do-plugin" );
101
102
102
103
const providers = [
103
104
{
104
105
name: " aws" ,
105
106
tag: " aws" ,
106
107
plugin: nodeCloudAwsPlugin,
107
- configPath: " C:\\ Users\\ Rajitha\\ opensource\\ aws_cred.json" ,
108
+ configPath: " C:\\ Users\\ Rajitha\\ opensource\\ aws_cred.json"
108
109
},
109
110
{
110
111
name: " google" ,
111
112
tag: " google" ,
112
113
plugin: nodeCloudGcpPlugin,
113
114
configPath: {
114
115
projectId: " astral-hold-276807" ,
115
- keyFilename: " C:\\ Users\\ Rajitha\\ opensource\\ gcp_cred.json" ,
116
- },
116
+ keyFilename: " C:\\ Users\\ Rajitha\\ opensource\\ gcp_cred.json"
117
+ }
117
118
},
118
119
{
119
120
name: " azure" ,
120
121
tag: " azure" ,
121
- plugin: nodeCloudAzurePlugin,
122
+ plugin: nodeCloudAzurePlugin
122
123
},
124
+ {
125
+ name: " digitalocean" ,
126
+ tag: " do" ,
127
+ plugin: nodeCloudDoPlugin
128
+ }
123
129
];
124
130
module .exports = providers;
125
131
```
@@ -133,11 +139,11 @@ The below code is an example of usage in AWS.
133
139
``` js
134
140
const nc = require (" @nodecloud/common" ); // NodeCloud common module
135
141
const optionsProvider = {
136
- overrideProviders: false ,
142
+ overrideProviders: false
137
143
};
138
144
const ncProviders = nc .getProviders (optionsProvider);
139
145
const options = {
140
- apiVersion: " 2017-11-01" ,
146
+ apiVersion: " 2017-11-01"
141
147
};
142
148
143
149
const computeModule = ncProviders .aws .compute (options);
@@ -148,33 +154,33 @@ function launchInstance() {
148
154
InstanceType: " t2.micro" ,
149
155
KeyName: " nodeCloud" , // key name of Key pair
150
156
MinCount: 1 ,
151
- MaxCount: 1 ,
157
+ MaxCount: 1
152
158
};
153
159
154
160
// create AWS EC2 instance
155
161
computeModule
156
162
.create (instanceParams)
157
- .then (( res ) => {
163
+ .then (res => {
158
164
console .log (` All done ! ${ res} ` );
159
165
})
160
- .catch (( err ) => {
166
+ .catch (err => {
161
167
console .log (` Oops something happened ${ err} ` );
162
168
});
163
169
}
164
170
165
171
function stopInstance () {
166
172
const params = {
167
173
InstanceIds: [" i-0928af5c626f85da9" ],
168
- DryRun: false ,
174
+ DryRun: false
169
175
};
170
176
171
177
// stop AWS EC2 instance
172
178
computeModule
173
179
.stop (params)
174
- .then (( res ) => {
180
+ .then (res => {
175
181
console .log (res);
176
182
})
177
- .catch (( err ) => {
183
+ .catch (err => {
178
184
console .log (err);
179
185
});
180
186
}
@@ -187,7 +193,7 @@ NodeCloud officially supports AWS, GCP, Azure, DigitalOcean and AliCloud. If you
187
193
``` js
188
194
const nodeCloud = require (" nodecloud" );
189
195
const options = {
190
- overrideProviders: true ,
196
+ overrideProviders: true
191
197
};
192
198
const ncProviders = nodeCloud .getProviders (options);
193
199
```
@@ -198,18 +204,19 @@ const ncProviders = nodeCloud.getProviders(options);
198
204
| ----------------------- | ----------------------------------- | :-----------------------------------: | :-------------------------------: | :---------------------------------------------------------------------: | :---------------------------------------: | :---------------------------------------------------: |
199
205
| Compute | IaaS | EC2 | Compute Engine | Virtual Machine | Droplets | ECS |
200
206
| | Faas | AWS Lambda\* | Cloud Functions\* | Azure Functions\* | - | Function Compute\* |
201
- | | Containers | ECS, EKS | Google Kubernetes Engine | AKS, Azure Service Fabric\* | DO Kubernetes\* | Container Service* , Container Service for Kubernetes* |
207
+ | | Containers | ECS, EKS | Google Kubernetes Engine | AKS, Azure Service Fabric\* | DO Kubernetes | Container Service* , Container Service for Kubernetes* |
202
208
| | Containers (without infrastructure) | AWS Fargate\* | Cloud Run\* | - | - | ECI\* |
203
209
| | Paas | AWS Elastic Beanstalk | App Engine\* | App Service | - | Simple Application Server\* |
204
210
| Storage | Object Storage | S3 | Cloud Storage | Azure Blob Storage | Spaces\* | Bucket (OSS) |
205
211
| | Block Storage | EBS | Persistent Disks | Disk Storage | Volumes | NAS\* |
206
212
| Networking | Load Balancer | ELB | Cloud Load Balancing\* | Azure Load Balancer | DO Load Balancer | SLB |
207
213
| | Peering/Dedicated Interconnect | Direct Connect | Cloud Interconnect\* | ExpressRoute\* | - | Express Connect\* |
208
- | | DNS | Route53 | Google Domains, Cloud DNS | Azure DNS | DO DNS\* | Alibaba Cloud DNS\* |
209
- | Databases | RDBMS | RDS, Amazon Aurora* , Amazon Redshift* | Cloud SQL\* , Cloud Spanner | SQL Database, Azure Database for MySQL* , Azure Database for PostgreSQL* | Managed Databases(PostgreSQL* and MySQL* ) | ApsaraDB (MySQL, MariaDB TX, SQL Server, PostgreSQL) |
214
+ | | DNS | Route53 | Google Domains, Cloud DNS | Azure DNS | DO DNS | Alibaba Cloud DNS\* |
215
+ | Databases | RDBMS | RDS, Amazon Aurora* , Amazon Redshift* | Cloud SQL\* , Cloud Spanner | SQL Database, Azure Database for MySQL* , Azure Database for PostgreSQL* | Managed Databases(PostgreSQL\ * and MySQL) | ApsaraDB (MySQL, MariaDB TX, SQL Server, PostgreSQL) |
210
216
| | NoSQL: key-value | DynamoDB | Cloud Firestore, Cloud Bigtable\* | Table Storage | Managed Databases(Redis)\* | ApsaraDB for Redis\* |
211
217
| | NoSQL: indexed | Amazon SimpleDB\* | Cloud Firestore | Cosmos DB | - | ApsaraDB for MongoDB\* |
212
218
| Security/ Authorization | Identity Access Management | AWS IAM | Cloud IAM\* | Azure Active Directory* , Azure Role Based Access Control* | - | Resource Access Management\* |
219
+ | Management | Key Management | AWS-KMS | - | - | Do-Keys | - |
213
220
214
221
\* yet to be implemented
215
222
0 commit comments