cloudmason 1.0.4 → 1.0.5

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.
@@ -32,7 +32,6 @@ exports.deployOrgStack = async function(region,params){
32
32
  return result.StackId;
33
33
  } catch (e){
34
34
  if (/AlreadyExistsException/.test(e)){
35
- console.log('Stack exists ' + stackName);
36
35
  return false;
37
36
  } else {
38
37
  throw new Error(e.message)
@@ -28,21 +28,20 @@ exports.main = async function(args){
28
28
  return true;
29
29
  }
30
30
 
31
+ exports.setOrg = async function(args){
32
+ // Set org.txt
33
+ const orgPath = path.resolve(__dirname,'..','org.txt');
34
+ const orgData = `${args.name},${args.region}`;
35
+ fs.writeFileSync(orgPath,orgData,'utf-8')
36
+ console.log('Set org:',orgData)
37
+ return true;
38
+ }
39
+
31
40
 
32
41
  /////////////////////////////////////////
33
42
  ////////////// FUNCS ////////////////////
34
43
  ////////////////////////////////////////
35
44
 
36
- async function bucketExists(bucketName,region){
37
- const client = new S3Client({region});
38
- try {
39
- await client.send(new HeadBucketCommand({ Bucket: bucketName }));
40
- return true;
41
- } catch (e){
42
- return false;
43
- }
44
- }
45
-
46
45
  async function getDefaultVPC(region){
47
46
  const ec2Client = new EC2Client({ region });
48
47
  const response = await ec2Client.send(new DescribeVpcsCommand({ Filters: [{ Name: "isDefault", Values: ["true"] }] }));
package/main.js CHANGED
@@ -14,6 +14,14 @@ const Commands = {
14
14
  {n: 'region', desc: 'AWS Region for Core Assets. Default us-east-1', r: false}
15
15
  ]
16
16
  },
17
+ 'set-org': {
18
+ desc: "Set an exsiting organization",
19
+ exec: require('./commands/init_org').setOrg,
20
+ args: [
21
+ {n: 'name', desc: 'Unique org Name. Letters only', r: true, pattern: `[A-Za-z]{2,20}`},
22
+ {n: 'region', desc: 'AWS Region for Core Assets. Default us-east-1', r: false}
23
+ ]
24
+ },
17
25
  'new-app': {
18
26
  desc: 'Add a new application',
19
27
  exec: require('./commands/new_app').main,
package/package.json CHANGED
@@ -1 +1 @@
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"}}
1
+ {"name":"cloudmason","version":"1.0.5","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"}}