cookbook 'remote_file_s3', '= 1.0.5'
remote_file_s3 (7) Versions 1.0.5 Follow0
Provides remote_file_s3 resource
cookbook 'remote_file_s3', '= 1.0.5', :supermarket
knife supermarket install remote_file_s3
knife supermarket download remote_file_s3
remote_file_s3
This resource simply downloads a file from S3 given a bucket and path. Despite its name, it does not use the remote_file
resource behind the scenes for idempotence or to transfer the file and instead implements an internal catalog to track files' sha256 sums and etags at time of download for idempotence and the aws-sdk-s3
gem for file transfer.
Why do we need yet another s3 file resource?
Well, IMO, they're all poorly implemented either by way of being too complex (trying to implement everything themselves), by using cli tool shellouts, or by incorrectly making assumptions about Amazon's etags. This resource places no importance on the way Amazon generates their etags (which is inconsistent depending on file attributes) and simply uses it as HTTP intends you to, as an indicator that a file has changed by a simple equality check.
Platforms
- Ubuntu
- Centos
- RHEL
- Debian
- Red Hat
- macOS
- Windows
Usage
Just depends
on this cookbook to be able to use this resource in your cookbook/recipes.
remote_file_s3
Example
remote_file_s3 '/tmp/foo.txt' do bucket 'mybucket' remote_path 'myfolder/foo.txt' aws_access_key_id 'myaccesskey' aws_secret_access_key 'mysecretkey' action :create end
Properties
-
bucket
- The name of the S3 bucket in which the file resides. -
remote_path
- Path to the file inside the bucket. -
aws_acccess_key_id
- Explicitly use this access key, overriding any instance profile. -
aws_secret_access_key
- Explicitly use this access key, overriding any instance profile. -
aws_session_token
- Token required when using an access key for a role. -
owner
- Username or UID that the file will be owned by. -
group
- Group name or GID that the file will be owned by. -
mode
- Access mode for the file. -
rights
anddeny_rights
- Passed through tofile
resource to apply Windows permissions. -
inherits
- Passed through tofile
resource to specify Windows permissions inheritance. -
region
- AWS region to use for the endpoint. Defaults to EC2 instance region orus-west-2
if not an EC2 instance.
Recipes
The aws-sdk-s3
gem is installed via the deps
recipe but you do not need to run this explicitly. It will automatically be loaded when the remote_file_s3
resource is used if aws-sdk-s3
does not exist.
License and Authors
Authors: Matt Kulka matt@lqx.net
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
remote_file_s3 CHANGELOG
This file is used to list changes made in each version of the remote_file_s3 cookbook.
1.0.5
- [mattlqx] - Don't throw an exception if group or user doesn't exist at compilation.
1.0.4
- [mattlqx] - Rearrange some statements to better accomodate Windows.
1.0.3
- [mattlqx] - Use node for current user.
1.0.2
- [mattlqx] - Fix issue with nil for owner, group or mode.
1.0.1
- [mattlqx] - Fix lint and move default for aws region ahead in code.
1.0.0
- [mattlqx] - Initial release! 🕺
Check the Markdown Syntax Guide for help with Markdown.
The Github Flavored Markdown page describes the differences between markdown on github and standard markdown.
Collaborator Number Metric
1.0.5 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
1.0.5 passed this metric
Foodcritic Metric
1.0.5 passed this metric
No Binaries Metric
1.0.5 passed this metric
Testing File Metric
1.0.5 passed this metric
Version Tag Metric
1.0.5 passed this metric
1.0.5 failed this metric
1.0.5 passed this metric
Foodcritic Metric
1.0.5 passed this metric
No Binaries Metric
1.0.5 passed this metric
Testing File Metric
1.0.5 passed this metric
Version Tag Metric
1.0.5 passed this metric
1.0.5 passed this metric
1.0.5 passed this metric
Testing File Metric
1.0.5 passed this metric
Version Tag Metric
1.0.5 passed this metric
1.0.5 passed this metric
1.0.5 passed this metric