github.com/adrian-bl/terraform@v0.7.0-rc2.0.20160705220747-de0a34fc3517/website/source/docs/providers/chef/r/data_bag_item.html.markdown (about) 1 --- 2 layout: "chef" 3 page_title: "Chef: chef_data_bag_item" 4 sidebar_current: "docs-chef-resource-data-bag-item" 5 description: |- 6 Creates and manages an object within a data bag in Chef Server. 7 --- 8 9 # chef\_data\_bag\_item 10 11 A [data bag](http://docs.chef.io/data_bags.html) is a collection of 12 configuration objects that are stored as JSON in Chef Server and can be 13 retrieved and used in Chef recipes. 14 15 This resource creates objects within an existing data bag. To create the 16 data bag itself, use the ``chef_data_bag`` resource. 17 18 ## Example Usage 19 20 ``` 21 resource "chef_data_bag_item" "example" { 22 data_bag_name = "example-data-bag" 23 content_json = <<EOT 24 { 25 "id": "example-item", 26 "any_arbitrary_data": true 27 } 28 EOT 29 } 30 ``` 31 32 ## Argument Reference 33 34 The following arguments are supported: 35 36 * `data_bag_name` - (Required) The name of the data bag into which this item 37 will be placed. 38 * `content_json` - (Required) A string containing a JSON object that will be 39 the content of the item. Must at minimum contain a property called "id" 40 that is unique within the data bag, which will become the identifier of 41 the created item. 42 43 ## Attributes Reference 44 45 The following attributes are exported: 46 47 * `id` - The value of the "id" property in the ``content_json`` JSON object, 48 which can be used by clients to retrieve this item's content.