etude_for_aws 0.7.4

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.
Files changed (124) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +103 -0
  3. data/.rspec +2 -0
  4. data/.ruby-version +1 -0
  5. data/.yardopts +10 -0
  6. data/Dockerfile +17 -0
  7. data/Dockerfile-dev +20 -0
  8. data/Gemfile +6 -0
  9. data/Gemfile.lock +89 -0
  10. data/Guardfile +22 -0
  11. data/Jenkinsfile +11 -0
  12. data/README.md +26 -0
  13. data/Rakefile +12 -0
  14. data/Vagrantfile +15 -0
  15. data/bin/aws_console.rb +10 -0
  16. data/bin/console +14 -0
  17. data/bin/setup +8 -0
  18. data/circle.yml +22 -0
  19. data/config.yml +124 -0
  20. data/docker-compose.yml +9 -0
  21. data/docs/README.md +54 -0
  22. data/docs/_config.yml +6 -0
  23. data/docs/dev/cfm/cfm.md +9 -0
  24. data/docs/dev/cfm/images/vpc_core_model.png +0 -0
  25. data/docs/dev/cfm/images/vpc_type1.png +0 -0
  26. data/docs/dev/cfm/images/vpc_type2.png +0 -0
  27. data/docs/dev/cfm/images/vpc_type3.png +0 -0
  28. data/docs/dev/cfm/images/vpc_type4.png +0 -0
  29. data/docs/dev/cfm/images/vpc_type5.png +0 -0
  30. data/docs/dev/cfm/images/vpc_type6.png +0 -0
  31. data/docs/dev/cfm/images/vpc_type7.png +0 -0
  32. data/docs/dev/cfm/vpc/core_model.puml +35 -0
  33. data/docs/dev/cfm/vpc/vpc.md +39 -0
  34. data/docs/dev/cfm/vpc/vpc_type1.puml +17 -0
  35. data/docs/dev/cfm/vpc/vpc_type2.puml +23 -0
  36. data/docs/dev/cfm/vpc/vpc_type3.puml +24 -0
  37. data/docs/dev/cfm/vpc/vpc_type4.puml +23 -0
  38. data/docs/dev/cfm/vpc/vpc_type5.puml +25 -0
  39. data/docs/dev/cfm/vpc/vpc_type6.puml +26 -0
  40. data/docs/dev/cfm/vpc/vpc_type7.puml +39 -0
  41. data/docs/dev/ec2/core_model.puml +43 -0
  42. data/docs/dev/ec2/ec2.md +36 -0
  43. data/docs/dev/ec2/ec2_type1.puml +27 -0
  44. data/docs/dev/ec2/ec2_type2.puml +43 -0
  45. data/docs/dev/ec2/ec2_type3.puml +44 -0
  46. data/docs/dev/ec2/ec2_type4.puml +43 -0
  47. data/docs/dev/ec2/ec2_type5.puml +45 -0
  48. data/docs/dev/ec2/ec2_type6.puml +46 -0
  49. data/docs/dev/ec2/ec2_type7.puml +79 -0
  50. data/docs/dev/ec2/images/.keep +0 -0
  51. data/docs/dev/ec2/images/ec2_core_model.png +0 -0
  52. data/docs/dev/ec2/images/ec2_type1.png +0 -0
  53. data/docs/dev/ec2/images/ec2_type2.png +0 -0
  54. data/docs/dev/ec2/images/ec2_type3.png +0 -0
  55. data/docs/dev/ec2/images/ec2_type4.png +0 -0
  56. data/docs/dev/ec2/images/ec2_type5.png +0 -0
  57. data/docs/dev/ec2/images/ec2_type6.png +0 -0
  58. data/docs/dev/ec2/images/ec2_type7.png +0 -0
  59. data/docs/dev/vpc/core_model.puml +49 -0
  60. data/docs/dev/vpc/images/core_model.png +0 -0
  61. data/docs/dev/vpc/images/simple.png +0 -0
  62. data/docs/dev/vpc/images/standard.png +0 -0
  63. data/docs/dev/vpc/simple.puml +17 -0
  64. data/docs/dev/vpc/standard.puml +24 -0
  65. data/docs/dev/vpc/vpc.md +19 -0
  66. data/docs/ops/build_aws_sdk_repl.md +19 -0
  67. data/docs/ops/images/.keep +0 -0
  68. data/docs/ops/run_rake_task.md +89 -0
  69. data/docs/ops/ship_circleci.md +9 -0
  70. data/docs/ops/ship_jenkins.md +20 -0
  71. data/docs/ops/ship_ruby_gem.md +26 -0
  72. data/docs/template_catalog.md +6 -0
  73. data/docs/template_pattern.md +13 -0
  74. data/docs/template_recipe.md +6 -0
  75. data/docs/template_spec.md +8 -0
  76. data/etude_for_aws.gemspec +41 -0
  77. data/etude_for_aws.iml +42 -0
  78. data/exe/etude_for_aws +3 -0
  79. data/lib/etude_for_aws.rb +38 -0
  80. data/lib/etude_for_aws/cfm/configuration.rb +39 -0
  81. data/lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-1az-1subnet-pub.template +529 -0
  82. data/lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-1az-2subnet-pub-pri.template +790 -0
  83. data/lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-1az-2subnet-pub.template +634 -0
  84. data/lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-2az-2subnet-pri.template +645 -0
  85. data/lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-2az-2subnet-pub-pri.template +611 -0
  86. data/lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-2az-2subnet-pub.template +646 -0
  87. data/lib/etude_for_aws/cfm/vpc/cfm_templates/vpc-2az-4subnet-pub-pri.template +1010 -0
  88. data/lib/etude_for_aws/cfm/vpc/null_vpc.rb +13 -0
  89. data/lib/etude_for_aws/cfm/vpc/one_az_one_public_subnet_vpc.rb +45 -0
  90. data/lib/etude_for_aws/cfm/vpc/one_az_two_public_and_private_subnet_vpc.rb +47 -0
  91. data/lib/etude_for_aws/cfm/vpc/one_az_two_public_subnet_vpc.rb +47 -0
  92. data/lib/etude_for_aws/cfm/vpc/two_az_one_public_subnet_and_private_subnet_vpc.rb +52 -0
  93. data/lib/etude_for_aws/cfm/vpc/two_az_two_private_subnet_vpc.rb +38 -0
  94. data/lib/etude_for_aws/cfm/vpc/two_az_two_public_subnet_and_private_subnet_vpc.rb +38 -0
  95. data/lib/etude_for_aws/cfm/vpc/two_az_two_public_subnet_vpc.rb +38 -0
  96. data/lib/etude_for_aws/cfm/vpc/vpc.rb +104 -0
  97. data/lib/etude_for_aws/ec2/configuration.rb +66 -0
  98. data/lib/etude_for_aws/ec2/ec2.rb +218 -0
  99. data/lib/etude_for_aws/ec2/ec2_api_gateway.rb +127 -0
  100. data/lib/etude_for_aws/ec2/ec2_instance.rb +107 -0
  101. data/lib/etude_for_aws/ec2/key_pair.rb +46 -0
  102. data/lib/etude_for_aws/ec2/security_group.rb +75 -0
  103. data/lib/etude_for_aws/ec2/vpc_interface.rb +11 -0
  104. data/lib/etude_for_aws/helpers/certification_helper.rb +16 -0
  105. data/lib/etude_for_aws/helpers/configuration_helper.rb +103 -0
  106. data/lib/etude_for_aws/tasks/cfm.rake +73 -0
  107. data/lib/etude_for_aws/tasks/ec2.rake +210 -0
  108. data/lib/etude_for_aws/tasks/vpc.rake +47 -0
  109. data/lib/etude_for_aws/version.rb +3 -0
  110. data/lib/etude_for_aws/vpc/configuration.rb +77 -0
  111. data/lib/etude_for_aws/vpc/customer_gateway.rb +28 -0
  112. data/lib/etude_for_aws/vpc/internet_gateway.rb +15 -0
  113. data/lib/etude_for_aws/vpc/route_table.rb +42 -0
  114. data/lib/etude_for_aws/vpc/simple_vpc.rb +57 -0
  115. data/lib/etude_for_aws/vpc/standard_vpc.rb +94 -0
  116. data/lib/etude_for_aws/vpc/subnet.rb +22 -0
  117. data/lib/etude_for_aws/vpc/vpc.rb +147 -0
  118. data/lib/etude_for_aws/vpc/vpc_api_gateway.rb +277 -0
  119. data/lib/etude_for_aws/vpc/vpc_director.rb +43 -0
  120. data/lib/etude_for_aws/vpc/vpn.rb +244 -0
  121. data/lib/etude_for_aws/vpc/vpn_connection.rb +28 -0
  122. data/lib/etude_for_aws/vpc/vpn_director.rb +47 -0
  123. data/lib/etude_for_aws/vpc/vpn_gateway.rb +36 -0
  124. metadata +280 -0
