terraform-generator
Advanced tools
Comparing version 0.1.6 to 0.1.7
{ | ||
"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 |
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
20222
191
0