{"id":2171,"date":"2019-08-22T09:41:43","date_gmt":"2019-08-22T09:41:43","guid":{"rendered":"https:\/\/www.testpreptraining.com\/tutorial\/?page_id=2171"},"modified":"2020-05-02T07:37:28","modified_gmt":"2020-05-02T07:37:28","slug":"opsworks-databags-berkshelf","status":"publish","type":"page","link":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-databags-berkshelf\/","title":{"rendered":"OpsWorks Databags &#038; berkshelf"},"content":{"rendered":"\n<p><strong>OpsWorks Stacks Data Bag Reference<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>OpsWorks Stacks exposes settings to recipes as\nChef data bag content. <\/li><li>A data bag is a Chef concept. <\/li><li>It is a global variable stored as JSON data on\nan instance<\/li><li>the JSON data is accessible from Chef. <\/li><li>Like data bag stores global variables as <ul><li>app&#8217;s\nsource URL<\/li><\/ul><ul><li>instance&#8217;s\nhostname<\/li><\/ul><ul><li>associated\nstack&#8217;s VPC identifier. <\/li><\/ul><\/li><li>OpsWorks Stacks stores its data bags on each\nstack&#8217;s instances. <\/li><li>On Linux instances, data bags is at \/var\/chef\/runs\/run-ID\/data_bags\ndirectory. <\/li><li>On Windows instances, data bags is at drive:\\chef\\runs\\run-id\\data_bags\ndirectory. <\/li><li>These directories include a set of data bags\n(subdirectories). <\/li><li>Each data bag contains zero or more data bag\nitems, and are JSON-formatted files that having sets of data bag content. <\/li><\/ul>\n\n\n\n<p>Data bag content includes <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>String content <ul><li>It\nfollows Ruby syntax <\/li><\/ul><ul><li>can\nuse single or double quotes<\/li><\/ul><ul><li>strings\nwith special characters must have double quotes. <\/li><\/ul><\/li><li>Boolean content<ul><li>It\nis either true or false (no quotes). <\/li><\/ul><\/li><li>Number content<ul><li>It\nis either integer or decimal numbers, such as 4 or 2.5 (no quotes). <\/li><\/ul><\/li><li>List content<ul><li>Has\nthe form of comma-separated values enclosed in square brackets (no quotes),\nsuch as [ &#8217;80&#8217;, &#8216;443&#8217; ]<\/li><\/ul><\/li><li>JSON objects<ul><li>which\ncontain additional data bag content, such as &#8220;my-app&#8221;: {&#8220;elastic_ip&#8221;:\nnull,&#8230;}. <\/li><\/ul><\/li><\/ul>\n\n\n\n<p>Chef recipes can access through Chef search or directly, following<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>data bags<\/li><li>data bag items<\/li><li>data bag content<\/li><\/ul>\n\n\n\n<p>Search indexes to use to access a data bag through Chef search by OpsWorks\nStacks<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>aws_opsworks_app, which represents a set of deployed apps for a stack. <\/li><li>aws_opsworks_command, which represents a set of commands that were run on a stack. <\/li><li>aws_opsworks_ecs_cluster, which represents a set of Amazon Elastic Container Service (Amazon ECS) cluster instances for a stack. <\/li><li>aws_opsworks_elastic_load_balancer, which represents a set of Elastic Load Balancing load balancers for a stack. <\/li><li>aws_opsworks_instance, which represents a set of instances for a stack. <\/li><li>aws_opsworks_layer, which represents a set of layers for a stack. <\/li><li>aws_opsworks_rds_db_instance, which represents a set of Amazon Relational Database Service (Amazon RDS) instances for a stack. <\/li><li>aws_opsworks_stack, which represents a stack. <\/li><li>aws_opsworks_user, which represents a set of users for a stack. <\/li><\/ul>\n\n\n\n<p><strong>Berkshelf<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Berkshelf is a dependency manager for Chef\ncookbooks. <\/li><li>Easily depend on community cookbooks <\/li><li>safely include community cookbooks in workflow. <\/li><li>It is included in ChefDK.<\/li><li>Running chef generate cookbook, by default,\ncreate a Berksfile in the root of the cookbook, alongside the cookbook\u2019s metadata.rb.\n<\/li><\/ul>\n\n\n\n<p>Add cookbook\u2019s dependencies to metadata, as<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">name 'my_first_cookbook'<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">version '0.1.0'<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">depends 'apt', '~&gt; 5.0'<\/pre>\n\n\n\n<p>The default Berksfile\nwill contain the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">source 'https:\/\/supermarket.chef.io'metadata<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>OpsWorks Stacks Data Bag Reference OpsWorks Stacks exposes settings to recipes as Chef data bag content. A data bag is a Chef concept. It is a global variable stored as JSON data on an instance the JSON data is accessible from Chef. Like data bag stores global variables as app&#8217;s source URL instance&#8217;s hostname associated&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2084,"menu_order":22,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[7,397,372,380,392],"class_list":["post-2171","page","type-page","status-publish","hentry","category-amazon-aws","tag-aws","tag-berkshelf","tag-devops","tag-devops-engineer","tag-opsworks"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>OpsWorks Databags &amp; berkshelf - 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-databags-berkshelf\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"OpsWorks Databags &amp; berkshelf - Testprep Training Tutorials\" \/>\n<meta property=\"og:description\" content=\"OpsWorks Stacks Data Bag Reference OpsWorks Stacks exposes settings to recipes as Chef data bag content. A data bag is a Chef concept. It is a global variable stored as JSON data on an instance the JSON data is accessible from Chef. Like data bag stores global variables as app&#8217;s source URL instance&#8217;s hostname associated...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-databags-berkshelf\/\" \/>\n<meta property=\"og:site_name\" content=\"Testprep Training Tutorials\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-02T07:37:28+00:00\" \/>\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=\"2 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-databags-berkshelf\/\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-databags-berkshelf\/\",\"name\":\"OpsWorks Databags & berkshelf - Testprep Training Tutorials\",\"isPartOf\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\"},\"datePublished\":\"2019-08-22T09:41:43+00:00\",\"dateModified\":\"2020-05-02T07:37:28+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-databags-berkshelf\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-databags-berkshelf\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-databags-berkshelf\/#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 Databags &#038; berkshelf\"}]},{\"@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 Databags & berkshelf - 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-databags-berkshelf\/","og_locale":"en_US","og_type":"article","og_title":"OpsWorks Databags & berkshelf - Testprep Training Tutorials","og_description":"OpsWorks Stacks Data Bag Reference OpsWorks Stacks exposes settings to recipes as Chef data bag content. A data bag is a Chef concept. It is a global variable stored as JSON data on an instance the JSON data is accessible from Chef. Like data bag stores global variables as app&#8217;s source URL instance&#8217;s hostname associated...","og_url":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-databags-berkshelf\/","og_site_name":"Testprep Training Tutorials","article_modified_time":"2020-05-02T07:37:28+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-databags-berkshelf\/","url":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-databags-berkshelf\/","name":"OpsWorks Databags & berkshelf - Testprep Training Tutorials","isPartOf":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website"},"datePublished":"2019-08-22T09:41:43+00:00","dateModified":"2020-05-02T07:37:28+00:00","breadcrumb":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-databags-berkshelf\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-databags-berkshelf\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/aws-devops-engineer\/opsworks-databags-berkshelf\/#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 Databags &#038; berkshelf"}]},{"@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\/2171","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=2171"}],"version-history":[{"count":4,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/2171\/revisions"}],"predecessor-version":[{"id":2427,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/2171\/revisions\/2427"}],"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=2171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/categories?post=2171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/tags?post=2171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}