kumogata-template 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kumogata/template/helper.rb +4 -0
- data/lib/kumogata/template/version.rb +1 -1
- data/template/iam-group.rb +2 -2
- data/template/iam-role.rb +2 -2
- data/template/iam-user.rb +2 -2
- data/test/template/iam-group_test.rb +1 -0
- data/test/template/iam-role_test.rb +2 -1
- data/test/template/iam-user_test.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfb8da003274134b052eccee417405a9152c339a
|
4
|
+
data.tar.gz: 4df892faee4b82571c4a7453ffea99d8234c3d32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dfa6687d54fb12e4d60f1559c93685108fdaede85d40f46541b719b16413a63d803a907bb15788fae30854426eb71aa2401ed0693ab344d404759e9f871d1e7
|
7
|
+
data.tar.gz: f5a84d413471ab5e4b2f1086866554842610114f5a3f70ad218fe50e23c7f87dd3f3bc171fe47f69785764440d77c3e3079f82b6b255b08b895ef92293c9f6bc
|
@@ -40,6 +40,10 @@ def _valid_numbers(value, min = 0, max = 0, default = nil)
|
|
40
40
|
(min <= number and number <= max) ? number : default
|
41
41
|
end
|
42
42
|
|
43
|
+
def _real_name(name)
|
44
|
+
name.gsub(' ', '-')
|
45
|
+
end
|
46
|
+
|
43
47
|
def _ref_string(name, args, ref_name = "")
|
44
48
|
return args[name.to_sym].to_s || "" unless args.key? "ref_#{name}".to_sym
|
45
49
|
|
@@ -1 +1 @@
|
|
1
|
-
KUMOGATA_TEMPLATE_VERSION = '0.0.
|
1
|
+
KUMOGATA_TEMPLATE_VERSION = '0.0.10'
|
data/template/iam-group.rb
CHANGED
@@ -6,7 +6,7 @@ require 'kumogata/template/helper'
|
|
6
6
|
require 'kumogata/template/iam'
|
7
7
|
|
8
8
|
name = _resource_name(args[:name], "group")
|
9
|
-
group = args[:group] ||
|
9
|
+
group = _real_name(args[:group] || args[:name])
|
10
10
|
managed_policies =
|
11
11
|
if args.key? :managed_policies
|
12
12
|
_iam_managed_policies(args)
|
@@ -19,7 +19,7 @@ policies = _iam_policies("policies", args)
|
|
19
19
|
_(name) do
|
20
20
|
Type "AWS::IAM::Group"
|
21
21
|
Properties do
|
22
|
-
GroupName group
|
22
|
+
GroupName group
|
23
23
|
ManagedPolicyArns managed_policies unless managed_policies.empty?
|
24
24
|
Path path
|
25
25
|
Policies policies unless policies.empty?
|
data/template/iam-role.rb
CHANGED
@@ -15,7 +15,7 @@ managed_policies =
|
|
15
15
|
end
|
16
16
|
path = args[:path] || "/"
|
17
17
|
policies = _iam_policies("policies", args)
|
18
|
-
role = args[:role] ||
|
18
|
+
role = _real_name(args[:role] || args[:name])
|
19
19
|
|
20
20
|
_(name) do
|
21
21
|
Type "AWS::IAM::Role"
|
@@ -27,6 +27,6 @@ _(name) do
|
|
27
27
|
ManagedPolicyArns managed_policies unless managed_policies.empty?
|
28
28
|
Path path
|
29
29
|
Policies policies unless policies.empty?
|
30
|
-
RoleName role
|
30
|
+
RoleName role
|
31
31
|
end
|
32
32
|
end
|
data/template/iam-user.rb
CHANGED
@@ -21,7 +21,7 @@ managed_policies =
|
|
21
21
|
end
|
22
22
|
path = args[:path] || "/"
|
23
23
|
policies = _iam_policies("policies", args)
|
24
|
-
user = args[:user] ||
|
24
|
+
user = _real_name(args[:user] || args[:name])
|
25
25
|
|
26
26
|
_(name) do
|
27
27
|
Type "AWS::IAM::User"
|
@@ -31,6 +31,6 @@ _(name) do
|
|
31
31
|
ManagedPolicyArns managed_policies unless managed_policies.empty?
|
32
32
|
Path path
|
33
33
|
Policies policies unless policies.empty?
|
34
|
-
UserName user
|
34
|
+
UserName user
|
35
35
|
end
|
36
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kumogata-template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naoya Nakazawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|