awspec 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -0
  3. data/doc/_resource_types/rds_db_parameter_group.md +8 -0
  4. data/doc/resource_types.md +32 -25
  5. data/lib/awspec.rb +2 -0
  6. data/lib/awspec/bin/toolbox +5 -0
  7. data/lib/awspec/generator.rb +5 -1
  8. data/lib/awspec/generator/doc/type.rb +26 -0
  9. data/lib/awspec/generator/doc/type/auto_scaling_group.rb +16 -0
  10. data/lib/awspec/generator/doc/type/base.rb +89 -0
  11. data/lib/awspec/generator/doc/type/ebs.rb +17 -0
  12. data/lib/awspec/generator/doc/type/ec2.rb +17 -0
  13. data/lib/awspec/generator/doc/type/elb.rb +20 -0
  14. data/lib/awspec/generator/doc/type/rds.rb +17 -0
  15. data/lib/awspec/generator/doc/type/rds_db_parameter_group.rb +16 -0
  16. data/lib/awspec/generator/doc/type/route53_hosted_zone.rb +16 -0
  17. data/lib/awspec/generator/doc/type/route_table.rb +16 -0
  18. data/lib/awspec/generator/doc/type/s3.rb +16 -0
  19. data/lib/awspec/generator/doc/type/security_group.rb +16 -0
  20. data/lib/awspec/generator/doc/type/subnet.rb +16 -0
  21. data/lib/awspec/generator/doc/type/vpc.rb +17 -0
  22. data/lib/awspec/generator/template.rb +100 -0
  23. data/lib/awspec/stub.rb +7 -0
  24. data/lib/awspec/stub/auto_scaling_group.rb +87 -0
  25. data/lib/awspec/stub/ebs.rb +66 -0
  26. data/lib/awspec/stub/ec2.rb +117 -0
  27. data/lib/awspec/stub/elb.rb +129 -0
  28. data/lib/awspec/stub/rds.rb +93 -0
  29. data/lib/awspec/stub/rds_db_parameter_group.rb +16 -0
  30. data/lib/awspec/stub/route53_hosted_zone.rb +83 -0
  31. data/lib/awspec/stub/route_table.rb +60 -0
  32. data/lib/awspec/stub/s3.rb +14 -0
  33. data/lib/awspec/stub/security_group.rb +66 -0
  34. data/lib/awspec/stub/subnet.rb +33 -0
  35. data/lib/awspec/stub/vpc.rb +69 -0
  36. data/lib/awspec/toolbox.rb +13 -0
  37. data/lib/awspec/version.rb +1 -1
  38. metadata +33 -16
  39. data/lib/awspec/docgen.rb +0 -23
  40. data/lib/awspec/generator/doc/auto_scaling_group.rb +0 -15
  41. data/lib/awspec/generator/doc/base.rb +0 -74
  42. data/lib/awspec/generator/doc/ebs.rb +0 -15
  43. data/lib/awspec/generator/doc/ec2.rb +0 -15
  44. data/lib/awspec/generator/doc/elb.rb +0 -18
  45. data/lib/awspec/generator/doc/rds.rb +0 -15
  46. data/lib/awspec/generator/doc/rds_db_parameter_group.rb +0 -15
  47. data/lib/awspec/generator/doc/route53_hosted_zone.rb +0 -15
  48. data/lib/awspec/generator/doc/route_table.rb +0 -15
  49. data/lib/awspec/generator/doc/s3.rb +0 -15
  50. data/lib/awspec/generator/doc/security_group.rb +0 -15
  51. data/lib/awspec/generator/doc/subnet.rb +0 -15
  52. data/lib/awspec/generator/doc/vpc.rb +0 -15