@@ -0,0 +1,13 @@
1
+ module CFM
2
+ class NullVpc < Vpc
3
+ def initialize
4
+ super
5
+ end
6
+
7
+ def create
8
+ end
9
+
10
+ def destroy
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,45 @@
1
+ module CFM
2
+ class OneAzOnePublicSubnetVpc < Vpc
3
+ def initialize
4
+ super
5
+ template_file = @config.get_template_file(CFM::Vpc::TYPE.fetch(1))
6
+ file = get_template_full_path(template_file)
7
+ @config.template = File.read(file)
8
+ @config.parameters = [
9
+ {
10
+ parameter_key: "AZ1",
11
+ parameter_value: @config.azs[0],
12
+ use_previous_value: false,
13
+ },
14
+ ]
15
+ end
16
+
17
+ def get_subnet_info(logical_resource_id)
18
+ info = {}
19
+ info[:subnet_id] = @cfm.describe_stack_resource({stack_name: @config.stack_name, logical_resource_id: logical_resource_id}).stack_resource_detail.physical_resource_id
20
+ info[:az] = @config.azs[0]
21
+ info
22
+ end
23
+
24
+ def get_subnet_infos
25
+ infos = []
26
+ infos << get_subnet_info('Subnet')
27
+ infos
28
+ end
29
+ end
30
+
31
+ class OneAzOnePublicSubnetVpcStub < VpcStub
32
+ def get_subnet_info
33
+ info = {}
34
+ info[:subnet_id] = 'DUMMY_SUBNET_ID'
35
+ info[:az] = 'DUMMY_AZ'
36
+ info
37
+ end
38
+
39
+ def get_subnet_infos
40
+ infos = []
41
+ infos << get_subnet_info
42
+ infos
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,47 @@
1
+ module CFM
2
+ class OneAzTwoPublicAndPrivateSubnetVpc < Vpc
3
+ def initialize
4
+ super
5
+ template_file = @config.get_template_file(CFM::Vpc::TYPE.fetch(3))
6
+ file = get_template_full_path(template_file)
7
+ @config.template = File.read(file)
8
+ @config.parameters = [
9
+ {
10
+ parameter_key: "AZ1",
11
+ parameter_value: @config.azs[0],
12
+ use_previous_value: false,
13
+ },
14
+ ]
15
+ end
16
+
17
+ def get_subnet_info(logical_resource_id)
18
+ info = {}
19
+ info[:subnet_id] = @cfm.describe_stack_resource({stack_name: @config.stack_name, logical_resource_id: logical_resource_id}).stack_resource_detail.physical_resource_id
20
+ info[:az] = @config.azs[0]
21
+ info
22
+ end
23
+
24
+ def get_subnet_infos
25
+ infos = []
26
+ infos << get_subnet_info('PublicSubnet')
27
+ infos << get_subnet_info('PrivateSubnet')
28
+ infos
29
+ end
30
+ end
31
+
32
+ class OneAzTwoPublicAndPrivateSubnetVpcStub < VpcStub
33
+ def get_subnet_info
34
+ info = {}
35
+ info[:subnet_id] = 'DUMMY_SUBNET_ID'
36
+ info[:az] = 'DUMMY_AZ'
37
+ info
38
+ end
39
+
40
+ def get_subnet_infos
41
+ infos = []
42
+ infos << get_subnet_info
43
+ infos << get_subnet_info
44
+ infos
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,47 @@
1
+ module CFM
2
+ class OneAzTwoPublicSubnetVpc < Vpc
3
+ def initialize
4
+ super
5
+ template_file = @config.get_template_file(CFM::Vpc::TYPE.fetch(2))
6
+ file = get_template_full_path(template_file)
7
+ @config.template = File.read(file)
8
+ @config.parameters = [
9
+ {
10
+ parameter_key: "AZ1",
11
+ parameter_value: @config.azs[0],
12
+ use_previous_value: false,
13
+ },
14
+ ]
15
+ end
16
+
17
+ def get_subnet_info(logical_resource_id)
18
+ info = {}
19
+ info[:subnet_id] = @cfm.describe_stack_resource({stack_name: @config.stack_name, logical_resource_id: logical_resource_id}).stack_resource_detail.physical_resource_id
20
+ info[:az] = @config.azs[0]
21
+ info
22
+ end
23
+
24
+ def get_subnet_infos
25
+ infos = []
26
+ infos << get_subnet_info('PublicSubnet1a')
27
+ infos << get_subnet_info('PublicSubnet2a')
28
+ infos
29
+ end
30
+ end
31
+
32
+ class OneAzTwoPublicSubnetVpcStub < VpcStub
33
+ def get_subnet_info
34
+ info = {}
35
+ info[:subnet_id] = 'DUMMY_SUBNET_ID'
36
+ info[:az] = 'DUMMY_AZ'
37
+ info
38
+ end
39
+
40
+ def get_subnet_infos
41
+ infos = []
42
+ infos << get_subnet_info
43
+ infos << get_subnet_info
44
+ infos
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,52 @@
1
+ module CFM
2
+ class TwoAzOnePublicSubnetAndPrivateSubnetVpc < Vpc
3
+ def initialize
4
+ super
5
+ template_file = @config.get_template_file(CFM::Vpc::TYPE.fetch(6))
6
+ file = get_template_full_path(template_file)
7
+ @config.template = File.read(file)
8
+ @config.parameters = [
9
+ {
10
+ parameter_key: "AZ1",
11
+ parameter_value: @config.azs[0],
12
+ use_previous_value: false,
13
+ },
14
+ {
15
+ parameter_key: "AZ2",
16
+ parameter_value: @config.azs[1],
17
+ use_previous_value: false,
18
+ },
19
+ ]
20
+ end
21
+
22
+ def get_subnet_info(logical_resource_id,az)
23
+ info = {}
24
+ info[:subnet_id] = @cfm.describe_stack_resource({stack_name: @config.stack_name, logical_resource_id: logical_resource_id}).stack_resource_detail.physical_resource_id
25
+ info[:az] = az
26
+ info
27
+ end
28
+
29
+ def get_subnet_infos
30
+ infos = []
31
+ infos << get_subnet_info('PublicSubnet1a',@config.azs[0])
32
+ infos << get_subnet_info('PrivateSubnet1c',@config.azs[1])
33
+ infos
34
+ end
35
+ end
36
+
37
+ class TwoAzOnePublicSubnetAndPrivateSubnetVpcStub < VpcStub
38
+ def get_subnet_info
39
+ info = {}
40
+ info[:subnet_id] = 'DUMMY_SUBNET_ID'
41
+ info[:az] = 'DUMMY_AZ'
42
+ info
43
+ end
44
+
45
+ def get_subnet_infos
46
+ infos = []
47
+ infos << get_subnet_info
48
+ infos << get_subnet_info
49
+ infos
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,38 @@
1
+ module CFM
2
+ class TwoAzTwoPrivateSubnetVpc < Vpc
3
+ def initialize
4
+ super
5
+ template_file = @config.get_template_file(CFM::Vpc::TYPE.fetch(4))
6
+ file = get_template_full_path(template_file)
7
+ @config.template = File.read(file)
8
+ @config.parameters = [
9
+ {
10
+ parameter_key: "AZ1",
11
+ parameter_value: @config.azs[0],
12
+ use_previous_value: false,
13
+ },
14
+ {
15
+ parameter_key: "AZ2",
16
+ parameter_value: @config.azs[1],
17
+ use_previous_value: false,
18
+ },
19
+ ]
20
+ end
21
+ end
22
+
23
+ class TwoAzTwoPrivateSubnetVpcStub < VpcStub
24
+ def get_subnet_info
25
+ info = {}
26
+ info[:subnet_id] = 'DUMMY_SUBNET_ID'
27
+ info[:az] = 'DUMMY_AZ'
28
+ info
29
+ end
30
+
31
+ def get_subnet_infos
32
+ infos = []
33
+ infos << get_subnet_info
34
+ infos << get_subnet_info
35
+ infos
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,38 @@
1
+ module CFM
2
+ class TwoAzTwoPublicSubnetAndPrivateSubnetVpc < Vpc
3
+ def initialize
4
+ super
5
+ template_file = @config.get_template_file(CFM::Vpc::TYPE.fetch(7))
6
+ file = get_template_full_path(template_file)
7
+ @config.template = File.read(file)
8
+ @config.parameters = [
9
+ {
10
+ parameter_key: "AZ1",
11
+ parameter_value: @config.azs[0],
12
+ use_previous_value: false,
13
+ },
14
+ {
15
+ parameter_key: "AZ2",
16
+ parameter_value: @config.azs[1],
17
+ use_previous_value: false,
18
+ },
19
+ ]
20
+ end
21
+ end
22
+
23
+ class TwoAzTwoPublicSubnetAndPrivateSubnetVpcStub < VpcStub
24
+ def get_subnet_info
25
+ info = {}
26
+ info[:subnet_id] = 'DUMMY_SUBNET_ID'
27
+ info[:az] = 'DUMMY_AZ'
28
+ info
29
+ end
30
+
31
+ def get_subnet_infos
32
+ infos = []
33
+ infos << get_subnet_info
34
+ infos << get_subnet_info
35
+ infos
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,38 @@
1
+ module CFM
2
+ class TwoAzTwoPublicSubnetVpc < Vpc
3
+ def initialize
4
+ super
5
+ template_file = @config.get_template_file(CFM::Vpc::TYPE.fetch(5))
6
+ file = get_template_full_path(template_file)
7
+ @config.template = File.read(file)
8
+ @config.parameters = [
9
+ {
10
+ parameter_key: "AZ1",
11
+ parameter_value: @config.azs[0],
12
+ use_previous_value: false,
13
+ },
14
+ {
15
+ parameter_key: "AZ2",
16
+ parameter_value: @config.azs[1],
17
+ use_previous_value: false,
18
+ },
19
+ ]
20
+ end
21
+ end
22
+
23
+ class TwoAzTwoPublicSubnetVpcStub < VpcStub
24
+ def get_subnet_info
25
+ info = {}
26
+ info[:subnet_id] = 'DUMMY_SUBNET_ID'
27
+ info[:az] = 'DUMMY_AZ'
28
+ info
29
+ end
30
+
31
+ def get_subnet_infos
32
+ infos = []
33
+ infos << get_subnet_info
34
+ infos << get_subnet_info
35
+ infos
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,104 @@
1
+ module CFM
2
+ class Vpc
3
+ include EC2::VpcInterface
4
+
5
+ attr_reader :config
6
+
7
+ TYPE = {
8
+ 1 => :ONE_AZ_ONE_PUB,
9
+ 2 => :ONE_AZ_TWO_PUB,
10
+ 3 => :ONE_AZ_ONE_PUB_PRI,
11
+ 4 => :TWO_AZ_TWO_PRI,
12
+ 5 => :TWO_AZ_TWO_PUB,
13
+ 6 => :TWO_AZ_ONE_PUB_RPI,
14
+ 7 => :TWO_AZ_TWO_PUB_PRI
15
+ }
16
+
17
+ def initialize
18
+ @config = Configuration.new
19
+ @cfm = @config.create_client
20
+ set_vpc_id
21
+ end
22
+
23
+ def create
24
+ unless collect_stack_name.include?(@config.stack_name)
25
+ resp = @cfm.create_stack({
26
+ stack_name: @config.stack_name,
27
+ template_body: @config.template,
28
+ parameters: @config.parameters,
29
+ tags: [
30
+ {
31
+ key: 'Name',
32
+ value: @config.stack_tag_value,
33
+ },
34
+ ],
35
+ })
36
+ @cfm.wait_until(:stack_create_complete, {stack_name: @config.stack_name})
37
+ @config.stack_id = resp.stack_id
38
+ end
39
+ end
40
+
41
+ def destroy
42
+ if collect_stack_name.include?(@config.stack_name)
43
+ resp = @cfm.delete_stack({
44
+ stack_name: @config.stack_name,
45
+ })
46
+ @cfm.wait_until(:stack_delete_complete, {stack_name: @config.stack_name})
47
+ @config.stack_id = resp.to_s
48
+ @config.vpc_id = nil
49
+ end
50
+ end
51
+
52
+ def get_vpc_id
53
+ @config.vpc_id
54
+ end
55
+
56
+ def get_subnet_infos
57
+ end
58
+
59
+ protected
60
+ def get_template_full_path(template_file)
61
+ Dir.pwd + @config.template_path + template_file
62
+ end
63
+
64
+ private
65
+ def collect_stack_name
66
+ stack_names = []
67
+ @cfm.describe_stacks.stacks.each do |stack|
68
+ stack_names << stack.stack_name
69
+ end
70
+ stack_names
71
+ end
72
+
73
+ def select_vpc_id
74
+ @cfm.describe_stack_resource({stack_name: @config.stack_name, logical_resource_id: 'VPC'}).stack_resource_detail.physical_resource_id
75
+ end
76
+
77
+ def set_vpc_id
78
+ if collect_stack_name.include?(@config.stack_name)
79
+ @config.vpc_id = get_vpc_id
80
+ end
81
+ end
82
+ end
83
+
84
+ class VpcStub < Vpc
85
+ include EC2::VpcInterface
86
+
87
+ def initialize
88
+ super
89
+ @config = ConfigurationStub.new
90
+ @cfm = @config.create_client
91
+ end
92
+
93
+ def create
94
+ p "#{self.class} Create Virtual Private Cloud"
95
+ @config.stack_id = 'DUMMY'
96
+ end
97
+
98
+ def destroy
99
+ p "#{self.class} Destroy Virtual Private Cloud"
100
+ @config.stack_id = 'Aws::EmptyStructure'
101
+ @config.vpc_id = nil
102
+ end
103
+ end
104
+ end
@@ -0,0 +1,66 @@
1
+ module EC2
2
+ class Configuration
3
+ include ConfigurationHelper
4
+
5
+ attr_accessor :vpc_id,
6
+ :subnet_id,
7
+ :az,
8
+ :instance_tags
9
+
10
+ attr_reader :security_group_name,
11
+ :security_group_description,
12
+ :key_pair_name,
13
+ :key_pair_path,
14
+ :image_id,
15
+ :instance_type,
16
+ :min_count,
17
+ :max_count,
18
+ :instance_tags_public,
19
+ :instance_tags_private,
20
+ :stub
21
+
22
+ def initialize
23
+ ec2_config = get_yaml_ec2_config
24
+ @security_group_name = ec2_config['SECURITY_GROUP_NAME']
25
+ @security_group_description = ec2_config['SECURITY_GROUP_DESCRIPTION']
26
+ @key_pair_name = ec2_config['KEY_PAIR_NAME']
27
+ @key_pair_path = ec2_config['KEY_PAIR_PATH']
28
+ @image_id = ec2_config['IMAGE_ID']
29
+ @instance_type = ec2_config['INSTANCE_TYPE']
30
+ @min_count = ec2_config['MIN_COUNT'].to_i
31
+ @max_count = ec2_config['MAX_COUNT'].to_i
32
+
33
+ vpc_tags = get_yaml_vpc_tags
34
+ group_value = vpc_tags['GROUP']['VALUE']
35
+ instances = get_yaml_ec2_instances
36
+ @instance_tags_public = []
37
+ unless instances['PUBLIC'].nil?
38
+ instances['PUBLIC'].each do |v|
39
+ name_value = v['CONFIG']['INSTANCE_TAGS'].first['NAME']['VALUE']
40
+ @instance_tags_public << [{key: 'Name', value: name_value}, {key: 'Group', value: group_value}]
41
+ end
42
+ end
43
+ @instance_tags_private = []
44
+ unless instances['PRIVATE'].nil?
45
+ instances['PRIVATE'].each do |v|
46
+ name_value = v['CONFIG']['INSTANCE_TAGS'].first['NAME']['VALUE']
47
+ @instance_tags_private << [{key: 'Name', value: name_value}, {key: 'Group', value: group_value}]
48
+ end
49
+ end
50
+ @instance_tags = []
51
+
52
+ @stub = false
53
+ end
54
+
55
+ def stub?
56
+ @stub
57
+ end
58
+ end
59
+
60
+ class ConfigurationStub < Configuration
61
+ def initialize
62
+ super
63
+ @stub = true
64
+ end
65
+ end
66
+ end