"AWS OpsWorks helps you deploy and operate applications of all shapes and sizes. With AWS OpsWorks, you can model your application stack with layers that define the building blocks of your application: load balancers, application servers, databases, etc. But did you know that you can also use AWS OpsWorks to run commands or scripts on your instances? Whether you need to perform a specific task or install a new software package, AWS OpsWorks gives you the tools to install and configure your instances consistently and help them evolve in an automated and predictable fashion.
In this session, we dive into how you can create custom layers and a runtime system for your operational tooling, understand the lifecycle events, and show how to develop and test locally."
2. Agenda
• Chef in AWS OpsWorks
• Chef 12.x integration
• Windows support
• Amazon ECS integration + Demo
• Amazon EC2 import and on-premises servers + Demo
7. Chef integration
• Supports Chef 11.10 and Chef 12.x
• Built-in convenience cookbooks / bring your own
• Chef run is triggered by lifecycle event firing:
push vs. pull
• Event comes with stack state JSON
16. Custom recipes – Chef 11.10
Single Chef run with a merged run_list
AWS
OpsWorks
Recipes
Your
Custom
Recipes
Combined Chef run using the same environment
17. Custom recipes – Chef 12.x
Two separate Chef runs and thus separate run_lists
AWS
OpsWorks
Recipes
Your
Custom
Recipes
Internal environment Customer environment
chef-client 12.x
18. Chef 12.x environment
Customer-only Chef run:
• Empty run_list
• No OpsWorks cookbooks polluting your namespace
• node[:opsworks] no longer present, use search instead
19. Search
Stack state JSON available through search
search(:node, “name:web1”)
search(:node, “name:web*”)
Attributes generated on nodes are not available
20. Search
appserver = search(:node, "role:php-app").first
Chef::Log.info(”Private IP: #{appserver[:private_ip]}")
Exposes: hostname/FQDN, IP/DNS, private IP/DNS,
instance type, AMI ID, AZ, …
25. Encrypted Data Bags
Alternative handling:
• App environment variables
• Upload encrypted JSON to Amazon S3
• Leverage IAM roles for Amazon EC2 in recipe
28. Windows support
Supported as default AMIs:
• Windows Server 2012 R2 Standard
• Windows Server 2012 R2 SQL Server Express
• Windows Server 2012 R2 SQL Server Standard
• Windows Server 2012 R2 SQL Server Web
29. Chef environment on Windows
Chef environment:
• Chef 12
• Only custom layers
• No Berkshelf
33. Amazon EC2 Container Service (Amazon ECS)
• Highly scalable and fast container management service
that makes it easy to run and manage Docker containers
on a cluster of Amazon EC2 instances
• Lets you launch and manage container-enabled
applications with simple API calls
• Monitor the state of your cluster with a centralized
service
34. Amazon ECS integration in AWS OpsWorks
• Streamlined ECS container instances provisioning and
management
• ECS container instances operating system and package
updates
• User permission management
• ECS container instance performance monitoring
• Amazon EBS volume management
• Public and Elastic IP address management
• Security group management
37. Motivation
• Manage servers not running on Amazon EC2 with
AWS OpsWorks
• Enable hybrid environments
• Run development and test stacks on EC2 before
deploying to your on-premises fleet
• Scale out from your on-premises server infrastructure to
Amazon EC2
38. Support for on-premises servers (I)
• Deploy and operate applications on any server with
Internet connection including physical hardware and
VMs in your datacenter
• AWS OpsWorks can update operating systems and
software across your entire fleet
• AWS OpsWorks can run scripts or Chef recipes for you
on your entire fleet
• You can control who can run scripts and you are able to
view a history of each script that has been run
39. Support for on-premises servers (II)
• Manage operating system users and ssh/sudo access
• Amazon CloudWatch metrics for CPU, memory and load
for your on-premises servers
• Pricing: $0.02/hour per registered on-premises server
40. Support for existing Amazon EC2 instances
• Installs the AWS OpsWorks agent on already running
Amazon EC2 instances
• Registers the instances to existing OpsWorks stacks
• Assigns the instances to one or multiple OpsWorks
layers
• Benefit from AWS OpsWorks management features
• No additional charges