Accessing a Private S3 bucket from a Chef Recipe


#1

Hello All,

I’m trying to figure out a way to access a private AWS S3 bucket from a Chef recipe. Does anyone have any ideas on the standard way to do this?

Thank you for your help,

David


CONFIDENTIALITY NOTICE: This electronic mail may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents by persons other than the intended recipient(s) is strictly prohibited. If you have received this communication in error, please notify the sender immediately by reply e-mail so that we may correct our internal records. Please then delete the original message. Thank you.


#2

This exists, and works well for us: https://github.com/adamsb6/s3_file

On Thu, Apr 24, 2014 at 10:42 AM, David A. Williams dwilliams@daxko.comwrote:

Hello All,

I’m trying to figure out a way to access a private AWS S3 bucket from a
Chef recipe. Does anyone have any ideas on the standard way to do this?

Thank you for your help,

David


CONFIDENTIALITY NOTICE: This electronic mail may contain information that
is privileged, confidential, and/or otherwise protected from disclosure to
anyone other than its intended recipient(s). Any dissemination or use of
this electronic mail or its contents by persons other than the intended
recipient(s) is strictly prohibited. If you have received this
communication in error, please notify the sender immediately by reply
e-mail so that we may correct our internal records. Please then delete the
original message. Thank you.


#3

you want to use s3 objects as a resource, or for other purposes? you can
use aws-sdk gem to query s3 directly from your recipe. also there are
several cookbooks like s3file, s3cmd that will allow you to download/upload
objects as a chef resource.

On Thu, Apr 24, 2014 at 7:42 AM, David A. Williams dwilliams@daxko.comwrote:

Hello All,

I’m trying to figure out a way to access a private AWS S3 bucket from a
Chef recipe. Does anyone have any ideas on the standard way to do this?

Thank you for your help,

David


CONFIDENTIALITY NOTICE: This electronic mail may contain information that
is privileged, confidential, and/or otherwise protected from disclosure to
anyone other than its intended recipient(s). Any dissemination or use of
this electronic mail or its contents by persons other than the intended
recipient(s) is strictly prohibited. If you have received this
communication in error, please notify the sender immediately by reply
e-mail so that we may correct our internal records. Please then delete the
original message. Thank you.


#4

On 4/24/14, 7:43 AM, Brian Hatfield wrote:

This exists, and works well for us: https://github.com/adamsb6/s3_file

Also this:

http://community.opscode.com/cookbooks/sk_s3_file

And this aws cookbook has aws_s3_file:

http://community.opscode.com/cookbooks/aws


#5

Hello,

Example of creating AWS S3 bucket in chef recipe:

aws = data_bag_item(‘aws’, ‘main’)chef_gem 'aws-s3’
require ‘aws/s3’

AWS::S3::Base.establish_connection!(:access_key_id =>
aws[‘aws_access_key_id’], :secret_access_key =>
aws[‘aws_secret_access_key’])AWS::S3::Bucket.create(node[‘example’][‘s3-bucket’])AWS::S3::Base.disconnect!

Read aws-s3 gem docs, to do other things with AWS S3.

Cheers.
Konstantin.

On Thu, Apr 24, 2014 at 11:36 PM, Lamont Granquist lamont@opscode.comwrote:

On 4/24/14, 7:43 AM, Brian Hatfield wrote:

This exists, and works well for us: https://github.com/adamsb6/s3_file

Also this:

http://community.opscode.com/cookbooks/sk_s3_file

And this aws cookbook has aws_s3_file:

http://community.opscode.com/cookbooks/aws


Konstantin Lysenko
Infrastructure Developer
Atalanta Systems Ltd

Atalanta Systems: The Agile Infrastructure Enablers
http://atalanta-systems.com