An introduction to AWS OpsWorks and how it uses Chef. Differences between OpsWorks and Chef server.
Presented by Jonathan Weiss on January 14th 2014 at the Hamburg Chef User Group.
6. The Heart of the Service
Agent on each
Agent on each
Amazon EC2 instance
EC2 instance
Understands a set of commands that are
triggered by AWS OpsWorks.
The agent then runs a Chef solo run.
15. control
simple
Customization Options
Built-in layers
Override Chef attributes via custom JSON
Override Chef attributes via custom cookbook
Overwrite Chef template file
Deploy hooks
Provide custom recipe to extend built-in layer
Provide custom recipe to create custom layer
16. Life Cycle Events
• Give you fine-grained control
• Faster to execute
• Context
17. Push vs. Pull
• On-demand and automatic
• Respond immediately to changes in the stack
18. Discovery: Chef Search
AWS OpsWorks does not offer attribute search
Alternative:
node[:opsworks] with similar capabilities
to partial_search
19. AWS OpsWorks Attribute Tree
Find all Rails application servers
rails_servers = node['opsworks']['layers']['rails-app']['instances']
rails_ips = rails_servers.map{|i| i['private_ip'] }
template "/etc/rails-server.conf" do
...
variables({
:ips => rails_server_ips
})
end
20. Encrypted Data Bags
• Upload encrypted JSON to S3
• Have instances access via IAM roles in a recipe
21. Custom JSON
Arbitrary JSON on stack that is available in Chef
{
‘foo‘: {
‘bar‘: true,
‘baz‘: false
}
}
if node.foo.bar
...
elsif node.foo.baz
...
end
22. Store Secrets on Amazon S3
Access from instance via instance profiles
bucket = node['acme']['bucket']
key = node['acme']['key']
s3 = AWS::S3.new
obj = s3.buckets[bucket].objects[key]
obj.read
25. More information about AWS OpsWorks
•
•
•
•
•
•
•
Try it out https://console.aws.amazon.com/opsworks/
Follow us on twitter @AWSOpsWorks
Find us on YouTube
Blog http://blogs.aws.amazon.com/application-management
Docs http://aws.amazon.com/documentation/opsworks/
User tests opsworks-user-tests@amazon.com
Work with us http://jobs.aws-berlin.com