cfnlego 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4a65d25bb01d5ae62bbf42b3a0342d62e485f69
4
- data.tar.gz: 426d636c79930d56663e9cc1610b62cbac2e6209
3
+ metadata.gz: 3ba0d4884e48b1e336e94f1ca750f1b06b39ec4d
4
+ data.tar.gz: 3fc1e970ef70a48ff862f8d631b2c366fe810448
5
5
  SHA512:
6
- metadata.gz: 992a76eb9a0b50789ada24f79205fc09c07bf6250f1e56f69732e1b90b37fa3a917735b59f9b92a85304679eac7bd28e16320514755acc56fb5363313deeb063
7
- data.tar.gz: 3581e294307d8c84d9499d7034fffe2556ad7e0f593d67eddc430a746631d4cf759769269c554d946961125d14b2a48e605a6a6ed0ac8e452f8164977940f455
6
+ metadata.gz: 373361a8e6bc7cb6e27aadcd02b8829f2d5b6061f295d792fec613a405192287243482091db85e5ea9f3006410dab93e505c1f2bbfacb459fa9c929cb46c685f
7
+ data.tar.gz: 2cea0934b9a8c13c347db9deed8b95050c72d812a2e35d66f1f5401bc8956ef846013165e02f4dbe348f858d509d5f6733a43af1c4f56d2b5d6567f8d4701df6
data/README.md CHANGED
@@ -7,7 +7,7 @@ cfnlego
7
7
 
8
8
  cfnlego is built to quickly bootstrap CloudFormation development with cfndsl.
9
9
 
10
- It provides templates for all AWS Resources and simply bake them into a template
10
+ It provides templates for eventurally all (WIP) AWS Resources and simply bake them into a template
11
11
 
12
12
  ### How to use
13
13
 
@@ -30,6 +30,20 @@ Example:
30
30
  --reousrce IAM::InstanceProfile,InstanceProfile \
31
31
  ```
32
32
 
33
+ ### Current Supported Resources
34
+
35
+ - AWS::AutoScaling::AutoScalingGroup
36
+ - AWS::AutoScaling::LaunchConfiguration
37
+ - AWS::AutoScaling::LifecycleHook
38
+ - AWS::CloudWatch::Alarm
39
+ - AWS::ElasticLoadBalancing::LoadBalancer
40
+ - AWS::IAM::InstanceProfile
41
+ - AWS::IAM::ManagedPolicy
42
+ - AWS::IAM::Role
43
+ - AWS::Lambda::Function
44
+ - AWS::SNS::Topic
45
+ - AWS::SNS::TopicPolicy
46
+
33
47
  ### License
34
48
 
35
49
  The MIT License (MIT)
data/bin/cfnlego CHANGED
@@ -3,10 +3,8 @@ require_relative '../lib/cfnlego'
3
3
  require 'optparse'
4
4
  require 'ruby-beautify'
5
5
 
6
- @indent_token = " "
7
- @indent_count = 2
8
6
  include RubyBeautify
9
- options = {resources: []}
7
+ options = {resources: [], indent_token: " ", indent_count: 2}
10
8
  OptionParser.new do |opts|
11
9
  opts.banner = "Usage: cfnlego --reousrce resource [options]"
12
10
 
@@ -15,7 +13,7 @@ OptionParser.new do |opts|
15
13
  end
16
14
 
17
15
  opts.on("-i", "--indent TOKEN", "Use TOKEN for indent character (default space)") do |i|
18
- @indent_token = i
16
+ options[:indent_token] = i
19
17
  end
20
18
 
21
19
  opts.on("-c",
@@ -23,7 +21,7 @@ OptionParser.new do |opts|
23
21
  Integer,
24
22
  "Count of characters to use for indenting. (default: 2)") \
25
23
  do |count|
26
- @indent_count = count
24
+ options[:indent_count] = count
27
25
  end
28
26
 
29
27
  opts.on("-h", "--help", "Prints this help") do
@@ -38,6 +36,11 @@ EXAMPLE
38
36
 
39
37
  exit
40
38
  end
39
+
40
+ opts.on("-v", "--version", "Show version") do
41
+ puts Cfnlego::VERSION
42
+ exit
43
+ end
41
44
  end.parse!
42
45
 
43
46
  # Constructure Resources
@@ -51,5 +54,5 @@ options[:resources].each do |r|
51
54
  end
52
55
 
53
56
  puts pretty_string Cfnlego::CloudFormation.new(resources).render,
54
- indent_token: @indent_token,
55
- indent_count: @indent_count
57
+ indent_token: options[:indent_token],
58
+ indent_count: options[:indent_count]
@@ -0,0 +1,33 @@
1
+ AWS::IAM::ManagedPolicy:
2
+ Properties:
3
+ Description: "\"Managed Policy\""
4
+ Path: "\"/path/\""
5
+ Groups: |
6
+ [ "GroupName" ]
7
+ Roles: |
8
+ [ "role name" ]
9
+ Users: |
10
+ [ "user name" ]
11
+ PolicyDocument: |
12
+ {
13
+ "Version" => "2012-10-17",
14
+ "Statement" => [
15
+ {
16
+ "Effect" => "Allow",
17
+ "Action" => "rds:CreateDBInstance",
18
+ "Resource" => FnJoin("", [ "arn:aws:rds:", Ref("AWS::Region"), ":", Ref("AWS::AccountId") , ":db:test*" ]),
19
+ "Condition" => {
20
+ "StringEquals" => { "rds:DatabaseEngine" => "mysql" }
21
+ }
22
+ },
23
+ {
24
+ "Effect" => "Allow",
25
+ "Action" => "rds:CreateDBInstance",
26
+ "Resource" => FnJoin("", ["arn:aws:rds:", Ref("AWS::Region"), ":", Ref("AWS::Region"), ":db:test*"]),
27
+ "Condition" => {
28
+ "StringEquals" => { "rds:DatabaseClass" => "db.t2.micro" }
29
+ }
30
+ }
31
+ ]
32
+ }
33
+
@@ -1,3 +1,3 @@
1
1
  module Cfnlego
2
- VERSION='0.0.5'
2
+ VERSION='0.0.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfnlego
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Yung
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-25 00:00:00.000000000 Z
11
+ date: 2015-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,6 +80,7 @@ files:
80
80
  - lib/cfnlego/resources/CloudWatch/Alarm.yaml
81
81
  - lib/cfnlego/resources/ElasticLoadBalancing/LoadBalancer.yaml
82
82
  - lib/cfnlego/resources/IAM/InstanceProfile.yaml
83
+ - lib/cfnlego/resources/IAM/ManagedPolicy.yaml
83
84
  - lib/cfnlego/resources/IAM/Role.yaml
84
85
  - lib/cfnlego/resources/Lambda/Function.yaml
85
86
  - lib/cfnlego/resources/SNS/Topic.yaml