terraforming 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -4
  3. data/CHANGELOG.md +30 -1
  4. data/Gemfile +13 -0
  5. data/README.md +15 -2
  6. data/contrib/zsh-completion/_terraforming +65 -0
  7. data/lib/terraforming.rb +3 -0
  8. data/lib/terraforming/cli.rb +18 -0
  9. data/lib/terraforming/resource/auto_scaling_group.rb +1 -1
  10. data/lib/terraforming/resource/ec2.rb +3 -0
  11. data/lib/terraforming/resource/elasti_cache_cluster.rb +5 -2
  12. data/lib/terraforming/resource/iam_group.rb +1 -1
  13. data/lib/terraforming/resource/iam_group_policy.rb +5 -1
  14. data/lib/terraforming/resource/iam_policy.rb +6 -1
  15. data/lib/terraforming/resource/iam_role.rb +1 -1
  16. data/lib/terraforming/resource/iam_role_policy.rb +5 -1
  17. data/lib/terraforming/resource/iam_user_policy.rb +5 -1
  18. data/lib/terraforming/resource/launch_configuration.rb +109 -0
  19. data/lib/terraforming/resource/route53_record.rb +1 -1
  20. data/lib/terraforming/resource/route_table.rb +4 -12
  21. data/lib/terraforming/resource/security_group.rb +22 -6
  22. data/lib/terraforming/resource/sqs.rb +70 -0
  23. data/lib/terraforming/resource/subnet.rb +1 -1
  24. data/lib/terraforming/resource/vpn_gateway.rb +55 -0
  25. data/lib/terraforming/template/tf/ec2.erb +3 -0
  26. data/lib/terraforming/template/tf/elasti_cache_cluster.erb +2 -0
  27. data/lib/terraforming/template/tf/elb.erb +1 -1
  28. data/lib/terraforming/template/tf/iam_group_policy.erb +1 -1
  29. data/lib/terraforming/template/tf/iam_policy.erb +4 -3
  30. data/lib/terraforming/template/tf/iam_role_policy.erb +1 -1
  31. data/lib/terraforming/template/tf/iam_user_policy.erb +1 -1
  32. data/lib/terraforming/template/tf/launch_configuration.erb +66 -0
  33. data/lib/terraforming/template/tf/security_group.erb +2 -6
  34. data/lib/terraforming/template/tf/sqs.erb +21 -0
  35. data/lib/terraforming/template/tf/vpn_gateway.erb +14 -0
  36. data/lib/terraforming/version.rb +1 -1
  37. data/terraforming.gemspec +5 -8
  38. metadata +25 -60
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 81391c43ae75be098888ffb552b0862b5eb84ff3
4
- data.tar.gz: 2b3697639b6a79b2ad1bd9f3ad2e668cda9d36be
3
+ metadata.gz: 244d11650e141679a1bc58831f9e1d54b5f15cba
4
+ data.tar.gz: 7fe2d54b847abc14c4069ae8186bb3378cbe635e
5
5
  SHA512:
6
- metadata.gz: daf32d71dc7f775cef0faa84393dc92b7928273a07fe105fb8caa9fe2cda864d061f7fbd6189fab963194d2816dd49f0e19ac82903c4bf07f74e19727194a600
7
- data.tar.gz: b025806af68fff47061a5160a3018a271ef5d9ef6e0d55630d9d3f7fb218de2c3d4df146507956d256fef8d337007d8899edaa233aa8350dcd9289a08a0ffb7b
6
+ metadata.gz: 111cd0aa7c13dd04f64afcf8562756a88bdbaaf6df8698bbbb390b65504f3d7196feeeab90692a41254599f62bbff86db16e2c68aeff3200afa3858b32936ec6
7
+ data.tar.gz: 9d4870b66f7e9fa38c7f05179be35db7cb0fec3a3e08533519e0128d1e9cff8e637890b15a33ff4c7d018eb5a65147c5e3b18bb60f679bc03bc7449ebc986884
@@ -1,9 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3.0
4
- - 2.2.4
5
- - 2.1.8
6
- - 2.0
3
+ - 2.3.1
4
+ - 2.2.5
5
+ - 2.1.10
7
6
  env:
8
7
  - secure: n0mxwnyjuXI4mJO4mp++2TnsPJ+XgCF/J1U2L5piE5j3xMhSU+5V0JrA1uFlS0Pemb44M7BjgmF9S4G35BwyAQpctpCYhqy9tFa6+Y6nxEv5hCv2cZz7BSAZM6eb+zq20409hxTHRaQOr1DBeE4R5S2PrmOXRqvYfTRv3LNSLFk=
9
8
  notifications:
@@ -1,4 +1,33 @@
1
- # [v0.7.0](https://github.com/dtan4/terraforming/releases/tag/v0.6.2) (2016-02-16)
1
+ # [v0.8.0](https://github.com/dtan4/terraforming/releases/tag/v0.8.0) (2016-05-29)
2
+
3
+ ## Notice
4
+
5
+ - Drop Ruby 2.0 support. Now Terraforming supports Ruby 2.1 or higher. #206
6
+
7
+ ## Resource
8
+
9
+ - AWS VPN Gateway #190 (thanks @tmccabe07)
10
+ - AWS Launch Configuration #187 (thanks @phoolish)
11
+ - AWS SQS #169 (thanks @manabusakai)
12
+
13
+ ## Fixed / Updated
14
+
15
+ - Add prefix not to duplicate IAM inline policy name #212 (thanks @stormbeta)
16
+ - Use the latest Ox and Oj #210
17
+ - Simplify Security Group name #207 (thanks @woohgit)
18
+ - Include description field for IAM policies #203 (thanks @stormbeta)
19
+ - Support paging paging for IAM resources #201 (thanks @dominis)
20
+ - Fix Security Group output around EC2-Classic #200 (thanks @woohgit)
21
+ - Default Route53 record weight should be "-1" #197 (thanks @woohgit)
22
+ - Add Elasticache Redis port #189 (thanks @phoolish)
23
+ - Add `--region` option #188 (thanks @hajhatten)
24
+ - Add zsh completion #176 (thanks @knakayama)
25
+ - Add subnet ID to the resource name #185 (thanks @bandesz)
26
+ - Add EC2 placement group #180 (thanks @wsh)
27
+ - Wrap tag name in ELB #179 (thanks @robatwave)
28
+ - Retrive full list of AutoScaling Groups #170 (thanks @shouyu)
29
+
30
+ # [v0.7.0](https://github.com/dtan4/terraforming/releases/tag/v0.7.0) (2016-02-16)
2
31
 
