convection 0.2.33 → 0.2.34.pre.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -0
  3. data/CONTRIBUTING.md +22 -0
  4. data/README.md +15 -202
  5. data/Rakefile +3 -0
  6. data/docs/adding-new-resource-coverage.md +265 -0
  7. data/docs/canceling-stack-updates.md +5 -0
  8. data/docs/deleting-stacks.md +5 -0
  9. data/docs/getting-started.md +904 -0
  10. data/docs/index.md +69 -0
  11. data/docs/pygment.css +62 -0
  12. data/docs/relationship-to-cloudformation.md +51 -0
  13. data/docs/stacks.md +86 -0
  14. data/docs/template.html +130 -0
  15. data/example/getting-started-guide/Cloudfile +12 -0
  16. data/example/getting-started-guide/vpc.rb +74 -0
  17. data/example/stacks/Cloudfile +12 -0
  18. data/example/stacks/tasks/lookup_vpc_task.rb +28 -0
  19. data/example/stacks/templates/vpc.rb +14 -0
  20. data/lib/convection.rb +6 -0
  21. data/lib/convection/control/cloud.rb +1 -0
  22. data/lib/convection/control/stack.rb +126 -15
  23. data/lib/convection/model/cloudfile.rb +3 -0
  24. data/lib/convection/model/template/resource/aws_cloudfront_distribution.rb +24 -30
  25. data/lib/convection/model/template/resource/aws_ec2_dhcp_options.rb +38 -0
  26. data/lib/convection/model/template/resource/aws_ec2_security_group.rb +24 -2
  27. data/lib/convection/model/template/resource/aws_iam_user.rb +17 -3
  28. data/lib/convection/model/template/resource/aws_s3_bucket.rb +9 -3
  29. data/lib/convection/model/template/resource/aws_s3_bucket_policy.rb +10 -3
  30. data/lib/convection/model/template/resource/aws_sns_topic.rb +6 -3
  31. data/lib/convection/model/template/resource/aws_sns_topic_policy.rb +10 -3
  32. data/lib/convection/model/template/resource/aws_sqs_queue.rb +5 -3
  33. data/lib/convection/model/template/resource/aws_sqs_queue_policy.rb +10 -3
  34. data/spec/convection/model/template/resource/ec2_dhcp_options_spec.rb +55 -0
  35. data/yard_extensions.rb +4 -0
  36. data/yard_extensions/properties_handler.rb +30 -0
  37. data/yard_extensions/type_handler.rb +188 -0
  38. metadata +27 -23
  39. data/example/Cloudfile +0 -13
  40. data/example/deprecated/elb.rb +0 -27
  41. data/example/deprecated/iam_access_key.rb +0 -18
  42. data/example/deprecated/iam_group.rb +0 -31
  43. data/example/deprecated/iam_role.rb +0 -52
  44. data/example/deprecated/iam_user.rb +0 -31
  45. data/example/deprecated/rds.rb +0 -70
  46. data/example/deprecated/s3.rb +0 -13
  47. data/example/deprecated/sqs.rb +0 -32
  48. data/example/deprecated/vpc.rb +0 -85
  49. data/example/instances.rb +0 -93
  50. data/example/output/vpc.json +0 -335
  51. data/example/security-groups.rb +0 -77
  52. data/example/sqs-queue/Cloudfile +0 -19
  53. data/example/sqs-queue/README.md +0 -12
  54. data/example/trust_cloudtrail.rb +0 -24
  55. data/example/vpc.rb +0 -143
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- region 'us-east-1'
4
- name 'convection-sqs-queue-example'
5
-
6
- sqs_queue = template do
7
- description 'An example template for setting up a SQS queue with Convection'
8
-
9
- sqs_queue 'ExampleSQSQueue' do
10
- delay_seconds 0 # The time in seconds that delivery of messages is queued
11
- maximum_message_size 262144 # How many bytes a message can contain before it's rejected
12
- message_retention_period 345600 # The time in seconds a message stays in the queue
13
- queue_name 'ExampleSQSQueue' # The name of the queue
14
- receive_message_wait_time_seconds 0 # Set to non-zero to enable long polling
15
- visibility_timeout 30 # The time in seconds the queue will be unavailable once a message is delivered
16
- end
17
- end
18
-
19
- stack 'convection-sqs-queue-example', sqs_queue
@@ -1,12 +0,0 @@
1
- # Creating a SQS queue in AWS #
2
-
3
- This example shows how to set up a SQS queue in AWS. The values provided in the
4
- template match the default values from the [AWS::SQS::Queue][sqs] resource. If
5
- you leave a property blank, it will use the default value.
6
-
7
- Run `convetion diff` to see what the template will create.
8
-
9
- Run `convection converge` to create the example SQS queue.
10
-
11
-
12
- [sqs]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-queues.html
@@ -1,24 +0,0 @@
1
- require 'convection'
2
-
3
- module CLOUDTRAIL
4
- #IAM role to create a log stream & put events
5
- iam_role 'role' do
6
- path "/"
7
- #defines trust relationship
8
- trust_cloudtrail
9
-
10
- policy 'CreateStreamPolicy' do
11
- allow do
12
- resource 'arn:aws:logs:*:*:*'
13
- action 'logs:CreateLogStream'
14
- end
15
- end
16
-
17
- policy 'PutEventsPolicy' do
18
- allow do
19
- resource 'arn:aws:logs:*:*:*'
20
- action 'logs:PutLogEvents'
21
- end
22
- end
23
- end
24
- end
@@ -1,143 +0,0 @@
1
- require_relative '../lib/convection'
2
-
3
- module Convection
4
- module Demo
5
- VPC = Convection.template do
6
- description 'Demo VPC'
7
-
8
- ## Define the VPC
9
- ec2_vpc 'TargetVPC' do
10
- network stack['subnet']
11
- subnet_length 24
12
- enable_dns true
13
-
14
- tag 'Name', stack.cloud
15
- tag 'Stack', stack.cloud
16
- with_output 'id'
17
-
18
- #
19
- # PUBLIC SUBNETS
20
- #
21
-
22
- ## Add an InternetGateway
23
- add_internet_gateway
24
-
25
- public_acl = add_network_acl 'Public' do
26
- entry 'AllowAllIngress' do
27
- action 'allow'
28
- number 100
29
- network '0.0.0.0/0'
30
- protocol :any
31
- range :From => 0,
32
- :To => 65_535
33
- end
34
-
35
- entry 'AllowAllEgress' do
36
- action 'allow'
37
- number 100
38
- egress true
39
- network '0.0.0.0/0'
40
- protocol :any
41
- range :From => 0,
42
- :To => 65_535
43
- end
44
-
45
- tag 'Name', "acl-public-#{ stack.cloud }"
46
- tag 'Stack', stack.cloud
47
- end
48
-
49
- public_table = add_route_table 'Public', :gateway_route => true do
50
- tag 'Name', "routes-public-#{ stack.cloud }"
51
- tag 'Stack', stack.cloud
52
- end
53
-
54
- stack.availability_zones do |zone, i|
55
- add_subnet "Public#{ i }" do
56
- availability_zone zone
57
- acl public_acl
58
- route_table public_table
59
-
60
- with_output
61
-
62
- immutable_metadata "public-#{ stack.cloud }"
63
- tag 'Name', "subnet-public-#{ stack.cloud }-#{ zone }"
64
- tag 'Stack', stack.cloud
65
- tag 'Service', 'Public'
66
- end
67
- end
68
-
69
-
70
- #
71
- # PRIVATE SUBNETS
72
- # These subnets don't support a public IP, but can access the internet
73
- # via a NAT Gateway
74
- #
75
-
76
- private_acl = add_network_acl('Private') do
77
- entry 'AllowAllIngress' do
78
- action 'allow'
79
- number 100
80
- network '0.0.0.0/0'
81
- protocol :any
82
- range :From => 0,
83
- :To => 65_535
84
- end
85
-
86
- entry 'AllowAllEgress' do
87
- action 'allow'
88
- number 100
89
- egress true
90
- network '0.0.0.0/0'
91
- protocol :any
92
- range :From => 0,
93
- :To => 65_535
94
- end
95
-
96
- tag 'Name', "acl-private-#{ stack.cloud }"
97
- tag 'Stack', stack.cloud
98
- end
99
-
100
- private_table = add_route_table('Private', :gateway_route => false) do
101
- tag 'Name', "routes-private-#{ stack.cloud }"
102
- tag 'Stack', stack.cloud
103
- end
104
-
105
- stack.availability_zones do |zone, i|
106
- add_subnet "Private#{ i }" do
107
- availability_zone zone
108
- acl private_acl
109
- route_table private_table
110
-
111
- with_output
112
-
113
- immutable_metadata "private-#{ stack.cloud }"
114
- tag 'Name', "subnet-public-#{ stack.cloud }-#{ zone }"
115
- tag 'Stack', stack.cloud
116
- tag 'Service', 'Private'
117
- end
118
- end
119
-
120
- ## Add a NAT Gateway
121
- stack.availability_zones do |zone, i|
122
- ec2_eip "NatGatewayIP#{i}" do
123
- domain 'vpc'
124
- end
125
-
126
- ec2_nat_gateway "NatGateway#{i}" do
127
- subnet fn_ref("TargetVPCSubnetPublic#{i}")
128
- allocation_id get_att("NatGatewayIP#{i}", 'AllocationId')
129
- end
130
-
131
- ec2_route "NatGatewayRoute#{i}" do
132
- destination '0.0.0.0/0'
133
- nat_gateway fn_ref("NatGateway#{i}")
134
- route_table_id private_table
135
- end
136
-
137
- # Create a NAT Gateway in only one AZ to save $$$
138
- break
139
- end
140
- end
141
- end
142
- end
143
- end