tfmod-generator 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/bin/tfmod +8 -4
- data/lib/tfmod/generator/version.rb +1 -1
- data/templates/test.tf.erb +28 -0
- data/templates/variables.tf.erb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30e5c6cfa3eb6fc7ddf9e9294bf207072dc48819
|
4
|
+
data.tar.gz: 9ca187e5d06b65b7d68430b44f4d7429b71a2c3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b798a98c66b7d4ef763f39bb832d4077d7ee35ac5bad41b2b7d794b32051cd3b20de565995e51c0b18466965a300e84b280286663fbb05854ef47fa949904067
|
7
|
+
data.tar.gz: c15f008f5ab533fc31e42cefad5bdefe35863f878d251782364f4092242fc4a4ba7f6e109b516b65d2e327a3aa1667ec47407d7ec6b61a03b5a28fa3bdd61569
|
data/README.md
CHANGED
@@ -19,9 +19,13 @@ $ tfmod zookeeper
|
|
19
19
|
create zookeeper/main.tf
|
20
20
|
create zookeeper/outputs.tf
|
21
21
|
create zookeeper/variables.tf
|
22
|
+
create zookeeper/remote_scripts
|
23
|
+
create zookeeper/remote_scripts/user-data.sh.tpl
|
22
24
|
create zookeeper/test
|
25
|
+
create zookeeper/test/test.tf
|
23
26
|
run git init zookeeper from "."
|
24
27
|
Initialized empty Git repository in /Users/zane/src/tfmod-generator/zookeeper/.git/
|
28
|
+
/Users/zane/src/tfmod-generator/zookeeper created!
|
25
29
|
```
|
26
30
|
|
27
31
|
## Development
|
data/bin/tfmod
CHANGED
@@ -6,7 +6,7 @@ require 'tfmod/generator'
|
|
6
6
|
# Main class
|
7
7
|
class TfModuleGenerator < Thor::Group
|
8
8
|
include Thor::Actions
|
9
|
-
# Override namespace which defaults to classname
|
9
|
+
# Override namespace which defaults to classname
|
10
10
|
# http://www.rubydoc.info/github/erikhuda/thor/Thor%2FBase%2FClassMethods:namespace
|
11
11
|
namespace :''
|
12
12
|
argument :name
|
@@ -51,12 +51,16 @@ class TfModuleGenerator < Thor::Group
|
|
51
51
|
empty_directory("#{name}/test")
|
52
52
|
end
|
53
53
|
|
54
|
+
def create_test_file
|
55
|
+
template('../templates/test.tf.erb', "#{name}/test/test.tf")
|
56
|
+
end
|
57
|
+
|
54
58
|
def git_init
|
55
59
|
run("git init #{name}")
|
56
60
|
end
|
57
|
-
|
58
|
-
def create_module_done
|
59
|
-
puts "#{name} created!"
|
61
|
+
|
62
|
+
def create_module_done
|
63
|
+
puts "#{Dir.pwd}/#{name} created!"
|
60
64
|
end
|
61
65
|
end
|
62
66
|
|
@@ -0,0 +1,28 @@
|
|
1
|
+
provider "aws" {
|
2
|
+
region = "us-west-2"
|
3
|
+
}
|
4
|
+
|
5
|
+
// test module useage
|
6
|
+
module '<%= name %>' {
|
7
|
+
source = "../"
|
8
|
+
name = "terraform-test-<%= name %>"
|
9
|
+
tags = {
|
10
|
+
team = "${var.tags["team"]}"
|
11
|
+
product = "${var.tags["product"]}"
|
12
|
+
service = "${var.tags["service"]}"
|
13
|
+
environment = "${var.tags["environment"]}"
|
14
|
+
owner = "${var.tags["owner"]}"
|
15
|
+
}
|
16
|
+
|
17
|
+
// The variables file for <%= name.capitalize %> test
|
18
|
+
variables "tags" {
|
19
|
+
type = "map"
|
20
|
+
|
21
|
+
default = {
|
22
|
+
team = "dataplatform"
|
23
|
+
product = "silverbullet"
|
24
|
+
service = "microservice1"
|
25
|
+
environment = "dev"
|
26
|
+
owner = "zane"
|
27
|
+
}
|
28
|
+
}
|
data/templates/variables.tf.erb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tfmod-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- templates/gitignore.erb
|
106
106
|
- templates/main.tf.erb
|
107
107
|
- templates/outputs.tf.erb
|
108
|
+
- templates/test.tf.erb
|
108
109
|
- templates/user-data.sh.erb
|
109
110
|
- templates/variables.tf.erb
|
110
111
|
- tfmod-generator.gemspec
|