github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/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 ```hcl 21 resource "chef_data_bag_item" "example" { 22 data_bag_name = "example-data-bag" 23 24 content_json = <<EOT 25 { 26 "id": "example-item", 27 "any_arbitrary_data": true 28 } 29 EOT 30 } 31 ``` 32 33 ## Argument Reference 34 35 The following arguments are supported: 36 37 * `data_bag_name` - (Required) The name of the data bag into which this item 38 will be placed. 39 * `content_json` - (Required) A string containing a JSON object that will be 40 the content of the item. Must at minimum contain a property called "id" 41 that is unique within the data bag, which will become the identifier of 42 the created item. 43 44 ## Attributes Reference 45 46 The following attributes are exported: 47 48 * `id` - The value of the "id" property in the ``content_json`` JSON object, 49 which can be used by clients to retrieve this item's content.