cloudmason 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,6 +9,11 @@ Can be used as a command line tool, or in a CI/CD pipeline.
9
9
  - [Important Notes](##important)
10
10
  - [Commands](##commands)
11
11
 
12
+ ## Installation
13
+
14
+ Be sure to use the -g flag to install globally.
15
+
16
+ ``npm install -g cloudmason``
12
17
 
13
18
 
14
19
  ## Quick Start
@@ -18,12 +23,15 @@ Get an Ec2 nodejs app up and running in 4 commands.
18
23
  1. **Prereqs**
19
24
  1. Open an AWS account
20
25
  2. Download and set up the AWS CLI (or just set your AWS credentials with enviroment variables)
21
- 3. Buy a domain to deploy apps to
22
- 4. Run the following command to set up your org:
23
- - `init-org -name MyOrg -region us-east-1`
26
+ 3. Ensure you have a domain to deploy apps to
27
+ 4. Make sure you have nodejs version 18+ installed
28
+ 5. Install the cloudmason CLI
29
+ - `npm install -g cloudmason`
30
+ 6. Run the following command to set up your org:
31
+ - `mason init-org -name MyOrg -region us-east-1`
24
32
  2. **Set up a Local App Template**
25
33
  1. Get a sample nodejs app template:
26
- - `mason starter -p ./myDesktop/MyFirstApp -type asg`
34
+ - `mason starter -p ./myDesktop/MyFirstApp -type asg -l node`
27
35
  3. **Add an App**
28
36
  ```
29
37
  mason new-app -name MyFirstApp -type asg
@@ -31,12 +39,12 @@ mason new-instance -app MyFirstApp -domain myfirstapp.com -region us-east-2 -adm
31
39
  mason update-app -app MyFirstApp -v 1.0 -path ./myDesktop/HelloWorld
32
40
  mason list-apps
33
41
  ```
34
- 4. **Launch it**
42
+ 1. **Launch it**
35
43
  ```
36
44
  mason launch -app MyFirstApp -v 1.0 -domain myfirstapp.com
37
45
  mason inspect -app MyFirstApp -domain myfirstapp.com -boot
38
46
  ```
39
- 5. **Review It**
47
+ 1. **Review It**
40
48
  1. Visit the domain you specified. You'll see a login page.
41
49
  2. Check the email address you specified for a temp password. Use it to log in.
42
50
  3. After logging in, you'll see a "Hello World" page.
@@ -44,8 +52,9 @@ mason inspect -app MyFirstApp -domain myfirstapp.com -boot
44
52
  #### All Together
45
53
 
46
54
  ```
47
- init-org -name MyOrg -region us-east-1
48
- mason starter -p ./myDesktop/MyFirstApp -type asg
55
+ npm install -g cloudmason
56
+ mason init-org -name MyOrg -region us-east-1
57
+ mason starter -p ./myDesktop/MyFirstApp -type asg -l node
49
58
  mason new-app -name MyFirstApp -type asg
50
59
  mason new-instance -app MyFirstApp -domain myfirstapp.com -region us-east-2 -admin me@gmail.com
51
60
  mason update-app -app MyFirstApp -v 1.0 -path ./myDesktop/MyFirstApp
@@ -339,35 +348,3 @@ mason starter -type asg -l node -path ../myfirstapp
339
348
 
340
349
 
341
350
 
342
- ## TODO
343
-
344
- - [x] Run logs
345
- - [x] Read token
346
- - [x] Verify token
347
- - [x] Get user groups
348
- - [x] DDB connect
349
- - [x] Fix starter routes
350
- - [x] Add arguments for max ec2 instance and instance type
351
- - [X] Customize boot script
352
- - [x] Secure param permissions
353
- - [X] Pass node/py versions
354
- - [X] Pass version info to instance
355
- - [X] Fix Delete App
356
- - [X] Update default instance
357
- - [X] Pass Env to instance
358
- - [] Custom SES Config
359
- - [X] Fix logs
360
- - [] Add dev
361
- - [] Add Admin
362
- - [] Cloudtrails
363
- - [] Static site
364
- - [] Deregistering in home region
365
- - [] cf-templates s3 bucket creation
366
-
367
- ## OPEN ITEMS
368
-
369
- - Custom auth domain
370
- - AWS requires ACM cert in us-east-1 for custom Cognito auth domain. Cloudformation does not allow for cross-region resource creation
371
- - [Github AWS Issue](https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/523)
372
-
373
-
@@ -9,7 +9,9 @@ exports.main = function(args){
9
9
 
10
10
  // Resolve Output Path
11
11
  const outputPath = path.resolve(args.p);
12
- const starterPath = `./commands/starters/${args.type}${args.l ? `_${args.l}` : ''}`;
12
+ const starterRelPath = `starters/${args.type}${args.l ? `_${args.l}` : ''}`;
13
+ const starterPath = path.join(__dirname, starterRelPath);
14
+
13
15
 
14
16
  // Copy Directory
15
17
  console.log(`Creating dir ${outputPath}`);
package/main.js CHANGED
@@ -128,6 +128,8 @@ const Commands = {
128
128
  }
129
129
 
130
130
  async function main(){
131
+ const nodeVersion = checkNodeVersion();
132
+
131
133
  const orgExists = await readOrgInfo();
132
134
  if (orgExists){
133
135
  console.log(`>>>> ${process.env.orgName} <<<<`);
@@ -186,6 +188,14 @@ async function main(){
186
188
  /////////////////////////////////
187
189
  ////////////////////////////////
188
190
 
191
+ function checkNodeVersion() {
192
+ const requiredVersion = 16;
193
+ const currentVersion = process.version.split('.')[0].replace('v', '');
194
+
195
+ if (parseInt(currentVersion) < requiredVersion) {
196
+ throw new Error(`Node.js version is less than ${requiredVersion}. Current version: ${process.version}`);
197
+ }
198
+ }
189
199
 
190
200
  async function readOrgInfo(){
191
201
  const orgPath = path.resolve(__dirname,'org.txt');
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"cloudmason","version":"1.0.2","description":"","main":"main.js","scripts":{"build":"node build.js"},"bin":{"mason":"./main.js"},"repository":{"type":"git","url":"https://github.com/kai-harvey/secure-saas.git"},"author":"Kai Harvey","license":"ISC","dependencies":{"@aws-sdk/client-acm":"^3.418.0","@aws-sdk/client-auto-scaling":"^3.470.0","@aws-sdk/client-cloudformation":"^3.418.0","@aws-sdk/client-ec2":"^3.416.0","@aws-sdk/client-iam":"^3.418.0","@aws-sdk/client-route-53":"^3.425.0","@aws-sdk/client-s3":"^3.418.0","@aws-sdk/client-ssm":"^3.421.0","adm-zip":"^0.5.10"}}
1
+ {"name":"cloudmason","version":"1.0.4","description":"","main":"main.js","scripts":{"build":"node build.js"},"bin":{"mason":"./main.js"},"repository":{"type":"git","url":"https://github.com/kai-harvey/secure-saas.git"},"author":"Kai Harvey","license":"ISC","dependencies":{"@aws-sdk/client-acm":"^3.418.0","@aws-sdk/client-auto-scaling":"^3.470.0","@aws-sdk/client-cloudformation":"^3.418.0","@aws-sdk/client-ec2":"^3.416.0","@aws-sdk/client-iam":"^3.418.0","@aws-sdk/client-route-53":"^3.425.0","@aws-sdk/client-s3":"^3.418.0","@aws-sdk/client-ssm":"^3.421.0","adm-zip":"^0.5.10"}}