How To Create A Sample App With Amazon OpsWork (Linux)

aws-opswork-logo

Step1: Login to your Amazon AWS account.

Step2: Click on the OpsWork option under the Management Tools.

OpsWork

Step3: Click on the button in blue Add your first stack.

Add_your_first_stack_OpsWork

Step4: Select the type of stack which you want to create, Configure the settings and click on Add stack.

Add_Stack_OpsWork
Note-: In this tutorial we have select the Chef 12 Stack among the types of stack.

Settings To Be Configured Below :
Stack Name                             : Enter the any name which you want to set for your stack.
Region                                    : Choose West Oregon
VPC                                        : If VPC is available then select the same, else select the default VPC     
Default subnet                        : Default (us-west-2a)
Default OS                              : Select Linux & choose the OS from the list of available options
Default SSH Key                      : Select the key to manage your instance
Use Custom Chef cookbooks    : Yes
Repository type                      : Http Archive
Repository URL                      : https://s3.amazonaws.com/opsworks-demo-assets/opsworks-linux- demo-cookbooks-nodejs.tar.gz
User name                            : Leave blank
Password                             : Leave blank
Stack Color                          : Blue

Create_Your_Stack_OpsWork

Advance options settings

Leave the settings default as of now for the below.
Default root device type
IAM role
Default IAM instance profile
Hostname theme
OpsWorks Agent version

Create_Your_Stack_Advance_Option_OpsWork

Step5: Next step is to add layer to your stack, click on Add a layer.

Add_Layer_OpsWork

Step6: Specify the name and a short name to your layer, click on Add layer

Name_Layer_OpsWork

Step7: Under the DemoLayer , click on security from the list of options.

Demo_Layer_Security_Option

Step8: Under the Security groups select AWS-OpsWork-WebApp, click on save .

AWS-OpsWork-WebApp_OpsWorks

Step9: On the left most part of the page click on Apps option, click on Add an app or Add app.

Apps_OpsWork

Step10: Configure the settings for an App, click on Add app.

Settings To Be Configured Below & leave rest of the settings default or blank.
Name                      : Specify the name to your app.
Repository type   : Git
Repository URL   : https://github.com/awslabs/opsworks-windows-demo-nodejs.git

Addapp_settings_OpsWork

Addapp_settings_2_OpsWork

Step11: Select Instance option from the left most part of the web page, click on Add an instance.

Add_Instance_OpsWorks

Step12: Configure your instance with options specified below, click on Add instance.

Instance_Sets_OpsWorks

Step13: Start your instance & wait till status change from stopped to online.

Instance_Status_Stopped(1)
Instance_Status_Online(2)

Note-: It take few minute to change the status from stopped to online.

Step14: Use chef Recipes to deploy the app on instance,Click on layers & select Recipes option from the list of options.

Custom_Chef_Recipes_OpsWork

Step15: Specify the Recipe to deploy an application, Under Deploy type nodejs_demo::default & press Enter, click on save.

Deploy_Recipe_OpsWork

Step16: Click on Apps on the left most part of the web page , click on deploy under the Actions.

Action_Deploy_App_OpsWorks

Step17: Configure Deploy App Settings, click on Deploy .

Deploy_App_Settings_OpsWork

Successfully Deployment Of App

Successful_Deployment

Step18: Test the sample App, by copying the public Ip from the instance & paste on the browser.

Sample_app_deployed_OpsWork