aws-insight 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +84 -0
  5. data/.travis.yml +19 -0
  6. data/CHANGELOG.md +336 -0
  7. data/CODE_OF_CONDUCT.md +13 -0
  8. data/CONTRIBUTING.md +62 -0
  9. data/Gemfile +19 -0
  10. data/Guardfile +12 -0
  11. data/LICENSE +22 -0
  12. data/README.md +393 -0
  13. data/Rakefile +6 -0
  14. data/bin/terraforming +5 -0
  15. data/contrib/zsh-completion/_terraforming +65 -0
  16. data/lib/terraforming.rb +54 -0
  17. data/lib/terraforming/cli.rb +340 -0
  18. data/lib/terraforming/resource/alb.rb +98 -0
  19. data/lib/terraforming/resource/auto_scaling_group.rb +90 -0
  20. data/lib/terraforming/resource/cloud_watch_alarm.rb +87 -0
  21. data/lib/terraforming/resource/config.rb +98 -0
  22. data/lib/terraforming/resource/db_parameter_group.rb +58 -0
  23. data/lib/terraforming/resource/db_security_group.rb +57 -0
  24. data/lib/terraforming/resource/db_subnet_group.rb +52 -0
  25. data/lib/terraforming/resource/ec2.rb +130 -0
  26. data/lib/terraforming/resource/efs_file_system.rb +60 -0
  27. data/lib/terraforming/resource/eip.rb +66 -0
  28. data/lib/terraforming/resource/elasti_cache_cluster.rb +80 -0
  29. data/lib/terraforming/resource/elasti_cache_subnet_group.rb +56 -0
  30. data/lib/terraforming/resource/elb.rb +203 -0
  31. data/lib/terraforming/resource/iam_group.rb +54 -0
  32. data/lib/terraforming/resource/iam_group_membership.rb +63 -0
  33. data/lib/terraforming/resource/iam_group_policy.rb +71 -0
  34. data/lib/terraforming/resource/iam_instance_profile.rb +54 -0
  35. data/lib/terraforming/resource/iam_policy.rb +63 -0
  36. data/lib/terraforming/resource/iam_policy_attachment.rb +86 -0
  37. data/lib/terraforming/resource/iam_role.rb +56 -0
  38. data/lib/terraforming/resource/iam_role_policy.rb +71 -0
  39. data/lib/terraforming/resource/iam_user.rb +55 -0
  40. data/lib/terraforming/resource/iam_user_policy.rb +71 -0
  41. data/lib/terraforming/resource/internet_gateway.rb +54 -0
  42. data/lib/terraforming/resource/kms_alias.rb +55 -0
  43. data/lib/terraforming/resource/kms_key.rb +84 -0
  44. data/lib/terraforming/resource/launch_configuration.rb +106 -0
  45. data/lib/terraforming/resource/nat_gateway.rb +57 -0
  46. data/lib/terraforming/resource/network_acl.rb +83 -0
  47. data/lib/terraforming/resource/network_interface.rb +68 -0
  48. data/lib/terraforming/resource/rds.rb +74 -0
  49. data/lib/terraforming/resource/redshift.rb +67 -0
  50. data/lib/terraforming/resource/route53_record.rb +106 -0
  51. data/lib/terraforming/resource/route53_zone.rb +89 -0
  52. data/lib/terraforming/resource/route_table.rb +122 -0
  53. data/lib/terraforming/resource/route_table_association.rb +59 -0
  54. data/lib/terraforming/resource/s3.rb +69 -0
  55. data/lib/terraforming/resource/security_group.rb +188 -0
  56. data/lib/terraforming/resource/sns_topic.rb +75 -0
  57. data/lib/terraforming/resource/sns_topic_subscription.rb +83 -0
  58. data/lib/terraforming/resource/sqs.rb +70 -0
  59. data/lib/terraforming/resource/subnet.rb +55 -0
  60. data/lib/terraforming/resource/vpc.rb +67 -0
  61. data/lib/terraforming/resource/vpn_gateway.rb +55 -0
  62. data/lib/terraforming/template/tf/alb.erb +28 -0
  63. data/lib/terraforming/template/tf/auto_scaling_group.erb +28 -0
  64. data/lib/terraforming/template/tf/cloud_watch_alarm.erb +33 -0
  65. data/lib/terraforming/template/tf/db_parameter_group.erb +17 -0
  66. data/lib/terraforming/template/tf/db_security_group.erb +26 -0
  67. data/lib/terraforming/template/tf/db_subnet_group.erb +8 -0
  68. data/lib/terraforming/template/tf/ec2.erb +56 -0
  69. data/lib/terraforming/template/tf/eip.erb +11 -0
  70. data/lib/terraforming/template/tf/elasti_cache_cluster.erb +22 -0
  71. data/lib/terraforming/template/tf/elasti_cache_subnet_group.erb +8 -0
  72. data/lib/terraforming/template/tf/elastic_filesystem.erb +18 -0
  73. data/lib/terraforming/template/tf/elb.erb +51 -0
  74. data/lib/terraforming/template/tf/iam_group.erb +7 -0
  75. data/lib/terraforming/template/tf/iam_group_membership.erb +8 -0
  76. data/lib/terraforming/template/tf/iam_group_policy.erb +10 -0
  77. data/lib/terraforming/template/tf/iam_instance_profile.erb +8 -0
  78. data/lib/terraforming/template/tf/iam_policy.erb +12 -0
  79. data/lib/terraforming/template/tf/iam_policy_attachment.erb +10 -0
  80. data/lib/terraforming/template/tf/iam_role.erb +10 -0
  81. data/lib/terraforming/template/tf/iam_role_policy.erb +10 -0
  82. data/lib/terraforming/template/tf/iam_user.erb +7 -0
  83. data/lib/terraforming/template/tf/iam_user_policy.erb +10 -0
  84. data/lib/terraforming/template/tf/internet_gateway.erb +14 -0
  85. data/lib/terraforming/template/tf/kms_alias.erb +7 -0
  86. data/lib/terraforming/template/tf/kms_key.erb +13 -0
  87. data/lib/terraforming/template/tf/launch_configuration.erb +68 -0
  88. data/lib/terraforming/template/tf/nat_gateway.erb +9 -0
  89. data/lib/terraforming/template/tf/network_acl.erb +43 -0
  90. data/lib/terraforming/template/tf/network_interface.erb +22 -0
  91. data/lib/terraforming/template/tf/rds.erb +25 -0
  92. data/lib/terraforming/template/tf/redshift.erb +23 -0
  93. data/lib/terraforming/template/tf/route53_record.erb +52 -0
  94. data/lib/terraforming/template/tf/route53_zone.erb +18 -0
  95. data/lib/terraforming/template/tf/route_table.erb +34 -0
  96. data/lib/terraforming/template/tf/route_table_association.erb +9 -0
  97. data/lib/terraforming/template/tf/s3.erb +12 -0
  98. data/lib/terraforming/template/tf/security_group.erb +56 -0
  99. data/lib/terraforming/template/tf/sns_topic.erb +17 -0
  100. data/lib/terraforming/template/tf/sns_topic_subscription.erb +23 -0
  101. data/lib/terraforming/template/tf/sqs.erb +21 -0
  102. data/lib/terraforming/template/tf/subnet.erb +15 -0
  103. data/lib/terraforming/template/tf/vpc.erb +15 -0
  104. data/lib/terraforming/template/tf/vpn_gateway.erb +14 -0
  105. data/lib/terraforming/util.rb +30 -0
  106. data/lib/terraforming/version.rb +3 -0
  107. data/script/console +14 -0
  108. data/script/generate +97 -0
  109. data/script/setup +7 -0
  110. data/templates/resource.erb.erb +3 -0
  111. data/templates/resource.rb.erb +31 -0
  112. data/templates/resource_spec.rb.erb +39 -0
  113. data/terraforming.gemspec +31 -0
  114. metadata +271 -0
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install $@
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,3 @@
1
+ resource "aws_<%= resource %>" "resource_name" {
2
+
3
+ }
@@ -0,0 +1,31 @@
1
+ module Terraforming
2
+ module Resource
3
+ class <%= camelize(resource) %>
4
+ include Terraforming::Util
5
+
6
+ # TODO: Select appropriate Client class from here:
7
+ # http://docs.aws.amazon.com/sdkforruby/api/index.html
8
+ def self.tf(client: Aws::SomeResource::Client.new)
9
+ self.new(client).tf
10
+ end
11
+
12
+ # TODO: Select appropriate Client class from here:
13
+ # http://docs.aws.amazon.com/sdkforruby/api/index.html
14
+ def self.tfstate(client: Aws::SomeResource::Client.new)
15
+ self.new(client).tfstate
16
+ end
17
+
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ def tf
23
+ apply_template(@client, "tf/<%= resource %>")
24
+ end
25
+
26
+ def tfstate
27
+
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,39 @@
1
+ require "spec_helper"
2
+
3
+ module Terraforming
4
+ module Resource
5
+ describe <%= camelize(resource) %> do
6
+ let(:client) do
7
+ # TODO: Select appropriate Client class from here:
8
+ # http://docs.aws.amazon.com/sdkforruby/api/index.html
9
+ Aws::SomeResource::Client.new(stub_responses: true)
10
+ end
11
+
12
+ describe ".tf" do
13
+ xit "should generate tf" do
14
+ expect(described_class.tf(client: client)).to eq <<-EOS
15
+ resource "aws_<%= resource %>" "resource_name" {
16
+
17
+ }
18
+
19
+ EOS
20
+ end
21
+ end
22
+
23
+ describe ".tfstate" do
24
+ xit "should generate tfstate" do
25
+ expect(described_class.tfstate(client: client)).to eq({
26
+ "aws_<%= resource %>.resource_name" => {
27
+ "type" => "aws_<%= resource %>",
28
+ "primary" => {
29
+ "id" => "",
30
+ "attributes" => {
31
+ }
32
+ }
33
+ }
34
+ })
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'terraforming/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "aws-insight"
8
+ spec.version = Terraforming::VERSION
9
+ spec.authors = ["Daisuke Fujita","Farid Nouri Neshat"]
10
+ spec.email = ["dtanshi45@gmail.com", "FaridN_SOAD@yahoo.com"]
11
+
12
+ spec.summary = %q{Show all AWS resources that are costing money}
13
+ spec.description = %q{Show all AWS resources that are costing money}
14
+ spec.homepage = "https://github.com/dtan4/terraforming"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "bin"
19
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_dependency "aws-sdk", "~> 2.10.17"
23
+ spec.add_dependency "multi_json", "~> 1.12.1"
24
+ spec.add_dependency "thor"
25
+
26
+ spec.add_development_dependency "bundler", "~> 1.7"
27
+ spec.add_development_dependency "coveralls", "~> 0.8.13"
28
+ spec.add_development_dependency "rake"
29
+ spec.add_development_dependency "rspec", "~> 3.2"
30
+ spec.add_development_dependency "simplecov", "~> 0.14.1"
31
+ end
metadata ADDED
@@ -0,0 +1,271 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aws-insight
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.14.0
5
+ platform: ruby
6
+ authors:
7
+ - Daisuke Fujita
8
+ - Farid Nouri Neshat
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2017-09-05 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: aws-sdk
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: 2.10.17
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: 2.10.17
28
+ - !ruby/object:Gem::Dependency
29
+ name: multi_json
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: 1.12.1
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: 1.12.1
42
+ - !ruby/object:Gem::Dependency
43
+ name: thor
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: bundler
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '1.7'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '1.7'
70
+ - !ruby/object:Gem::Dependency
71
+ name: coveralls
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: 0.8.13
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: 0.8.13
84
+ - !ruby/object:Gem::Dependency
85
+ name: rake
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ name: rspec
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: '3.2'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '3.2'
112
+ - !ruby/object:Gem::Dependency
113
+ name: simplecov
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: 0.14.1
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - "~>"
124
+ - !ruby/object:Gem::Version
125
+ version: 0.14.1
126
+ description: Show all AWS resources that are costing money
127
+ email:
128
+ - dtanshi45@gmail.com
129
+ - FaridN_SOAD@yahoo.com
130
+ executables:
131
+ - terraforming
132
+ extensions: []
133
+ extra_rdoc_files: []
134
+ files:
135
+ - ".gitignore"
136
+ - ".rspec"
137
+ - ".rubocop.yml"
138
+ - ".travis.yml"
139
+ - CHANGELOG.md
140
+ - CODE_OF_CONDUCT.md
141
+ - CONTRIBUTING.md
142
+ - Gemfile
143
+ - Guardfile
144
+ - LICENSE
145
+ - README.md
146
+ - Rakefile
147
+ - bin/terraforming
148
+ - contrib/zsh-completion/_terraforming
149
+ - lib/terraforming.rb
150
+ - lib/terraforming/cli.rb
151
+ - lib/terraforming/resource/alb.rb
152
+ - lib/terraforming/resource/auto_scaling_group.rb
153
+ - lib/terraforming/resource/cloud_watch_alarm.rb
154
+ - lib/terraforming/resource/config.rb
155
+ - lib/terraforming/resource/db_parameter_group.rb
156
+ - lib/terraforming/resource/db_security_group.rb
157
+ - lib/terraforming/resource/db_subnet_group.rb
158
+ - lib/terraforming/resource/ec2.rb
159
+ - lib/terraforming/resource/efs_file_system.rb
160
+ - lib/terraforming/resource/eip.rb
161
+ - lib/terraforming/resource/elasti_cache_cluster.rb
162
+ - lib/terraforming/resource/elasti_cache_subnet_group.rb
163
+ - lib/terraforming/resource/elb.rb
164
+ - lib/terraforming/resource/iam_group.rb
165
+ - lib/terraforming/resource/iam_group_membership.rb
166
+ - lib/terraforming/resource/iam_group_policy.rb
167
+ - lib/terraforming/resource/iam_instance_profile.rb
168
+ - lib/terraforming/resource/iam_policy.rb
169
+ - lib/terraforming/resource/iam_policy_attachment.rb
170
+ - lib/terraforming/resource/iam_role.rb
171
+ - lib/terraforming/resource/iam_role_policy.rb
172
+ - lib/terraforming/resource/iam_user.rb
173
+ - lib/terraforming/resource/iam_user_policy.rb
174
+ - lib/terraforming/resource/internet_gateway.rb
175
+ - lib/terraforming/resource/kms_alias.rb
176
+ - lib/terraforming/resource/kms_key.rb
177
+ - lib/terraforming/resource/launch_configuration.rb
178
+ - lib/terraforming/resource/nat_gateway.rb
179
+ - lib/terraforming/resource/network_acl.rb
180
+ - lib/terraforming/resource/network_interface.rb
181
+ - lib/terraforming/resource/rds.rb
182
+ - lib/terraforming/resource/redshift.rb
183
+ - lib/terraforming/resource/route53_record.rb
184
+ - lib/terraforming/resource/route53_zone.rb
185
+ - lib/terraforming/resource/route_table.rb
186
+ - lib/terraforming/resource/route_table_association.rb
187
+ - lib/terraforming/resource/s3.rb
188
+ - lib/terraforming/resource/security_group.rb
189
+ - lib/terraforming/resource/sns_topic.rb
190
+ - lib/terraforming/resource/sns_topic_subscription.rb
191
+ - lib/terraforming/resource/sqs.rb
192
+ - lib/terraforming/resource/subnet.rb
193
+ - lib/terraforming/resource/vpc.rb
194
+ - lib/terraforming/resource/vpn_gateway.rb
195
+ - lib/terraforming/template/tf/alb.erb
196
+ - lib/terraforming/template/tf/auto_scaling_group.erb
197
+ - lib/terraforming/template/tf/cloud_watch_alarm.erb
198
+ - lib/terraforming/template/tf/db_parameter_group.erb
199
+ - lib/terraforming/template/tf/db_security_group.erb
200
+ - lib/terraforming/template/tf/db_subnet_group.erb
201
+ - lib/terraforming/template/tf/ec2.erb
202
+ - lib/terraforming/template/tf/eip.erb
203
+ - lib/terraforming/template/tf/elasti_cache_cluster.erb
204
+ - lib/terraforming/template/tf/elasti_cache_subnet_group.erb
205
+ - lib/terraforming/template/tf/elastic_filesystem.erb
206
+ - lib/terraforming/template/tf/elb.erb
207
+ - lib/terraforming/template/tf/iam_group.erb
208
+ - lib/terraforming/template/tf/iam_group_membership.erb
209
+ - lib/terraforming/template/tf/iam_group_policy.erb
210
+ - lib/terraforming/template/tf/iam_instance_profile.erb
211
+ - lib/terraforming/template/tf/iam_policy.erb
212
+ - lib/terraforming/template/tf/iam_policy_attachment.erb
213
+ - lib/terraforming/template/tf/iam_role.erb
214
+ - lib/terraforming/template/tf/iam_role_policy.erb
215
+ - lib/terraforming/template/tf/iam_user.erb
216
+ - lib/terraforming/template/tf/iam_user_policy.erb
217
+ - lib/terraforming/template/tf/internet_gateway.erb
218
+ - lib/terraforming/template/tf/kms_alias.erb
219
+ - lib/terraforming/template/tf/kms_key.erb
220
+ - lib/terraforming/template/tf/launch_configuration.erb
221
+ - lib/terraforming/template/tf/nat_gateway.erb
222
+ - lib/terraforming/template/tf/network_acl.erb
223
+ - lib/terraforming/template/tf/network_interface.erb
224
+ - lib/terraforming/template/tf/rds.erb
225
+ - lib/terraforming/template/tf/redshift.erb
226
+ - lib/terraforming/template/tf/route53_record.erb
227
+ - lib/terraforming/template/tf/route53_zone.erb
228
+ - lib/terraforming/template/tf/route_table.erb
229
+ - lib/terraforming/template/tf/route_table_association.erb
230
+ - lib/terraforming/template/tf/s3.erb
231
+ - lib/terraforming/template/tf/security_group.erb
232
+ - lib/terraforming/template/tf/sns_topic.erb
233
+ - lib/terraforming/template/tf/sns_topic_subscription.erb
234
+ - lib/terraforming/template/tf/sqs.erb
235
+ - lib/terraforming/template/tf/subnet.erb
236
+ - lib/terraforming/template/tf/vpc.erb
237
+ - lib/terraforming/template/tf/vpn_gateway.erb
238
+ - lib/terraforming/util.rb
239
+ - lib/terraforming/version.rb
240
+ - script/console
241
+ - script/generate
242
+ - script/setup
243
+ - templates/resource.erb.erb
244
+ - templates/resource.rb.erb
245
+ - templates/resource_spec.rb.erb
246
+ - terraforming.gemspec
247
+ homepage: https://github.com/dtan4/terraforming
248
+ licenses:
249
+ - MIT
250
+ metadata: {}
251
+ post_install_message:
252
+ rdoc_options: []
253
+ require_paths:
254
+ - lib
255
+ required_ruby_version: !ruby/object:Gem::Requirement
256
+ requirements:
257
+ - - ">="
258
+ - !ruby/object:Gem::Version
259
+ version: '0'
260
+ required_rubygems_version: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
265
+ requirements: []
266
+ rubyforge_project:
267
+ rubygems_version: 2.5.1
268
+ signing_key:
269
+ specification_version: 4
270
+ summary: Show all AWS resources that are costing money
271
+ test_files: []