forked from adamsb6/s3_file
AWS 中国地区已经可以使用了,但是只支持AWS4的签名算法,默认的global地址不支持中国区域,所以增加了一个新的region属性,根据region属性获得对应的endpoint.然后使用官方提供的签名算法生成Authorization.
PS:目前只有中国和欧洲法兰克福是必须使用AWS4签名算法的,该cookbook支持所有S3 region. 由于我自己不使用token这个功能,所以移除了! —不知道咋用
Attribute Parameters:
-
‘aws_access_key_id` - your AWS access key id. (optional)
-
‘aws_secret_access_key` - your AWS secret access key. (optional)
-
‘bucket` - the bucket to pull from.
-
‘region` - S3 region. ex us-west-1, cn-north-1
-
‘remote_path` - the S3 key to pull.
-
‘owner` - the owner of the file. (optional)
-
‘group` - the group owner of the file. (optional)
-
‘mode` - the octal mode of the file. (optional)
-
‘decryption_key` - the 32 character SHA256 key used to encrypt your S3 file. (optional)
Example:
s3_file "/tmp/somefile" do remote_path "/my/s3/key" bucket "my-s3-bucket" aws_access_key_id "mykeyid" aws_secret_access_key "mykey" region "cn-north-1" owner "me" group "mygroup" mode "0644" action :create decryption_key "my SHA256 digest key" decrypted_file_checksum "SHA256 hex digest of decrypted file" end