3
32
  ## Resource
4
33
 
data/Gemfile CHANGED
@@ -2,3 +2,16 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in terraforming.gemspec
4
4
  gemspec
5
+
6
+ group :development do
7
+ gem "guard"
8
+ gem "guard-rspec"
9
+
10
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.2.0")
11
+ gem "listen", "~> 3.1.0"
12
+ else
13
+ gem "listen", "< 3.1.0"
14
+ end
15
+
16
+ gem "terminal-notifier-guard"
17
+ end
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/dtan4/terraforming.svg?branch=master)](https://travis-ci.org/dtan4/terraforming)
4
4
  [![Code Climate](https://codeclimate.com/github/dtan4/terraforming/badges/gpa.svg)](https://codeclimate.com/github/dtan4/terraforming)
5
- [![Test Coverage](https://codeclimate.com/github/dtan4/terraforming/badges/coverage.svg)](https://codeclimate.com/github/dtan4/terraforming)
5
+ [![Coverage Status](https://coveralls.io/repos/github/dtan4/terraforming/badge.svg?branch=increase-test-cov-160528)](https://coveralls.io/github/dtan4/terraforming)
6
6
  [![Dependency Status](https://gemnasium.com/dtan4/terraforming.svg)](https://gemnasium.com/dtan4/terraforming)
7
7
  [![Gem Version](https://badge.fury.io/rb/terraforming.svg)](http://badge.fury.io/rb/terraforming)
8
8
  [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)
@@ -17,6 +17,7 @@ Export existing AWS resources to [Terraform](https://terraform.io/) style (tf, t
17
17
  - [Usage](#usage)
18
18
  - [Export tf](#export-tf)
19
19
  - [Export tfstate](#export-tfstate)
20
+ - [Example: Export all](#example-export-all)
20
21
  - [Run as Docker container](#run-as-docker-container-)
21
22
  - [Development](#development)
22
23
  - [Contributing](#contributing)
@@ -24,7 +25,7 @@ Export existing AWS resources to [Terraform](https://terraform.io/) style (tf, t
24
25
 
25
26
  ## Supported version
26
27
 
27
- Ruby 2.x
28
+ Ruby 2.1 or higher
28
29
 
29
30
  ## Installation
30
31
 
@@ -88,6 +89,7 @@ Commands:
88
89
  terraforming iamu # IAM User
89
90
  terraforming iamup # IAM User Policy
90
91
  terraforming igw # Internet Gateway
92
+ terraforming lc # Launch Configuration
91
93
  terraforming nacl # Network ACL
92
94
  terraforming nif # Network Interface
93
95
  terraforming r53r # Route53 Record
@@ -99,6 +101,8 @@ Commands:
99
101
  terraforming s3 # S3
100
102
  terraforming sg # Security Group
101
103
  terraforming sn # Subnet
104
+ terraforming sqs # SQS
105
+ terraforming vgw # VPN Gateway
102
106
  terraforming vpc # VPC
103
107
  ```
104
108
 
@@ -312,6 +316,15 @@ the real physical resources that exist. As a result, Terraform
312
316
  doesn't need to do anything.
313
317
  ```
314
318
 
319
+ #### Example: Export all
320
+ Example assuming you want to export everything from us-west-2 and you are using ~/.aws/credentials with a `default` profile
321
+ ```bash
322
+ export AWS_REGION=us-west-2
323
+ terraforming help | grep terraforming | grep -v help | awk '{print "terraforming", $2, "--profile", "default", ">", $2".tf";}' | bash
324
+ # remove files that only have 1 empty line (nothing in AWS)
325
+ find . -type f | xargs wc -l | grep '1 .' | awk '{print $2;}' | xargs rm
326
+ ```
327
+
315
328
  ## Run as Docker container [![Docker Repository on Quay.io](https://quay.io/repository/dtan4/terraforming/status "Docker Repository on Quay.io")](https://quay.io/repository/dtan4/terraforming)
316
329
 
317
330
  Terraforming Docker Image is available at [quay.io/dtan4/terraforming](https://quay.io/repository/dtan4/terraforming) and developed at [dtan4/dockerfile-terraforming](https://github.com/dtan4/dockerfile-terraforming).
@@ -0,0 +1,65 @@
1
+ #compdef terraforming
2
+
3
+ function _terraforming() {
4
+ local context curcontext=$curcontext state line
5
+ typeset -A opt_args
6
+ local ret=1
7
+
8
+ _arguments -C \
9
+ '1: :__terraforming_sub_commands' \
10
+ '*:: :->args' \
11
+ && ret=0
12
+
13
+ case $state in
14
+ (args)
15
+ case $words[1] in
16
+ (help)
17
+ _arguments -C \
18
+ '1: :__terraforming_sub_commands' \
19
+ '(-)*:: :->null_state' \
20
+ && ret=0
21
+ ;;
22
+ (*)
23
+ _arguments -C \
24
+ '--merge=[(TFSTATE) tfstate file to merge]:tfstate file to merge:_files' \
25
+ '--overwrite[Overwrite existing tfstate]' \
26
+ '--no-overwrite[Do not overwrite existing tfstate]' \
27
+ '--tfstate[Generate tfstate]' \
28
+ '--no-tfstate[Do not generate tfstate]' \
29
+ '--profile[(PROFILE) AWS credentials profile]:AWS credentials profile:__profiles' \
30
+ && ret=0
31
+ ;;
32
+ esac
33
+ ;;
34
+ esac
35
+
36
+ return ret
37
+ }
38
+
39
+ __terraforming_sub_commands() {
40
+ local -a _c
41
+
42
+ _c=(
43
+ "${(@f)$(terraforming --help \
44
+ | grep ' terraforming' \
45
+ | sed -E 's/^ terraforming //g' \
46
+ | sed -E 's/ *(\[COMMAND\])? *# /:/g')}"
47
+ )
48
+
49
+ _describe -t commands terraforming_sub_commands _c
50
+ }
51
+
52
+ __profiles() {
53
+ local _profile_path="${HOME}/.aws/credentials"
54
+ local -a _profiles
55
+
56
+ _profiles=(
57
+ ${(@f)"$(_call_program profiles \
58
+ "grep -E '^\[.*\]$' "$_profile_path" \
59
+ | sed -e 's/\[//' -e 's/\]//'")"}
60
+ )
61
+
62
+ _describe -t profiles Profiles _profiles
63
+ }
64
+
65
+ _terraforming "$@"
@@ -29,6 +29,7 @@ require "terraforming/resource/iam_role"
29
29
  require "terraforming/resource/iam_role_policy"
30
30
  require "terraforming/resource/iam_user"
31
31
  require "terraforming/resource/iam_user_policy"
32
+ require "terraforming/resource/launch_configuration"
32
33
  require "terraforming/resource/internet_gateway"
33
34
  require "terraforming/resource/network_acl"
34
35
  require "terraforming/resource/network_interface"
@@ -41,4 +42,6 @@ require "terraforming/resource/route53_zone"
41
42
  require "terraforming/resource/s3"
42
43
  require "terraforming/resource/security_group"
43
44
  require "terraforming/resource/subnet"
45
+ require "terraforming/resource/sqs"
44
46
  require "terraforming/resource/vpc"
47
+ require "terraforming/resource/vpn_gateway"
@@ -4,6 +4,7 @@ module Terraforming
4
4
  class_option :overwrite, type: :boolean, desc: "Overwrite existng tfstate"
5
5
  class_option :tfstate, type: :boolean, desc: "Generate tfstate"
6
6
  class_option :profile, type: :string, desc: "AWS credentials profile"
7
+ class_option :region, type: :string, desc: "AWS region"
7
8
 
8
9
  desc "asg", "AutoScaling Group"
9
10
  def asg
@@ -95,6 +96,11 @@ module Terraforming
95
96
  execute(Terraforming::Resource::IAMUserPolicy, options)
96
97
  end
97
98
 
99
+ desc "lc", "Launch Configuration"
100
+ def lc
101
+ execute(Terraforming::Resource::LaunchConfiguration, options)
102
+ end
103
+
98
104
  desc "igw", "Internet Gateway"
99
105
  def igw
100
106
  execute(Terraforming::Resource::InternetGateway, options)
@@ -155,15 +161,27 @@ module Terraforming
155
161
  execute(Terraforming::Resource::Subnet, options)
156
162
  end
157
163
 
164
+ desc "sqs", "SQS"
165
+ def sqs
166
+ execute(Terraforming::Resource::SQS, options)
167
+ end
168
+
158
169
  desc "vpc", "VPC"
159
170
  def vpc
160
171
  execute(Terraforming::Resource::VPC, options)
161
172
  end
162
173
 
174
+ desc "vgw", "VPN Gateway"
175
+ def vgw
176
+ execute(Terraforming::Resource::VPNGateway, options)
177
+ end
178
+
179
+
163
180
  private
164
181
 
165
182
  def execute(klass, options)
166
183
  Aws.config[:credentials] = Aws::SharedCredentials.new(profile_name: options[:profile]) if options[:profile]
184
+ Aws.config[:region] = options[:region] if options[:region]
167
185
  result = options[:tfstate] ? tfstate(klass, options[:merge]) : tf(klass)
168
186
 
169
187
  if options[:tfstate] && options[:merge] && options[:overwrite]
@@ -67,7 +67,7 @@ module Terraforming
67
67
  private
68
68
 
69
69
  def auto_scaling_groups
70
- @client.describe_auto_scaling_groups.auto_scaling_groups
70
+ @client.describe_auto_scaling_groups.map(&:auto_scaling_groups).flatten
71
71
  end
72
72
 
73
73
  def module_name_of(group)
@@ -45,6 +45,9 @@ module Terraforming
45
45
  "vpc_security_group_ids.#"=> in_vpc ? instance.security_groups.length.to_s : "0",
46
46
  }
47
47
 
48
+ placement_group = instance.placement.group_name
49
+ attributes["placement_group"] = placement_group unless placement_group.empty?
50
+
48
51
  attributes["subnet_id"] = instance.subnet_id if in_vpc?(instance)
49
52
 
50
53
  resources["aws_instance.#{module_name_of(instance)}"] = {
@@ -36,8 +36,11 @@ module Terraforming
36
36
  "tags.#" => "0",
37
37
  }
38
38
 
39
- attributes["port"] =
40
- cache_cluster.configuration_endpoint.port.to_s if cache_cluster.configuration_endpoint
39
+ attributes["port"] = if cache_cluster.configuration_endpoint
40
+ cache_cluster.configuration_endpoint.port.to_s
41
+ else
42
+ cache_cluster.cache_nodes[0].endpoint.port.to_s
43
+ end
41
44
 
42
45
  resources["aws_elasticache_cluster.#{cache_cluster.cache_cluster_id}"] = {
43
46
  "type" => "aws_elasticache_cluster",
@@ -43,7 +43,7 @@ module Terraforming
43
43
  private
44
44
 
45
45
  def iam_groups
46
- @client.list_groups.groups
46
+ @client.list_groups.collect {|r| r.groups}.flatten
47
47
  end
48
48
  end
49
49
  end
@@ -27,7 +27,7 @@ module Terraforming
27
27
  "name" => policy.policy_name,
28
28
  "policy" => prettify_policy(policy.policy_document, breakline: true, unescape: true)
29
29
  }
30
- resources["aws_iam_group_policy.#{policy.policy_name}"] = {
30
+ resources["aws_iam_group_policy.#{unique_name(policy)}"] = {
31
31
  "type" => "aws_iam_group_policy",
32
32
  "primary" => {
33
33
  "id" => iam_group_policy_id_of(policy),
@@ -41,6 +41,10 @@ module Terraforming
41
41
 
42
42
  private
43
43
 
44
+ def unique_name(policy)
45
+ "#{policy.group_name}_#{policy.policy_name}"
46
+ end
47
+
44
48
  def iam_groups
45
49
  @client.list_groups.groups
46
50
  end
@@ -26,6 +26,7 @@ module Terraforming
26
26
  "id" => policy.arn,
27
27
  "name" => policy.policy_name,
28
28
  "path" => policy.path,
29
+ "description" => iam_policy_description(policy),
29
30
  "policy" => prettify_policy(version.document, breakline: true, unescape: true),
30
31
  }
31
32
  resources["aws_iam_policy.#{policy.policy_name}"] = {
@@ -43,7 +44,11 @@ module Terraforming
43
44
  private
44
45
 
45
46
  def iam_policies
46
- @client.list_policies(scope: "Local").policies
47
+ @client.list_policies(scope: "Local").collect {|r| r.policies}.flatten
48
+ end
49
+
50
+ def iam_policy_description(policy)
51
+ @client.get_policy(policy_arn: policy.arn).policy.description
47
52
  end
48
53
 
49
54
  def iam_policy_version_of(policy)
@@ -45,7 +45,7 @@ module Terraforming
45
45
  private
46
46
 
47
47
  def iam_roles
48
- @client.list_roles.roles
48
+ @client.list_roles.collect {|r| r.roles}.flatten
49
49
  end
50
50
  end
51
51
  end
@@ -27,7 +27,7 @@ module Terraforming
27
27
  "policy" => prettify_policy(policy.policy_document, breakline: true, unescape: true),
28
28
  "role" => policy.role_name,
29
29
  }
30
- resources["aws_iam_role_policy.#{policy.policy_name}"] = {
30
+ resources["aws_iam_role_policy.#{unique_name(policy)}"] = {
31
31
  "type" => "aws_iam_role_policy",
32
32
  "primary" => {
33
33
  "id" => iam_role_policy_id_of(policy),
@@ -41,6 +41,10 @@ module Terraforming
41
41
 
42
42
  private
43
43
 
44
+ def unique_name(policy)
45
+ "#{policy.role_name}_#{policy.policy_name}"
46
+ end
47
+
44
48
  def iam_roles
45
49
  @client.list_roles.roles
46
50
  end
@@ -27,7 +27,7 @@ module Terraforming
27
27
  "policy" => prettify_policy(policy.policy_document, breakline: true, unescape: true),
28
28
  "user" => policy.user_name,
29
29
  }
30
- resources["aws_iam_user_policy.#{policy.policy_name}"] = {
30
+ resources["aws_iam_user_policy.#{unique_name(policy)}"] = {
31
31
  "type" => "aws_iam_user_policy",
32
32
  "primary" => {
33
33
  "id" => iam_user_policy_id_of(policy),
@@ -41,6 +41,10 @@ module Terraforming
41
41
 
42
42
  private
43
43
 
44
+ def unique_name(policy)
45
+ "#{policy.user_name}_#{policy.policy_name}"
46
+ end
47
+
44
48
  def iam_users
45
49
  @client.list_users.users
46
50
  end
@@ -0,0 +1,109 @@
1
+ module Terraforming
2
+ module Resource
3
+ class LaunchConfiguration
4
+ include Terraforming::Util
5
+
6
+ def self.tf(client: Aws::AutoScaling::Client.new)
7
+ self.new(client).tf
8
+ end
9
+
10
+ def self.tfstate(client: Aws::AutoScaling::Client.new)
11
+ self.new(client).tfstate
12
+ end
13
+
14
+ def initialize(client)
15
+ @client = client
16
+ end
17
+
18
+ def tf
19
+ apply_template(@client, "tf/launch_configuration")
20
+ end
21
+
22
+ def tfstate
23
+ launch_configurations.inject({}) do |resources, lc|
24
+
25
+ attributes = {
26
+ "name" => lc.launch_configuration_name,
27
+ "image_id" => lc.image_id,
28
+ "instance_type" => lc.instance_type,
29
+ "key_name" => lc.key_name,
30
+ "security_groups.#" => lc.security_groups.length.to_s,
31
+ "associate_public_ip_address" => lc.associate_public_ip_address.to_s,
32
+ "user_data" => lc.user_data,
33
+ "enable_monitoring" => lc.instance_monitoring.enabled.to_s,
34
+ "ebs_optimized" => lc.ebs_optimized.to_s,
35
+ "root_block_device.#" => root_block_device_count(lc).to_s,
36
+ "ebs_block_device.#" => ebs_block_device_count(lc).to_s,
37
+ "ephemeral_block_device.#" => ephemeral_block_device_count(lc).to_s
38
+ }
39
+
40
+ lc.security_groups.each do |sg|
41
+ hash = hash_security_group(sg)
42
+ attributes["security_groups.#{hash}"] = sg
43
+ end
44
+
45
+ attributes["iam_instance_profile"] = lc.iam_instance_profile if lc.iam_instance_profile
46
+ attributes["spot_price"] = lc.spot_price if lc.spot_price
47
+ attributes["placement_tenancy"] = lc.placement_tenancy if lc.placement_tenancy
48
+
49
+ resources["aws_launch_configuration.#{module_name_of(lc)}"] = {
50
+ "type" => "aws_launch_configuration",
51
+ "primary" => {
52
+ "id" => lc.launch_configuration_name,
53
+ "attributes" => attributes
54
+ }
55
+ }
56
+
57
+ resources
58
+ end
59
+ end
60
+
61
+ private
62
+
63
+ # Taken from http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/device_naming.html
64
+ def root_block_device?(block_device)
65
+ %w(/dev/sda1 /dev/xvda).include? block_device.device_name
66
+ end
67
+
68
+ def root_block_device_count(launch_configuration)
69
+ launch_configuration.block_device_mappings.select do |volume|
70
+ root_block_device?(volume)
71
+ end.length
72
+ end
73
+
74
+ def ebs_block_device?(block_device)
75
+ block_device.virtual_name == nil && block_device.ebs
76
+ end
77
+
78
+ def ebs_block_device_count(launch_configuration)
79
+ launch_configuration.block_device_mappings.select do |volume|
80
+ ebs_block_device?(volume) && !root_block_device?(volume)
81
+ end.length
82
+ end
83
+
84
+ def ephemeral_block_device?(block_device)
85
+ block_device.virtual_name != nil
86
+ end
87
+
88
+ def ephemeral_block_device_count(launch_configuration)
89
+ launch_configuration.block_device_mappings.select do |volume|
90
+ ephemeral_block_device?(volume)
91
+ end.length
92
+ end
93
+
94
+ def hash_security_group(name)
95
+ Zlib.crc32(name)
96
+ end
97
+
98
+ def launch_configurations
99
+ @client.describe_launch_configurations.collect do |r|
100
+ r.launch_configurations
101
+ end.flatten
102
+ end
103
+
104
+ def module_name_of(launch_configuration)
105
+ normalize_module_name(launch_configuration.launch_configuration_name)
106
+ end
107
+ end
108
+ end
109
+ end
@@ -34,7 +34,7 @@ module Terraforming
34
34
  attributes["alias.#"] = "1" if record.alias_target
35
35
  attributes["records.#"] = record.resource_records.length.to_s unless record.resource_records.empty?
36
36
  attributes["ttl"] = record.ttl.to_s if record.ttl
37
- attributes["weight"] = record.weight.to_s if record.weight
37
+ attributes["weight"] = record.weight ? record.weight.to_s : "-1"
38
38
  attributes["set_identifier"] = record.set_identifier if record.set_identifier
39
39
 
40
40
  resources["aws_route53_record.#{module_name_of(record)}"] = {
@@ -85,20 +85,12 @@ module Terraforming
85
85
  end
86
86
 
87
87
  def route_hashcode_of(route)
88
- string = "#{route.destination_cidr_block}-" <<
89
- "#{route.gateway_id}-"
90
-
91
- instance_set = false
92
- if route.instance_id != ''
93
- string << route.instance_id.to_s
94
- instance_set = true
95
- end
88
+ string = "#{route.destination_cidr_block}-#{route.gateway_id}-"
89
+ instance_set = !route.instance_id.nil? && route.instance_id != ''
96
90
 
91
+ string << route.instance_id.to_s if instance_set
97
92
  string << route.vpc_peering_connection_id.to_s
98
-
99
- unless instance_set
100
- string << route.network_interface_id.to_s
101
- end
93
+ string << route.network_interface_id.to_s unless instance_set
102
94
 
103
95
  Zlib.crc32(string)
104
96
  end
@@ -74,12 +74,17 @@ module Terraforming
74
74
  end
75
75
 
76
76
  def module_name_of(security_group)
77
- normalize_module_name("#{security_group.group_id}-#{security_group.group_name}")
77
+ if security_group.vpc_id.nil?
78
+ normalize_module_name("#{security_group.group_name}")
79
+ else
80
+ normalize_module_name("#{security_group.vpc_id}-#{security_group.group_name}")
81
+ end
78
82
  end
79
83
 
80
84
  def permission_attributes_of(security_group, permission, type)
81
85
  hashcode = permission_hashcode_of(security_group, permission)
82
- security_groups = security_groups_in(permission).reject { |group_id| group_id == security_group.group_id }
86
+ security_groups = security_groups_in(permission, security_group).reject { |group_name| group_name == security_group.group_name }.reject { |group_id| group_id == security_group.group_id }
87
+
83
88
 
84
89
  attributes = {
85
90
  "#{type}.#{hashcode}.from_port" => (permission.from_port || 0).to_s,
@@ -138,21 +143,32 @@ module Terraforming
138
143
  "#{self_referenced_permission?(security_group, permission).to_s}-"
139
144
 
140
145
  permission.ip_ranges.each { |range| string << "#{range.cidr_ip}-" }
141
- security_groups_in(permission).each { |group| string << "#{group}-" }
146
+ security_groups_in(permission, security_group).each { |group| string << "#{group}-" }
142
147
 
143
148
  Zlib.crc32(string)
144
149
  end
145
150
 
146
151
  def self_referenced_permission?(security_group, permission)
147
- security_groups_in(permission).include?(security_group.group_id)
152
+ (security_groups_in(permission, security_group) & [security_group.group_id, security_group.group_name]).any?
148
153
  end
149
154
 
150
155
  def security_groups
151
156
  @client.describe_security_groups.security_groups
152
157
  end
153
158
 
154
- def security_groups_in(permission)
155
- permission.user_id_group_pairs.map { |range| range.group_id }
159
+ def security_groups_in(permission, security_group)
160
+ permission.user_id_group_pairs.map { |range|
161
+ # EC2-Classic, same account
162
+ if security_group.owner_id == range.user_id && !range.group_name.nil?
163
+ range.group_name
164
+ # VPC
165
+ elsif security_group.owner_id == range.user_id && range.group_name.nil?
166
+ range.group_id
167
+ # EC2-Classic, other account
168
+ else
169
+ "#{range.user_id}/#{range.group_name}"
170
+ end
171
+ }
156
172
  end
157
173
 
158
174
  def tags_attributes_of(security_group)
@@ -0,0 +1,70 @@
1
+ module Terraforming
2
+ module Resource
3
+ class SQS
4
+ include Terraforming::Util
5
+
6
+ def self.tf(client: Aws::SQS::Client.new)
7
+ self.new(client).tf
8
+ end
9
+
10
+ def self.tfstate(client: Aws::SQS::Client.new)
11
+ self.new(client).tfstate
12
+ end
13
+
14
+ def initialize(client)
15
+ @client = client
16
+ end
17
+
18
+ def tf
19
+ apply_template(@client, "tf/sqs")
20
+ end
21
+
22
+ def tfstate
23
+ queues.inject({}) do |resources, queue|
24
+ attributes = {
25
+ "name" => module_name_of(queue),
26
+ "id" => queue["QueueUrl"],
27
+ "arn" => queue["QueueArn"],
28
+ "visibility_timeout_seconds" => queue["VisibilityTimeout"],
29
+ "message_retention_seconds" => queue["MessageRetentionPeriod"],
30
+ "max_message_size" => queue["MaximumMessageSize"],
31
+ "delay_seconds" => queue["DelaySeconds"],
32
+ "receive_wait_time_seconds" => queue["ReceiveMessageWaitTimeSeconds"],
33
+ "policy" => queue.key?("Policy") ? queue["Policy"] : "",
34
+ "redrive_policy" => queue.key?("RedrivePolicy") ? queue["RedrivePolicy"] : "",
35
+ }
36
+ resources["aws_sqs_queue.#{module_name_of(queue)}"] = {
37
+ "type" => "aws_sqs_queue",
38
+ "primary" => {
39
+ "id" => queue["QueueUrl"],
40
+ "attributes" => attributes,
41
+ }
42
+ }
43
+
44
+ resources
45
+ end
46
+ end
47
+
48
+ private
49
+
50
+ def queues
51
+ queue_urls.map do |queue_url|
52
+ attributes = @client.get_queue_attributes({
53
+ queue_url: queue_url,
54
+ attribute_names: ["All"],
55
+ }).attributes
56
+ attributes["QueueUrl"] = queue_url
57
+ attributes
58
+ end
59
+ end
60
+
61
+ def queue_urls
62
+ @client.list_queues.queue_urls
63
+ end
64
+
65
+ def module_name_of(queue)
66
+ normalize_module_name(queue["QueueArn"].split(":").last)
67
+ end
68
+ end
69
+ end
70
+ end
@@ -48,7 +48,7 @@ module Terraforming
48
48
  end
49
49
 
50
50
  def module_name_of(subnet)
51
- normalize_module_name(name_from_tag(subnet, subnet.subnet_id))
51
+ normalize_module_name("#{subnet.subnet_id}-#{name_from_tag(subnet, subnet.subnet_id)}")
52
52
  end
53
53
  end
54
54
  end
@@ -0,0 +1,55 @@
1
+ module Terraforming
2
+ module Resource
3
+ class VPNGateway
4
+ include Terraforming::Util
5
+
6
+ def self.tf(client: Aws::EC2::Client.new)
7
+ self.new(client).tf
8
+ end
9
+
10
+ def self.tfstate(client: Aws::EC2::Client.new)
11
+ self.new(client).tfstate
12
+ end
13
+
14
+ def initialize(client)
15
+ @client = client
16
+ end
17
+
18
+ def tf
19
+ apply_template(@client, "tf/vpn_gateway")
20
+ end
21
+
22
+ def tfstate
23
+ vpn_gateways.inject({}) do |resources, vpn_gateway|
24
+ next resources if vpn_gateway.vpc_attachments.empty?
25
+
26
+ attributes = {
27
+ "id" => vpn_gateway.vpn_gateway_id,
28
+ "vpc_id" => vpn_gateway.vpc_attachments[0].vpc_id,
29
+ "availability_zone" => vpn_gateway.availability_zone,
30
+ "tags.#" => vpn_gateway.tags.length.to_s,
31
+ }
32
+ resources["aws_vpn_gateway.#{module_name_of(vpn_gateway)}"] = {
33
+ "type" => "aws_vpn_gateway",
34
+ "primary" => {
35
+ "id" => vpn_gateway.vpn_gateway_id,
36
+ "attributes" => attributes
37
+ }
38
+ }
39
+
40
+ resources
41
+ end
42
+ end
43
+
44
+ private
45
+
46
+ def vpn_gateways
47
+ @client.describe_vpn_gateways.vpn_gateways
48
+ end
49
+
50
+ def module_name_of(vpn_gateway)
51
+ normalize_module_name(name_from_tag(vpn_gateway, vpn_gateway.vpn_gateway_id))
52
+ end
53
+ end
54
+ end
55
+ end
@@ -4,6 +4,9 @@ resource "aws_instance" "<%= module_name_of(instance) %>" {
4
4
  availability_zone = "<%= instance.placement.availability_zone %>"
5
5
  ebs_optimized = <%= instance.ebs_optimized %>
6
6
  instance_type = "<%= instance.instance_type %>"
7
+ <%- unless instance.placement.group_name.empty? -%>
8
+ placement_group = "<%= instance.placement.group_name %>"
9
+ <%- end -%>
7
10
  monitoring = <%= monitoring_state(instance) %>
8
11
  key_name = "<%= instance.key_name %>"
9
12
  <%- if in_vpc?(instance) -%>
@@ -8,6 +8,8 @@ resource "aws_elasticache_cluster" "<%= cache_cluster.cache_cluster_id %>" {
8
8
  parameter_group_name = "<%= cache_cluster.cache_parameter_group.cache_parameter_group_name %>"
9
9
  <%- if cache_cluster.configuration_endpoint -%>
10
10
  port = <%= cache_cluster.configuration_endpoint.port %>
11
+ <%- else -%>
12
+ port = <%= cache_cluster.cache_nodes[0].endpoint.port %>
11
13
  <%- end -%>
12
14
  <%- if cluster_in_vpc?(cache_cluster) -%>
13
15
  subnet_group_name = "<%= cache_cluster.cache_subnet_group_name %>"
@@ -34,7 +34,7 @@ resource "aws_elb" "<%= module_name_of(load_balancer) %>" {
34
34
 
35
35
  tags {
36
36
  <% @client.describe_tags(load_balancer_names: [load_balancer.load_balancer_name]).tag_descriptions.first.tags.each do |tag| -%>
37
- <%= tag.key %> = "<%= tag.value %>"
37
+ "<%= tag.key %>" = "<%= tag.value %>"
38
38
  <% end -%>
39
39
  }
40
40
  }
@@ -1,5 +1,5 @@
1
1
  <% iam_group_policies.each do |policy| -%>
2
- resource "aws_iam_group_policy" "<%= policy.policy_name %>" {
2
+ resource "aws_iam_group_policy" "<%= unique_name(policy) %>" {
3
3
  name = "<%= policy.policy_name %>"
4
4
  group = "<%= policy.group_name %>"
5
5
  policy = <<POLICY
@@ -1,9 +1,10 @@
1
1
  <% iam_policies.each do |policy| -%>
2
2
  <%- version = iam_policy_version_of(policy) -%>
3
3
  resource "aws_iam_policy" "<%= policy.policy_name %>" {
4
- name = "<%= policy.policy_name %>"
5
- path = "<%= policy.path %>"
6
- policy = <<POLICY
4
+ name = "<%= policy.policy_name %>"
5
+ path = "<%= policy.path %>"
6
+ description = "<%= iam_policy_description(policy) %>"
7
+ policy = <<POLICY
7
8
  <%= prettify_policy(version.document, unescape: true) %>
8
9
  POLICY
9
10
  }
@@ -1,5 +1,5 @@
1
1
  <% iam_role_policies.each do |policy| -%>
2
- resource "aws_iam_role_policy" "<%= policy.policy_name %>" {
2
+ resource "aws_iam_role_policy" "<%= unique_name(policy) %>" {
3
3
  name = "<%= policy.policy_name %>"
4
4
  role = "<%= policy.role_name %>"
5
5
  policy = <<POLICY
@@ -1,5 +1,5 @@
1
1
  <% iam_user_policies.each do |policy| -%>
2
- resource "aws_iam_user_policy" "<%= policy.policy_name %>" {
2
+ resource "aws_iam_user_policy" "<%= unique_name(policy) %>" {
3
3
  name = "<%= policy.policy_name %>"
4
4
  user = "<%= policy.user_name %>"
5
5
  policy = <<POLICY
@@ -0,0 +1,66 @@
1
+ <% launch_configurations.each do |launch_configuration| -%>
2
+ resource "aws_launch_configuration" "<%= module_name_of(launch_configuration) %>" {
3
+ name = "<%= launch_configuration.launch_configuration_name %>"
4
+ image_id = "<%= launch_configuration.image_id %>"
5
+ instance_type = "<%= launch_configuration.instance_type %>"
6
+ <%- if launch_configuration.iam_instance_profile -%>
7
+ iam_instance_profile = "<%= launch_configuration.iam_instance_profile %>"
8
+ <%- end -%>
9
+ <%- unless launch_configuration.key_name.empty? -%>
10
+ key_name = "<%= launch_configuration.key_name %>"
11
+ <%- end -%>
12
+ security_groups = <%= launch_configuration.security_groups.map { |sg| sg }.inspect %>
13
+ associate_public_ip_address = <%= launch_configuration.associate_public_ip_address %>
14
+ <%- unless launch_configuration.user_data.empty? -%>
15
+ user_data = "<%= launch_configuration.user_data %>"
16
+ <%- end -%>
17
+ enable_monitoring = <%= launch_configuration.instance_monitoring.enabled %>
18
+ ebs_optimized = <%= launch_configuration.ebs_optimized %>
19
+ <%- if launch_configuration.spot_price -%>
20
+ spot_price = "<%= launch_configuration.spot_price %>"
21
+ <%- end -%>
22
+ <%- if launch_configuration.placement_tenancy -%>
23
+ placement_tenancy = "<%= launch_configuration.placement_tenancy %>"
24
+ <%- end -%>
25
+
26
+ <% launch_configuration.block_device_mappings.each do |block_device| -%>
27
+ <%- if root_block_device?(block_device) -%>
28
+ root_block_device {
29
+ <%- if ebs_block_device?(block_device) -%>
30
+ volume_type = "<%= block_device.ebs.volume_type %>"
31
+ volume_size = <%= block_device.ebs.volume_size %>
32
+ <%- if block_device.ebs.iops -%>
33
+ iops = <%= block_device.ebs.iops %>
34
+ <%- end -%>
35
+ delete_on_termination = <%= block_device.ebs.delete_on_termination %>
36
+ <%- end -%>
37
+ }
38
+
39
+ <%- elsif ebs_block_device?(block_device) -%>
40
+ ebs_block_device {
41
+ device_name = "<%= block_device.device_name %>"
42
+ <%- if block_device.ebs.snapshot_id -%>
43
+ snapshot_id = "<%= block_device.ebs.snapshot_id %>"
44
+ <%- end -%>
45
+ volume_type = "<%= block_device.ebs.volume_type %>"
46
+ volume_size = <%= block_device.ebs.volume_size %>
47
+ <%- if block_device.ebs.iops -%>
48
+ iops = <%= block_device.ebs.iops %>
49
+ <%- end -%>
50
+ delete_on_termination = <%= block_device.ebs.delete_on_termination %>
51
+ <%- if block_device.ebs.encrypted -%>
52
+ encrypted = <%= block_device.ebs.encrypted %>
53
+ <%- end -%>
54
+ }
55
+
56
+ <%- elsif ephemeral_block_device?(block_device) -%>
57
+ ephemeral_block_device {
58
+ device_name = "<%= block_device.device_name %>"
59
+ virtual_name = "<%= block_device.virtual_name %>"
60
+ }
61
+
62
+ <%- end -%>
63
+ <%- end -%>
64
+ }
65
+
66
+ <%- end -%>
@@ -5,7 +5,7 @@ resource "aws_security_group" "<%= module_name_of(security_group) %>" {
5
5
  vpc_id = "<%= security_group.vpc_id || '' %>"
6
6
 
7
7
  <% dedup_permissions(security_group.ip_permissions, security_group.group_id).each do |permission| -%>
8
- <%- security_groups = security_groups_in(permission).reject { |group_id| group_id == security_group.group_id } -%>
8
+ <%- security_groups = security_groups_in(permission, security_group).reject { |group_name| group_name == security_group.group_name }.reject { |group_id| group_id == security_group.group_id } -%>
9
9
  ingress {
10
10
  from_port = <%= permission.from_port || 0 %>
11
11
  to_port = <%= permission.to_port || 0 %>
@@ -15,9 +15,7 @@ resource "aws_security_group" "<%= module_name_of(security_group) %>" {
15
15
  <%- end -%>
16
16
  <%- if permission.user_id_group_pairs.length > 0 -%>
17
17
  <%- self_referenced = self_referenced_permission?(security_group, permission) -%>
18
- <%- unless self_referenced -%>
19
18
  security_groups = <%= security_groups.inspect %>
20
- <%- end -%>
21
19
  self = <%= self_referenced %>
22
20
  <%- end -%>
23
21
  }
@@ -34,9 +32,7 @@ resource "aws_security_group" "<%= module_name_of(security_group) %>" {
34
32
  <%- end -%>
35
33
  <%- if permission.user_id_group_pairs.length > 0 -%>
36
34
  <%- self_referenced = self_referenced_permission?(security_group, permission) -%>
37
- <%- unless self_referenced -%>
38
- security_groups = <%= security_groups_in(permission).inspect %>
39
- <%- end -%>
35
+ security_groups = <%= security_groups_in(permission, security_group).reject { |group_id| group_id == security_group.group_id }.inspect %>
40
36
  self = <%= self_referenced %>
41
37
  <%- end -%>
42
38
  }
@@ -0,0 +1,21 @@
1
+ <% queues.each do |queue| -%>
2
+ resource "aws_sqs_queue" "<%= module_name_of(queue) %>" {
3
+ name = "<%= module_name_of(queue) %>"
4
+ visibility_timeout_seconds = <%= queue["VisibilityTimeout"] %>
5
+ message_retention_seconds = <%= queue["MessageRetentionPeriod"] %>
6
+ max_message_size = <%= queue["MaximumMessageSize"] %>
7
+ delay_seconds = <%= queue["DelaySeconds"] %>
8
+ receive_wait_time_seconds = <%= queue["ReceiveMessageWaitTimeSeconds"] %>
9
+ <% if queue.key? "Policy" -%>
10
+ policy = <<POLICY
11
+ <%= prettify_policy(queue["Policy"], unescape: true) %>
12
+ POLICY
13
+ <% end -%>
14
+ <% if queue.key? "RedrivePolicy" -%>
15
+ redrive_policy = <<POLICY
16
+ <%= prettify_policy(queue["RedrivePolicy"], unescape: true) %>
17
+ POLICY
18
+ <% end -%>
19
+ }
20
+
21
+ <% end -%>
@@ -0,0 +1,14 @@
1
+ <% vpn_gateways.each do |vpn_gateway| -%>
2
+ <% unless vpn_gateway.vpc_attachments.empty? -%>
3
+ resource "aws_vpn_gateway" "<%= module_name_of(vpn_gateway) %>" {
4
+ vpc_id = "<%= vpn_gateway.vpc_attachments[0].vpc_id %>"
5
+ availability_zone = "<%= vpn_gateway.availability_zone %>"
6
+ tags {
7
+ <% vpn_gateway.tags.each do |tag| -%>
8
+ "<%= tag.key %>" = "<%= tag.value %>"
9
+ <% end -%>
10
+ }
11
+ }
12
+
13
+ <% end -%>
14
+ <% end -%>
@@ -1,3 +1,3 @@
1
1
  module Terraforming
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.0"
3
3
  end
@@ -19,17 +19,14 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_dependency "aws-sdk", "~> 2.2.7"
23
- spec.add_dependency "oj"
24
- spec.add_dependency "ox"
22
+ spec.add_dependency "aws-sdk", "~> 2.3.0"
23
+ spec.add_dependency "oj", "~> 2.15.0"
24
+ spec.add_dependency "ox", "~> 2.4.0"
25
25
  spec.add_dependency "thor"
26
26
 
27
27
  spec.add_development_dependency "bundler", "~> 1.7"
28
- spec.add_development_dependency "codeclimate-test-reporter"
29
- spec.add_development_dependency "guard"
30
- spec.add_development_dependency "guard-rspec"
31
- spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "coveralls", "~> 0.8.13"
29
+ spec.add_development_dependency "rake"
32
30
  spec.add_development_dependency "rspec", "~> 3.2"
33
31
  spec.add_development_dependency "simplecov", "~> 0.11.1"
34
- spec.add_development_dependency "terminal-notifier-guard"
35
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terraforming
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daisuke Fujita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-16 00:00:00.000000000 Z
11
+ date: 2016-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.2.7
19
+ version: 2.3.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.2.7
26
+ version: 2.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: oj
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 2.15.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 2.15.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: ox
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 2.4.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 2.4.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: thor
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -81,35 +81,21 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.7'
83
83
  - !ruby/object:Gem::Dependency
84
- name: codeclimate-test-reporter
84
+ name: coveralls
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: guard
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
87
+ - - "~>"
102
88
  - !ruby/object:Gem::Version
103
- version: '0'
89
+ version: 0.8.13
104
90
  type: :development
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
- - - ">="
94
+ - - "~>"
109
95
  - !ruby/object:Gem::Version
110
- version: '0'
96
+ version: 0.8.13
111
97
  - !ruby/object:Gem::Dependency
112
- name: guard-rspec
98
+ name: rake
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
101
  - - ">="
@@ -122,20 +108,6 @@ dependencies:
122
108
  - - ">="
123
109
  - !ruby/object:Gem::Version
124
110
  version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: rake
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: '10.0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: '10.0'
139
111
  - !ruby/object:Gem::Dependency
140
112
  name: rspec
141
113
  requirement: !ruby/object:Gem::Requirement
@@ -164,20 +136,6 @@ dependencies:
164
136
  - - "~>"
165
137
  - !ruby/object:Gem::Version
166
138
  version: 0.11.1
167
- - !ruby/object:Gem::Dependency
168
- name: terminal-notifier-guard
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - ">="
172
- - !ruby/object:Gem::Version
173
- version: '0'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ">="
179
- - !ruby/object:Gem::Version
180
- version: '0'
181
139
  description: Export existing AWS resources to Terraform style (tf, tfstate)
182
140
  email:
183
141
  - dtanshi45@gmail.com
@@ -197,6 +155,7 @@ files:
197
155
  - README.md
198
156
  - Rakefile
199
157
  - bin/terraforming
158
+ - contrib/zsh-completion/_terraforming
200
159
  - lib/terraforming.rb
201
160
  - lib/terraforming/cli.rb
202
161
  - lib/terraforming/resource/auto_scaling_group.rb
@@ -218,6 +177,7 @@ files:
218
177
  - lib/terraforming/resource/iam_user.rb
219
178
  - lib/terraforming/resource/iam_user_policy.rb
220
179
  - lib/terraforming/resource/internet_gateway.rb
180
+ - lib/terraforming/resource/launch_configuration.rb
221
181
  - lib/terraforming/resource/network_acl.rb
222
182
  - lib/terraforming/resource/network_interface.rb
223
183
  - lib/terraforming/resource/rds.rb
@@ -228,8 +188,10 @@ files:
228
188
  - lib/terraforming/resource/route_table_association.rb
229
189
  - lib/terraforming/resource/s3.rb
230
190
  - lib/terraforming/resource/security_group.rb
191
+ - lib/terraforming/resource/sqs.rb
231
192
  - lib/terraforming/resource/subnet.rb
232
193
  - lib/terraforming/resource/vpc.rb
194
+ - lib/terraforming/resource/vpn_gateway.rb
233
195
  - lib/terraforming/template/tf/auto_scaling_group.erb
234
196
  - lib/terraforming/template/tf/db_parameter_group.erb
235
197
  - lib/terraforming/template/tf/db_security_group.erb
@@ -249,6 +211,7 @@ files:
249
211
  - lib/terraforming/template/tf/iam_user.erb
250
212
  - lib/terraforming/template/tf/iam_user_policy.erb
251
213
  - lib/terraforming/template/tf/internet_gateway.erb
214
+ - lib/terraforming/template/tf/launch_configuration.erb
252
215
  - lib/terraforming/template/tf/network_acl.erb
253
216
  - lib/terraforming/template/tf/network_interface.erb
254
217
  - lib/terraforming/template/tf/rds.erb
@@ -259,8 +222,10 @@ files:
259
222
  - lib/terraforming/template/tf/route_table_association.erb
260
223
  - lib/terraforming/template/tf/s3.erb
261
224
  - lib/terraforming/template/tf/security_group.erb
225
+ - lib/terraforming/template/tf/sqs.erb
262
226
  - lib/terraforming/template/tf/subnet.erb
263
227
  - lib/terraforming/template/tf/vpc.erb
228
+ - lib/terraforming/template/tf/vpn_gateway.erb
264
229
  - lib/terraforming/util.rb
265
230
  - lib/terraforming/version.rb
266
231
  - script/console