{"id":2156,"date":"2019-08-22T09:36:09","date_gmt":"2019-08-22T09:36:09","guid":{"rendered":"https:\/\/www.testpreptraining.com\/tutorial\/?page_id=2156"},"modified":"2020-05-02T07:36:49","modified_gmt":"2020-05-02T07:36:49","slug":"opsworks-stacks-layers","status":"publish","type":"page","link":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-stacks-layers\/","title":{"rendered":"OpsWorks Stacks &#038; Layers"},"content":{"rendered":"\n<ul class=\"wp-block-list\"><li>It&nbsp; provides a simple and flexible way to create and manage stacks and applications. <\/li><li>Deploy and monitor applications in your stacks. <\/li><li>It does not require or create Chef servers; <\/li><li>Performs some of the work of a Chef server for you. <\/li><li>Monitors instance health, and provisions new instances for you, when necessary, by using Auto Healing and Auto Scaling. <\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"222\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2019\/08\/image-143.png\" alt=\"\" class=\"wp-image-2157\"\/><\/figure>\n\n\n\n<p><strong>OpsWorks Stacks<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>stack represents set of instances to manage\ncollectively<\/li><li>Serves as a container<\/li><li>stack have common purpose like serving\napplications. <\/li><li>stack handles tasks applying to group of\ninstances as a whole<\/li><li>An example of stack serving web applications has\n<ul><li>A\nset of application server instances for incoming traffic<\/li><\/ul><ul><li>A\nload balancer instance<\/li><\/ul><ul><li>A\ndatabase instance<\/li><\/ul><\/li><li>Best practice to have multiple stacks that\nrepresent different environments. <\/li><li>Usually a set of stacks includes<ul><li>A\ndevelopment stack to add features and fix bugs for developers <\/li><\/ul><ul><li>A\nstaging stack to verify updates before making it production <\/li><\/ul><ul><li>A\nproduction stack<\/li><\/ul><\/li><\/ul>\n\n\n\n<p><strong>Creating a Stack<\/strong><\/p>\n\n\n\n<p>To create a new stack<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Go to the AWS OpsWorks Stacks dashboard<\/li><li>click Add stack.<\/li><\/ul>\n\n\n\n<p><strong>The Add Stack page options <\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Stack name &#8211; (Required) identify the stack.\nUnique not required. stack ID a GUID, identifies the stack and can be used in\ncommands. <\/li><li>Region &#8211; (Required) region where instances will\nbe launched.<\/li><li>VPC &#8211; (Optional) The VPC ID, where stack is to\nbe launched. Also supports EC2 Classic, with No VPC. VPC needed if not supporting\nEC2 Classic.<\/li><li>Default Availability Zone\/Default subnet &#8211; (Optional)\nIt depends, if creating stack in a VPC:<\/li><li>If supporting EC2 Classic can set VPC to No VPC.<\/li><li>If no EC2 Classic or want a VPC, this field is\nlabeled Default subnet.<\/li><li>Default operating system &#8211; (Optional) Any one\nfrom built-in Linux operating systems, Microsoft Windows Server 2012 R2 or a custom\nAMI based on one of the supported operating systems.<\/li><li>Default SSH key &#8211; (Optional) Amazon EC2 key pair\nfrom the stack&#8217;s region. The default value is none. <\/li><li>Chef version &#8211; Chef version being selected <\/li><li>Use custom Chef cookbooks \u2013 Enable installing\ncustom Chef cookbooks on the stack&#8217;s instances.<\/li><li>For Chef 12, the default setting is Yes. For\nChef 11, The default setting is No. <\/li><li>Stack color &#8211; (Optional) The hue used to represent\nthe stack on the AWS OpsWorks Stacks console. <\/li><li>Stack tags &#8211; Apply tags at the stack and layer\nlevel and all resource within gets tagged. <\/li><li>Default root device type &#8211; Determines the type\nof storage to be used for the instance&#8217;s root volume. <\/li><li>IAM role &#8211; (Optional) The stack&#8217;s AWS IAM role,\nto interact with AWS <\/li><li>Default IAM instance profile &#8211; (Optional) The\ndefault IAM role to be associated with the stack&#8217;s Amazon EC2 instances. <\/li><li>Hostname theme &#8211; (Optional) string to generate a\ndefault hostname for each instance. <\/li><li>Custom JSON &#8211; (Optional) One or more custom\nattributes, formatted as a JSON structure. <\/li><li>You cannot modify the region or VPC ID.<\/li><\/ul>\n\n\n\n<p>Running a stack in a VPC\ninvolves following steps<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Create an appropriately configured VPC, by using the Amazon VPC console or API, or an AWS CloudFormation template.<\/li><li>Specify the VPC ID when you create the stack.<\/li><li>Launch the stack&#8217;s instances in the appropriate subnet.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"218\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2019\/08\/image-144.png\" alt=\"\" class=\"wp-image-2158\"\/><\/figure>\n\n\n\n<p><strong>OpsWorks Layers<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Every stack contains at least one layers or more <\/li><li>Every layer refers to a stack component like load balancer or a set of servers.<\/li><li>Every layer should have a minimum of one instance or more.<\/li><li>Every instance must be a member of a minimum one layer, except for registered instances.<\/li><li>Instances may be a member of multiple layers.<\/li><li>With multiple layers in an instance <ul><li>Reduce expenses by hosting the multiple server like database and load balancer, on same instance.<\/li><\/ul><ul><li>For administration, add another admin server instances to that layer.<\/li><\/ul><\/li><li>To add the first OpsWorks layer<ul><li>Click Add Layer.<\/li><\/ul><ul><li>On the Add Layer page, select the appropriate layer, showing the layer&#8217;s configuration options.<\/li><\/ul><ul><li>Configure the layer and click Add Layer to add it to stack.<\/li><\/ul><\/li><li>To edit an OpsWorks layer<ul><li>In navigation pane, click Layers.<\/li><\/ul><ul><li>On the Layers page, select a layer name and open its details page<\/li><\/ul><ul><li>Click Edit and then select the appropriate tab: General Settings, Recipes, Network, EBS Volumes, or Security.<\/li><\/ul><\/li><li>OpsWorks Layer&#8217;s Configuration Main Settings<ul><li>Auto healing enabled &#8211; If auto healing is enabled for the layer&#8217;s instances. The default setting is Yes.<\/li><\/ul><ul><li>Custom JSON &#8211; Data in JSON format that is passed to your Chef recipes for all instances in this layer. You can use this, for example, to pass data to your own recipes. <\/li><\/ul><\/li><li>Instance shutdown timeout &#8211; Specifies how long (in seconds) OpsWorks Stacks waits after triggering a Shutdown lifecycle event before stopping or terminating the EC2 instance. The default setting is 120 seconds. <\/li><\/ul>\n\n\n\n<p><strong>Auto Healing <\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>All instances have OpsWorks Stacks agent to\ncommunicate regularly with AWS service. <\/li><li>Stacks uses the communication for instance\nhealth monitoring. <\/li><li>If no communication for &gt; 5 minutes, instance\nis considered as failed.<\/li><li>With auto healing Stacks replaces the layer&#8217;s\nfailed instances automatically<ul><li>If\nvolume attached to instance and instance failed, the volume and its data are\nsaved and attached to new instance.<\/li><\/ul><ul><li>If\nvolume not attached Stacks creates a new, empty volume with configuration\nspecified by the layer, and attaches that volume to the new instance.<\/li><\/ul><\/li><li>By default auto healing is enabled in AWS\nOpsWorks <\/li><li>Auto healing is set at layer level<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"557\" height=\"324\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2019\/08\/image-145.png\" alt=\"\" class=\"wp-image-2159\"\/><\/figure>\n\n\n\n<p><strong>Elastic Load Balancing Layer<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Using ELB <ul><li>Use the ELB console or API to create a load balancer <\/li><\/ul><ul><li>then attach it to a presentation layer. <\/li><\/ul><\/li><li>ELB function is to <ul><li>Distributing traffic to layer&#8217;s instances<\/li><\/ul><ul><li>Detect unhealthy EC2 instances <\/li><\/ul><ul><li>Reroutes traffic to healthy instances <\/li><\/ul><ul><li>Scales request handling capacity as per incoming traffic.<\/li><\/ul><\/li><li>Must create separate ELB load balancer for each layer in each stack needing balancing<\/li><li>Assign a distinctive name to each ELB load balancer to use<\/li><\/ul>\n\n\n\n<p><strong>RDS Service Layer<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>It represents an RDS instance. <\/li><li>Can represent only existing RDS instances<\/li><li>Create RDS instances by RDS console or API.<\/li><\/ul>\n\n\n\n<p><strong>ECS Cluster Layers<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>ECS manages Docker containers on EC2 instances<\/li><li>An ECS Cluster layer provides<ul><li>represents an Amazon ECS cluster<\/li><\/ul><ul><li>Streamlined container instance provisioning and management<\/li><\/ul><ul><li>Container instance operating system and package updates<\/li><\/ul><ul><li>User permissions management<\/li><\/ul><ul><li>Container instance performance monitoring<\/li><\/ul><ul><li>EBS volume management<\/li><\/ul><ul><li>Public and Elastic IP address management<\/li><li>Security group management <\/li><\/ul><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>It&nbsp; provides a simple and flexible way to create and manage stacks and applications. Deploy and monitor applications in your stacks. It does not require or create Chef servers; Performs some of the work of a Chef server for you. Monitors instance health, and provisions new instances for you, when necessary, by using Auto Healing&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2084,"menu_order":18,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[7,383,372,380,393],"class_list":["post-2156","page","type-page","status-publish","hentry","category-amazon-aws","tag-aws","tag-containers","tag-devops","tag-devops-engineer","tag-opsworks-stacks"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>OpsWorks Stacks &amp; Layers - Testprep Training Tutorials<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-stacks-layers\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"OpsWorks Stacks &amp; Layers - Testprep Training Tutorials\" \/>\n<meta property=\"og:description\" content=\"It&nbsp; provides a simple and flexible way to create and manage stacks and applications. Deploy and monitor applications in your stacks. It does not require or create Chef servers; Performs some of the work of a Chef server for you. Monitors instance health, and provisions new instances for you, when necessary, by using Auto Healing...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-stacks-layers\/\" \/>\n<meta property=\"og:site_name\" content=\"Testprep Training Tutorials\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-02T07:36:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2019\/08\/image-143.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-stacks-layers\/\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-stacks-layers\/\",\"name\":\"OpsWorks Stacks & Layers - Testprep Training Tutorials\",\"isPartOf\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\"},\"datePublished\":\"2019-08-22T09:36:09+00:00\",\"dateModified\":\"2020-05-02T07:36:49+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-stacks-layers\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-stacks-layers\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-stacks-layers\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AWS Certified DevOps Engineer Professional\",\"item\":\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"OpsWorks Stacks &#038; Layers\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"name\":\"Testprep Training Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\",\"name\":\"Testprep Training\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"contentUrl\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"width\":583,\"height\":153,\"caption\":\"Testprep Training\"},\"image\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"OpsWorks Stacks & Layers - Testprep Training Tutorials","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-stacks-layers\/","og_locale":"en_US","og_type":"article","og_title":"OpsWorks Stacks & Layers - Testprep Training Tutorials","og_description":"It&nbsp; provides a simple and flexible way to create and manage stacks and applications. Deploy and monitor applications in your stacks. It does not require or create Chef servers; Performs some of the work of a Chef server for you. Monitors instance health, and provisions new instances for you, when necessary, by using Auto Healing...","og_url":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-stacks-layers\/","og_site_name":"Testprep Training Tutorials","article_modified_time":"2020-05-02T07:36:49+00:00","og_image":[{"url":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2019\/08\/image-143.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-stacks-layers\/","url":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-stacks-layers\/","name":"OpsWorks Stacks & Layers - Testprep Training Tutorials","isPartOf":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website"},"datePublished":"2019-08-22T09:36:09+00:00","dateModified":"2020-05-02T07:36:49+00:00","breadcrumb":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-stacks-layers\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-stacks-layers\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-stacks-layers\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.testpreptraining.ai\/tutorial\/"},{"@type":"ListItem","position":2,"name":"AWS Certified DevOps Engineer Professional","item":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/"},{"@type":"ListItem","position":3,"name":"OpsWorks Stacks &#038; Layers"}]},{"@type":"WebSite","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","name":"Testprep Training Tutorials","description":"","publisher":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization","name":"Testprep Training","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","contentUrl":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","width":583,"height":153,"caption":"Testprep Training"},"image":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/2156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/comments?post=2156"}],"version-history":[{"count":3,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/2156\/revisions"}],"predecessor-version":[{"id":2420,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/2156\/revisions\/2420"}],"up":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/2084"}],"wp:attachment":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/media?parent=2156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/categories?post=2156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/tags?post=2156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}