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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 063912b82b18c9a130a16a05acb748d59290cd50
4
- data.tar.gz: 7bdaf0c062c96726fa3960d05a5989fa4c8f6272
3
+ metadata.gz: cfb8da003274134b052eccee417405a9152c339a
4
+ data.tar.gz: 4df892faee4b82571c4a7453ffea99d8234c3d32
5
5
  SHA512:
6
- metadata.gz: 171ad99cf8879e2d58ad3e6eb8f693ab89dea17f39fc823e5e0581164ee644df209a4464d15a4be38147240bb4402c8b5b3c9893a7f70a332dda142a6735d55c
7
- data.tar.gz: 01ed15da699434d6820e494a7023391abc01993bf93a8643b02c277e3635d0ed906fff3df3aab29a26588c39218e7b8358802043d763dc1d3a78ffcd6ff27661
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.9'
1
+ KUMOGATA_TEMPLATE_VERSION = '0.0.10'
@@ -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 unless group.empty?
22
+ GroupName group
23
23
  ManagedPolicyArns managed_policies unless managed_policies.empty?
24
24
  Path path
25
25
  Policies policies unless policies.empty?
@@ -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 unless role.empty?
30
+ RoleName role
31
31
  end
32
32
  end
@@ -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 unless user.empty?
34
+ UserName user
35
35
  end
36
36
  end
@@ -11,6 +11,7 @@ _iam_group "test"
11
11
  "TestGroup": {
12
12
  "Type": "AWS::IAM::Group",
13
13
  "Properties": {
14
+ "GroupName": "test",
14
15
  "Path": "/"
15
16
  }
16
17
  }
@@ -27,7 +27,8 @@ _iam_role "test", user: "test", service: "s3"
27
27
  }
28
28
  ]
29
29
  },
30
- "Path": "/"
30
+ "Path": "/",
31
+ "RoleName": "test"
31
32
  }
32
33
  }
33
34
  }
@@ -11,7 +11,8 @@ _iam_user "test"
11
11
  "TestUser": {
12
12
  "Type": "AWS::IAM::User",
13
13
  "Properties": {
14
- "Path": "/"
14
+ "Path": "/",
15
+ "UserName": "test"
15
16
  }
16
17
  }
17
18
  }
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.9
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 00:00:00.000000000 Z
11
+ date: 2016-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk