Opsworks Introduction

AWS OpsWorks is an configuration management service that provides an easy way to create and manage AWS stacks and application.

You can preset your AWS resourcce and manage the configuration, deploy those resources and monitor the status of the resources activity.

Here is a AWS Cloudformation IaC process, it need you manual setting:

Code templates (Yaml or Json) -> Upload to S3 bucket -> Create stack (can created by console, api or CLI) -> Stacks and resource provisioned.

OpsWorks can use Puppet or Chef to configure and running the application.

Stack can include many layer, each *layer can setting the resource(Like MySQL, and cpu, ram… Load Balancer, or Instance)

How OpsWorks works in auto scaling:

CPU High -> CloudWatch -> SNS -> SQS -> Add new instance -> New instance request a configuration from OpsWorks -> New Instance running -> Excute OpsWorks API -> Write error log to S3

AWS OpsWorks for Chef Automate - allow you can use the Chef

OpsWorks of Puppet Enterprise - allow you to setting Puppet Enterprise main service.

What is Chef

Chef is a open source framework write by Ruby, and config format is using the DSL, can transform the infrastructure as code.

The automation tasks type of Chef included:

  • basic infrastructure configuration
  • deploy application
  • cross network configuration

Chef workstation -> Chef server -> Multiple Clients (pull configuration from Chef server)

Chef workstation can comunicate with the Chef node

What is Recipe

A Recipe is a configuration file (write by Ruby and file name is *.rb), included: description how to install resource, setting, management application and software

cookbook

Cookbood are including multiple receipes.

A cookbook are defined a senario configuration:

  • receipe
  • attribute
  • distribution of documentation
  • template
  • define customer lib and resource

Automation configuration management

After finished the cookbook configuration, next can use the Knife CLI tool to iimplement:

  • Chef workstation are using knife CLI to management cookbook and recipe
  • cookbook send to centerialize Chef server
  • chift clients can auto pull configuration updates from Chef service
  • rollback configuration

Enterprise use Chef scenarios

Here are tow months to manage enterprise services

First, a central Chef server provides cookbook to each Chef clients:

Second, each business unit has self workstation resources, can separate the cost center and can prevent single point of failure

AWS getting start with Chef:

Open AWS console, and go to OpsWorks home.

Click the bottom: Go to OpsWorks for Chef Automate, and **Create Chef Automate server ** to set name, region, and type

A Opsworks ecosystem are including multiple Layer component. A Layer is a service that can regist multiple EC2 (like auto scaling group), and the Instance is EC2, App means metadata (include package URL, credentials, ENV variables)

You can reference this guide to enstabilish first OpsWorks App

Getting Started with Chef 11 Linux Stacks

What is the Puppet

Puppet is a powerful infrastructure automation and delivery tool, can automatically manage complex workflows.

Puppet master -> Puppet agents

Puppet master is a configuration center, We can manage the software configuration on Puppet master, and Puppet agents will regular sync up resource from Puppet master.

Workstation -> CodePipeline [CodeCommit - S3 - parameter store -> Code build] -> OpsWorks