1

I'm trying to create an encrypted databag.

I'm using something like this as source

{
  "id": "rds-2",
  "web": "adeasdeasde"
}

and I want the encrypted file to go on to data_bag/aws/rds-2.json, so I'm running:

knife data bag from file aws rds-2.json --encrypt 
Updated data_bag_item[aws::rds-2]

But I can't see the encrypted file anywhere in the data_bag dir, ideas?

Update: I can see the encrypted databag on Chef Manage (Server) but not in the Workstation, where it was generated.

Pedro
  • 281
  • 2
  • 8

1 Answers1

1

You can use knife -z (i.e. local-mode) to write back the encrypted databag to the filesystem instead of a real Chef server.

See also https://stackoverflow.com/questions/34234668

Fabrice Devaux
  • 216
  • 2
  • 2
  • That seems to do it. Thanks! I created a new data bag item with: knife data bag from file aws rds-3.json -z --encrypt -s .chef/secret_key – Pedro Dec 21 '15 at 12:40