terraform-generator
Advanced tools
Comparing version 0.2.3 to 0.3.0
{ | ||
"name": "terraform-generator", | ||
"version": "0.2.3", | ||
"version": "0.3.0", | ||
"author": "Ah Zhe", | ||
@@ -28,4 +28,8 @@ "description": "Generate Terraform plan using Node.js.", | ||
}, | ||
"dependencies": { | ||
"shelljs": "^0.8.3" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^25.1.1", | ||
"@types/shelljs": "^0.8.6", | ||
"@typescript-eslint/eslint-plugin": "^1.7.0", | ||
@@ -32,0 +36,0 @@ "@typescript-eslint/parser": "^1.7.0", |
@@ -112,5 +112,16 @@ # **terraform-generator** | ||
### **Utils** | ||
```javascript | ||
import { writePlan } from 'terraform-generator/utils'; | ||
// Write Terraform plan to a file | ||
// Default filename is terraform.tf | ||
// Default format is false, if format is true, Terraform needs to be installed | ||
writePlan(tfg.generate(), 'output', { filename: 'output.tf', format: true }); | ||
``` | ||
## **Example** | ||
```javascript | ||
import TerraformGenerator, { Provider, Resource, DataSource, Output, Map } from 'terraform-generator'; | ||
import { writePlan } from 'terraform-generator/utils'; | ||
import fs from 'fs'; | ||
@@ -211,4 +222,4 @@ import path from 'path'; | ||
// Write the plan into a terraform.tf file | ||
const outputPath = path.join('output', configs.env, 'subnets', 'terraform.tf'); | ||
fs.writeFileSync(outputPath, tfg.generate()); | ||
const outputDir = path.join('output', configs.env, 'subnets'); | ||
writePlan(tfg.generate(), outputDir, { format: true }); | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24479
32
528
223
1
11
1
+ Addedshelljs@^0.8.3
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedinterpret@1.4.0(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedrechoir@0.6.2(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedshelljs@0.8.5(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedwrappy@1.0.2(transitive)