Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

terraform-generator

Package Overview
Dependencies
Maintainers
1
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terraform-generator - npm Package Compare versions

Comparing version 0.2.3 to 0.3.0

dist/utils/index.d.ts

6

package.json
{
"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 });
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc