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.1.6 to 0.1.7

2

package.json
{
"name": "terraform-generator",
"version": "0.1.6",
"version": "0.1.7",
"author": "Ah Zhe",

@@ -5,0 +5,0 @@ "description": "Generate Terraform plan using Node.js.",

@@ -11,2 +11,6 @@ # **terraform-generator**

## **Disclamer**
This module is still in development and testing phase, it might not work fully correctly. Feel free to report issues/bugs, make requests or give suggesstions in GitHub page.
## **Benefit**

@@ -26,2 +30,69 @@

## **Install via NPM**
```
npm install terraform-generator
```
## **Usage**
### **Initiate TerraformGenerator**
```javascript
const tfGenerator = new TerraformGenerator({ version: '0.12' });
```
### **Block**
Block's arguments are not typed, please refer to official Terraform documentation on what arguments can be supplied.
```javascript
new Provider(tfGenerator, 'aws', {
region: 'ap-southeast-1',
profile: 'example'
});
const vpc = new Resource(tfGenerator, 'aws_vpc', 'vpc', {
cidr_block: '172.88.0.0/16'
});
```
### **Argument Types**
```javascript
{
string: 'str',
number: 123,
boolean: true,
stringList: ['str1', 'str2', 'str3'],
numberList: [111, 222, 333],
booleanList: [true, false, true],
tuple: ['str', 123, true],
object: {
arg1: 'str',
arg2: 123,
arg3: true
},
objectList: [
{
arg1: 'str'
},
{
arg1: 'str'
}
],
map: new Map({
arg1: 'str',
arg2: 123,
arg3: true
}),
resourceAttribute: resource.getAttribute('attributeName')
}
```
### **Attribute**
```javascript
resource.getAttribute('id') // resource id, string
resource.getAttribute('subnets') // subnet objects, object list
resource.getAttribute('subnets.*.id') // subnet ids, string list
resource.getAttribute('subnets.*.id[0]') // first subnet id, string
```
## **Example**

@@ -28,0 +99,0 @@ ```javascript

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