@@ -0,0 +1,129 @@
1
+ Aws.config[:elasticloadbalancing] = {
2
+ stub_responses: {
3
+ describe_load_balancers: {
4
+ load_balancer_descriptions: [
5
+ {
6
+ load_balancer_name: 'my-elb',
7
+ subnets: [
8
+ 'subnet-1234a567'
9
+ ],
10
+ instances: [
11
+ {
12
+ instance_id: 'i-ec12345a'
13
+ }
14
+ ],
15
+ health_check: {
16
+ target: 'HTTP:80/index.php',
17
+ interval: 60,
18
+ timeout: 5,
19
+ unhealthy_threshold: 10,
20
+ healthy_threshold: 2
21
+ },
22
+ security_groups: [
23
+ 'my-lb-security-group-name'
24
+ ],
25
+ policies: {},
26
+ source_security_group: {},
27
+ listener_descriptions: [
28
+ {
29
+ listener: {
30
+ protocol: 'HTTPS',
31
+ load_balancer_port: 443,
32
+ instance_protocol: 'HTTP',
33
+ instance_port: 80
34
+ }
35
+ }
36
+ ],
37
+ vpc_id: 'vpc-ab123cde'
38
+ }
39
+ ]
40
+ }
41
+ }
42
+ }
43
+ Aws.config[:ec2] = {
44
+ stub_responses: {
45
+ describe_instances: {
46
+ reservations: [
47
+ {
48
+ instances: [
49
+ {
50
+ instance_id: 'i-ec12345a',
51
+ image_id: 'ami-abc12def',
52
+ vpc_id: 'vpc-ab123cde',
53
+ subnet_id: 'subnet-1234a567',
54
+ public_ip_address: '123.0.456.789',
55
+ private_ip_address: '10.0.1.1',
56
+ instance_type: 't2.small',
57
+ state: {
58
+ name: 'running'
59
+ },
60
+ security_groups: [
61
+ {
62
+ group_id: 'sg-1a2b3cd4',
63
+ group_name: 'my-security-group-name'
64
+ }
65
+ ],
66
+ block_device_mappings: [
67
+ {
68
+ device_name: '/dev/sda',
69
+ ebs: {
70
+ volume_id: 'vol-123a123b'
71
+ }
72
+ }
73
+ ],
74
+ tags: [
75
+ {
76
+ key: 'Name',
77
+ value: 'my-ec2'
78
+ }
79
+ ]
80
+ }
81
+ ]
82
+ }
83
+ ]
84
+ },
85
+ describe_security_groups: {
86
+ security_groups: [
87
+ {
88
+ group_id: 'sg-5a2b3cd4',
89
+ group_name: 'my-lb-security-group-name',
90
+ tags: [
91
+ {
92
+ key: 'Name',
93
+ value: 'my-lb-security-group-tag-name'
94
+ }
95
+ ]
96
+ }
97
+ ]
98
+ },
99
+ describe_vpcs: {
100
+ vpcs: [
101
+ {
102
+ vpc_id: 'vpc-ab123cde',
103
+ tags: [
104
+ {
105
+ key: 'Name',
106
+ value: 'my-vpc'
107
+ }
108
+ ]
109
+ }
110
+ ]
111
+ },
112
+ describe_subnets: {
113
+ subnets: [
114
+ {
115
+ state: 'available',
116
+ vpc_id: 'vpc-ab123cde',
117
+ subnet_id: 'subnet-1234a567',
118
+ cidr_block: '10.0.1.0/24',
119
+ tags: [
120
+ {
121
+ key: 'Name',
122
+ value: 'my-subnet'
123
+ }
124
+ ]
125
+ }
126
+ ]
127
+ }
128
+ }
129
+ }
@@ -0,0 +1,93 @@
1
+ Aws.config[:rds] = {
2
+ stub_responses: {
3
+ describe_db_instances: {
4
+ db_instances: [
5
+ {
6
+ db_instance_identifier: 'my-rds',
7
+ db_instance_status: 'available',
8
+ db_instance_class: 'db.t2.medium',
9
+ vpc_security_groups: [
10
+ {
11
+ vpc_security_group_id: 'sg-5a6b7cd8'
12
+ }
13
+ ],
14
+ db_subnet_group: {
15
+ vpc_id: 'vpc-ab123cde',
16
+ db_subnet_group_name: 'my-db-subnet-group',
17
+ subnets: [
18
+ {
19
+ subnet_identifier: 'subnet-8901b123',
20
+ subnet_availability_zone: {
21
+ name: 'ap-northeast-1a'
22
+ }
23
+ }
24
+ ]
25
+ },
26
+ db_parameter_groups: [
27
+ {
28
+ db_parameter_group_name: 'default.mysql5.6'
29
+ },
30
+ {
31
+ db_parameter_group_name: 'custom.mysql5.6'
32
+ }
33
+ ],
34
+ option_group_memberships: [
35
+ {
36
+ option_group_name: 'default:mysql-5-6'
37
+ },
38
+ {
39
+ option_group_name: 'custom:mysql-5-6'
40
+ }
41
+ ],
42
+ availability_zone: 'ap-northeast-1a',
43
+ multi_az: false
44
+ }
45
+ ]
46
+ }
47
+ }
48
+ }
49
+
50
+ Aws.config[:ec2] = {
51
+ stub_responses: {
52
+ describe_vpcs: {
53
+ vpcs: [
54
+ {
55
+ vpc_id: 'vpc-ab123cde',
56
+ tags: [
57
+ {
58
+ key: 'Name',
59
+ value: 'my-vpc'
60
+ }
61
+ ]
62
+ }
63
+ ]
64
+ },
65
+ describe_security_groups: {
66
+ security_groups: [
67
+ {
68
+ group_id: 'sg-5a6b7cd8',
69
+ group_name: 'group-name-sg',
70
+ tags: [
71
+ {
72
+ key: 'Name',
73
+ value: 'my-db-sg'
74
+ }
75
+ ]
76
+ }
77
+ ]
78
+ },
79
+ describe_subnets: {
80
+ subnets: [
81
+ {
82
+ subnet_id: 'subnet-8901b123',
83
+ tags: [
84
+ {
85
+ key: 'Name',
86
+ value: 'db-subnet-a'
87
+ }
88
+ ]
89
+ }
90
+ ]
91
+ }
92
+ }
93
+ }
@@ -0,0 +1,16 @@
1
+ Aws.config[:rds] = {
2
+ stub_responses: {
3
+ describe_db_parameters: {
4
+ parameters: [
5
+ {
6
+ parameter_name: 'basedir',
7
+ parameter_value: '/rdsdbbin/mysql'
8
+ },
9
+ {
10
+ parameter_name: 'innodb_buffer_pool_size',
11
+ parameter_value: '{DBInstanceClassMemory*3/4}'
12
+ }
13
+ ]
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,83 @@
1
+ Aws.config[:route53] = {
2
+ stub_responses: {
3
+ list_hosted_zones: {
4
+ hosted_zones: [
5
+ {
6
+ id: '/hostedzone/Z1A2BCDEF34GH5',
7
+ name: 'example.com.',
8
+ caller_reference: '',
9
+ resource_record_set_count: 5
10
+ }
11
+ ],
12
+ marker: '',
13
+ is_truncated: true,
14
+ next_marker: '',
15
+ max_items: 100
16
+ },
17
+ list_resource_record_sets: {
18
+ resource_record_sets: [
19
+ {
20
+ name: 'example.com.',
21
+ type: 'A',
22
+ ttl: 3600,
23
+ resource_records: [
24
+ {
25
+ value: '123.456.7.890'
26
+ }
27
+ ]
28
+ },
29
+ {
30
+ name: 'example.com.',
31
+ type: 'MX',
32
+ ttl: 3600,
33
+ resource_records: [
34
+ {
35
+ value: '10 mail.example.com'
36
+ }
37
+ ]
38
+ },
39
+ {
40
+ name: 'mail.example.com.',
41
+ type: 'A',
42
+ ttl: 3600,
43
+ resource_records: [
44
+ {
45
+ value: '123.456.7.890'
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ name: 'example.com.',
51
+ type: 'NS',
52
+ ttl: 172_800,
53
+ resource_records: [
54
+ {
55
+ value: 'ns-123.awsdns-45.net.'
56
+ },
57
+ {
58
+ value: 'ns-6789.awsdns-01.org.'
59
+ },
60
+ {
61
+ value: 'ns-2345.awsdns-67.co.uk.'
62
+ },
63
+ {
64
+ value: 'ns-890.awsdns-12.com.'
65
+ }
66
+ ]
67
+ },
68
+ {
69
+ name: 's3.example.com.',
70
+ type: 'A',
71
+ resource_records: [],
72
+ alias_target: {
73
+ hosted_zone_id: 'Z2ABCDEFGHIJKL',
74
+ dns_name: 's3-website-us-east-1.amazonaws.com.',
75
+ evaluate_target_health: false
76
+ }
77
+ }
78
+ ],
79
+ is_truncated: true,
80
+ max_items: 100
81
+ }
82
+ }
83
+ }
@@ -0,0 +1,60 @@
1
+ Aws.config[:ec2] = {
2
+ stub_responses: {
3
+ describe_route_tables: {
4
+ route_tables: [
5
+ {
6
+ route_table_id: 'rtb-a12bcd34',
7
+ vpc_id: 'vpc-ab123cde',
8
+ routes: [
9
+ {
10
+ destination_cidr_block: '10.0.0.0/16',
11
+ destination_prefix_list_id: nil,
12
+ gateway_id: 'local',
13
+ instance_id: nil,
14
+ instance_owner_id: nil,
15
+ network_interface_id: nil,
16
+ vpc_peering_connection_id: nil,
17
+ state: 'active'
18
+ },
19
+ {
20
+ destination_cidr_block: '0.0.0.0/0',
21
+ destination_prefix_list_id: nil,
22
+ gateway_id: 'igw-1ab2345c',
23
+ instance_id: nil,
24
+ instance_owner_id: nil,
25
+ network_interface_id: nil,
26
+ vpc_peering_connection_id: nil,
27
+ state: 'active'
28
+ }
29
+ ],
30
+ tags: [
31
+ {
32
+ key: 'Name',
33
+ value: 'my-route-table'
34
+ }
35
+ ]
36
+ }
37
+ ]
38
+ },
39
+ describe_internet_gateways: {
40
+ internet_gateways: [
41
+ {
42
+ internet_gateway_id: 'igw-1ab2345c',
43
+ attachments:
44
+ [
45
+ {
46
+ vpc_id: 'vpc-ab123cde',
47
+ state: 'available'
48
+ }
49
+ ],
50
+ tags: [
51
+ {
52
+ key: 'Name',
53
+ value: 'my-igw'
54
+ }
55
+ ]
56
+ }
57
+ ]
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,14 @@
1
+ Aws.config[:s3] = {
2
+ stub_responses: {
3
+ list_buckets: {
4
+ buckets: [
5
+ {
6
+ name: 'my-bucket'
7
+ }
8
+ ]
9
+ },
10
+ head_object: {
11
+ content_type: 'binary/octet-stream'
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,66 @@
1
+ Aws.config[:ec2] = {
2
+ stub_responses: {
3
+ describe_security_groups: {
4
+ security_groups: [
5
+ {
6
+ vpc_id: 'vpc-ab123cde',
7
+ group_id: 'sg-1a2b3cd4',
8
+ group_name: 'my-security-group-name',
9
+ ip_permissions: [
10
+ {
11
+ from_port: 80,
12
+ to_port: 80,
13
+ ip_protocol: 'tcp',
14
+ ip_ranges: [
15
+ {
16
+ cidr_ip: '123.456.789.012/32'
17
+ },
18
+ {
19
+ cidr_ip: '456.789.123.456/32'
20
+ }
21
+ ],
22
+ user_id_group_pairs: []
23
+ },
24
+ {
25
+ from_port: 22,
26
+ to_port: 22,
27
+ ip_protocol: 'tcp',
28
+ ip_ranges: [],
29
+ user_id_group_pairs: [
30
+ {
31
+ group_id: 'sg-5a6b7cd8',
32
+ group_name: 'group-name-sg'
33
+ }
34
+ ]
35
+ }
36
+ ],
37
+ ip_permissions_egress: [
38
+ {
39
+ from_port: nil,
40
+ to_port: nil,
41
+ ip_protocol: '-1',
42
+ ip_ranges: [
43
+ {
44
+ cidr_ip: '0.0.0.0/0'
45
+ }
46
+ ]
47
+ }
48
+ ]
49
+ }
50
+ ]
51
+ },
52
+ describe_vpcs: {
53
+ vpcs: [
54
+ {
55
+ vpc_id: 'vpc-ab123cde',
56
+ tags: [
57
+ {
58
+ key: 'Name',
59
+ value: 'my-vpc'
60
+ }
61
+ ]
62
+ }
63
+ ]
64
+ }
65
+ }
66
+ }