fog-aws 3.10.0 → 3.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c26ecb900344f1066e888bd42bea0bb74295915f367cea6fc9ee76987fccf3bd
4
- data.tar.gz: 0267b3e9130ea0496810e4432da4d695a37ea959892d30020defc58b93a872d3
3
+ metadata.gz: db78eac28d74ef1522933e294d0528ecf4f99d072594629f6befeb75927f63e6
4
+ data.tar.gz: 9496a31776f748834e82525bebf26a157208d7fec58f273d21508bc1c6d25062
5
5
  SHA512:
6
- metadata.gz: b94b3169aac81043a5847d4f644d03274ddfc1454ac6704f0c3c534e9031d693ce0cde7f50fd0ae396c4225d9145eacc27ed9be774bb2a80854e2f9d19b66baa
7
- data.tar.gz: b756f7198948b5f5971a6e78f4474525d2827d58f8a393d8e36fbc961806104f4e4d83e288a3d5845c9b94b595c047341e7a4d7f0258e45cdf21dcc4c6dbd71e
6
+ metadata.gz: 0a6c79d3d5598348a49a3c1bff6b4e89804900d851a9a6e1cd328f98e2877b6ff6a66fe1703e5276f46f434d39adc3ad8d00dcef6905308168f34993278c52a5
7
+ data.tar.gz: d7a32f8b0df5f0f439662d8917e1eaf7ef5cc74433f48653162d74a6ae725d3fdf9a2bfe64e81f59abf8d3470c1cb44631476cd514d145249b99ca95d09615ad
data/CHANGELOG.md CHANGED
@@ -1,5 +1,123 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased](https://github.com/fog/fog-aws/tree/HEAD)
4
+
5
+ [Full Changelog](https://github.com/fog/fog-aws/compare/v3.10.0...HEAD)
6
+
7
+ **Closed issues:**
8
+
9
+ - Support for Regional STS Endpoints [\#604](https://github.com/fog/fog-aws/issues/604)
10
+ - Pass tags when creating EBS ? [\#603](https://github.com/fog/fog-aws/issues/603)
11
+ - S3 multiple delete api should handle delete for multiple versions for a single object [\#598](https://github.com/fog/fog-aws/issues/598)
12
+ - Fog does not return error from s3 [\#586](https://github.com/fog/fog-aws/issues/586)
13
+ - Add support for r6g and c6g instance types [\#580](https://github.com/fog/fog-aws/issues/580)
14
+ - Using internal S3 provider ... and something funky is going on! [\#575](https://github.com/fog/fog-aws/issues/575)
15
+ - How to upload File to S3 with with accelerate? [\#554](https://github.com/fog/fog-aws/issues/554)
16
+ - How to use assume\_role\_with\_web\_identity auth for S3 storage? [\#543](https://github.com/fog/fog-aws/issues/543)
17
+ - Fog::AWS::Glacier::TreeHash::add\_part works only sometimes [\#520](https://github.com/fog/fog-aws/issues/520)
18
+ - fog-aws: Fog::AWS::Glacier::Job doesn't support RetrievalByteRange [\#519](https://github.com/fog/fog-aws/issues/519)
19
+ - Path style is being deprecated [\#516](https://github.com/fog/fog-aws/issues/516)
20
+ - Fog::DNS::AWS can't read zones [\#513](https://github.com/fog/fog-aws/issues/513)
21
+ - Lambda Parser can't handle VPC config, containing array of hash values [\#509](https://github.com/fog/fog-aws/issues/509)
22
+ - Excon::Error::Forbidden: Expected\(200\) \<=\> Actual\(403 Forbidden\) [\#508](https://github.com/fog/fog-aws/issues/508)
23
+ - file.save does not work with STDIN [\#500](https://github.com/fog/fog-aws/issues/500)
24
+ - ELBv2 Support ? [\#489](https://github.com/fog/fog-aws/issues/489)
25
+ - S3 Select Support? [\#484](https://github.com/fog/fog-aws/issues/484)
26
+ - nil:NilClass error [\#483](https://github.com/fog/fog-aws/issues/483)
27
+ - Mocks for VM creation require access and secret key when using instance profiles [\#482](https://github.com/fog/fog-aws/issues/482)
28
+ - Always use bucket virtual hostname? [\#464](https://github.com/fog/fog-aws/issues/464)
29
+ - Spot instance creation : Support for BlockDurationMinutes [\#461](https://github.com/fog/fog-aws/issues/461)
30
+ - How can I remove the `Content-Encoding` metadata properties if I upload from fog [\#447](https://github.com/fog/fog-aws/issues/447)
31
+ - AWS::ECS with `use_iam_profile` errors out [\#441](https://github.com/fog/fog-aws/issues/441)
32
+ - Option to turn off Warnings [\#426](https://github.com/fog/fog-aws/issues/426)
33
+ - Accessing AWS S3 using EC2 Instance Profile [\#423](https://github.com/fog/fog-aws/issues/423)
34
+ - Support step and target tracking auto scaling policies [\#422](https://github.com/fog/fog-aws/issues/422)
35
+ - could not create ec2 volume with custom encryption key, volume only create with default 'aws/ebs' encryption key [\#420](https://github.com/fog/fog-aws/issues/420)
36
+ - Download File with content\_disposition [\#418](https://github.com/fog/fog-aws/issues/418)
37
+ - Fog::Compute::AWS::Error iamInstanceProfile.name is invalid [\#410](https://github.com/fog/fog-aws/issues/410)
38
+ - Mocks for EC2 instance creation do not behave as expected [\#404](https://github.com/fog/fog-aws/issues/404)
39
+ - Cannot copy an encrypted snapshot from one account to another account [\#398](https://github.com/fog/fog-aws/issues/398)
40
+ - Fog::Compute::AWS::Image\#deregister ignores non-root snapshots. [\#380](https://github.com/fog/fog-aws/issues/380)
41
+ - AWS S3 overwrites files with same name [\#378](https://github.com/fog/fog-aws/issues/378)
42
+ - Support S3 object tagging [\#377](https://github.com/fog/fog-aws/issues/377)
43
+ - Reqeust to support Aws::DynamoDBStreams [\#373](https://github.com/fog/fog-aws/issues/373)
44
+ - Not all Rds versions and Instance Types are rendered [\#371](https://github.com/fog/fog-aws/issues/371)
45
+ - Tag instances upon creation of new instance [\#359](https://github.com/fog/fog-aws/issues/359)
46
+ - Creating instances in AWS fails with Socket Error [\#352](https://github.com/fog/fog-aws/issues/352)
47
+ - `NameError: uninitialized constant Fog::ServicesMixin` when requiring `fog/storage` [\#345](https://github.com/fog/fog-aws/issues/345)
48
+ - Add full support for target groups [\#328](https://github.com/fog/fog-aws/issues/328)
49
+ - Fog transfer acceleration endpoints [\#303](https://github.com/fog/fog-aws/issues/303)
50
+ - "Fog::DNS\[:aws\] | change\_resource\_record\_sets \(aws, dns\)" test suite flaky [\#301](https://github.com/fog/fog-aws/issues/301)
51
+ - Cross account access using IAM role [\#294](https://github.com/fog/fog-aws/issues/294)
52
+ - Write timeout trying to upload a large file to S3 [\#291](https://github.com/fog/fog-aws/issues/291)
53
+ - Support Autoscaling lifecycle hooks [\#289](https://github.com/fog/fog-aws/issues/289)
54
+ - directories ignore region option [\#287](https://github.com/fog/fog-aws/issues/287)
55
+ - Feature: Access logs for ELB [\#271](https://github.com/fog/fog-aws/issues/271)
56
+ - S3: retry on 500 internal server error [\#264](https://github.com/fog/fog-aws/issues/264)
57
+ - Alias for server side encryption not working [\#260](https://github.com/fog/fog-aws/issues/260)
58
+ - InvalidParameterCombination =\> You cannot move a DB instance with Single-Az enabled to a VPC \(Fog::AWS::RDS::Error\) [\#255](https://github.com/fog/fog-aws/issues/255)
59
+ - Using STS [\#253](https://github.com/fog/fog-aws/issues/253)
60
+ - Auto Scaling Group does not enable metrics [\#251](https://github.com/fog/fog-aws/issues/251)
61
+ - aws has no storage service [\#248](https://github.com/fog/fog-aws/issues/248)
62
+ - Timeouts on Compute\#describe\_volumes due to extreme numbers of volumes [\#244](https://github.com/fog/fog-aws/issues/244)
63
+ - Support CreateReusableDelegationSet [\#243](https://github.com/fog/fog-aws/issues/243)
64
+ - Tags server creation in Mock vs Real [\#239](https://github.com/fog/fog-aws/issues/239)
65
+ - Excon::Errors::SocketError Broken pipe \(Errno::EPIPE\) when use Activeadmin upload image by nested form [\#237](https://github.com/fog/fog-aws/issues/237)
66
+ - Fog Mock doesn't update [\#236](https://github.com/fog/fog-aws/issues/236)
67
+ - ECS service\_update does not support "deploymentConfig" [\#234](https://github.com/fog/fog-aws/issues/234)
68
+ - Fog::Storage::AWS::Files\#each always iterates over entire collection [\#232](https://github.com/fog/fog-aws/issues/232)
69
+ - repeated bucket name in the URL on AWS and issue with :path\_style [\#228](https://github.com/fog/fog-aws/issues/228)
70
+ - Already initialized constant warnings [\#212](https://github.com/fog/fog-aws/issues/212)
71
+ - SQS API version is outdated [\#198](https://github.com/fog/fog-aws/issues/198)
72
+ - Problem when using irb [\#195](https://github.com/fog/fog-aws/issues/195)
73
+ - compute.servers \(via DescribeInstances\) does not include tags reliably [\#192](https://github.com/fog/fog-aws/issues/192)
74
+ - EBS create volume io1 or gp2 [\#186](https://github.com/fog/fog-aws/issues/186)
75
+ - Aws cloudformation stack-policy-body [\#179](https://github.com/fog/fog-aws/issues/179)
76
+ - EXCON\_DEBUG and DEBUG env variables do not help debug -S key issues [\#177](https://github.com/fog/fog-aws/issues/177)
77
+ - AWS4 SignatureDoesNotMatch if header contains two spaces [\#160](https://github.com/fog/fog-aws/issues/160)
78
+ - Add support for elasticache redis replication groups [\#136](https://github.com/fog/fog-aws/issues/136)
79
+ - Getting SignatureDoesNotMatch error with eu-central-1 [\#127](https://github.com/fog/fog-aws/issues/127)
80
+ - Cannot saving auto scaling group [\#125](https://github.com/fog/fog-aws/issues/125)
81
+ - fog-aws not working with dynamoDB Local [\#118](https://github.com/fog/fog-aws/issues/118)
82
+ - Fog::Compute::AWS::Error InvalidParameterValue =\> secondary-addresses [\#115](https://github.com/fog/fog-aws/issues/115)
83
+ - Is there an equivalent to describe-instance-status? [\#66](https://github.com/fog/fog-aws/issues/66)
84
+ - No usage instructions in Readme [\#64](https://github.com/fog/fog-aws/issues/64)
85
+ - AWS - distributionConfig.enabled' failed to satisfy constraint: Member must not be null [\#48](https://github.com/fog/fog-aws/issues/48)
86
+ - Clarify versioning on README [\#42](https://github.com/fog/fog-aws/issues/42)
87
+ - AWS SQS AddPermission API missing [\#26](https://github.com/fog/fog-aws/issues/26)
88
+ - AWS China region [\#25](https://github.com/fog/fog-aws/issues/25)
89
+ - AWS CloudFormation ListStacks options [\#24](https://github.com/fog/fog-aws/issues/24)
90
+ - Setting region of AWS::Compute after initialization [\#23](https://github.com/fog/fog-aws/issues/23)
91
+ - Support AWS Support API [\#22](https://github.com/fog/fog-aws/issues/22)
92
+ - InvalidClientTokenId =\> The security token included in the request is invalid [\#21](https://github.com/fog/fog-aws/issues/21)
93
+ - Change architecture attribute in AWS::Compute::Server model [\#20](https://github.com/fog/fog-aws/issues/20)
94
+ - Add support for Amazon Kinesis [\#19](https://github.com/fog/fog-aws/issues/19)
95
+ - Bring AWS CloudFront API Models/Requests up to date [\#17](https://github.com/fog/fog-aws/issues/17)
96
+ - AWS security group tests have become unstable [\#16](https://github.com/fog/fog-aws/issues/16)
97
+ - AWS auto scaling: availability zones are not a required parameter [\#15](https://github.com/fog/fog-aws/issues/15)
98
+ - Is anyone going to add support for AWS ElasticTranscoder [\#14](https://github.com/fog/fog-aws/issues/14)
99
+ - add missing attributes to aws describe\_reserved\_instances parser [\#13](https://github.com/fog/fog-aws/issues/13)
100
+ - AWS AutoScaling group min\_size & max\_size getting set to 0 [\#12](https://github.com/fog/fog-aws/issues/12)
101
+ - auto\_scaling\_group.instances does not return only instances for that group [\#11](https://github.com/fog/fog-aws/issues/11)
102
+ - Why are the credential keys not generalized? [\#10](https://github.com/fog/fog-aws/issues/10)
103
+ - Invalid XML Character in S3 Response [\#8](https://github.com/fog/fog-aws/issues/8)
104
+ - reading s3 upload progress [\#7](https://github.com/fog/fog-aws/issues/7)
105
+ - delete\_on\_termination=true attribute on new volume is not set on create [\#6](https://github.com/fog/fog-aws/issues/6)
106
+ - user\_data is still base64 encoded in Real launch\_configurations [\#5](https://github.com/fog/fog-aws/issues/5)
107
+
108
+ **Merged pull requests:**
109
+
110
+ - Add storage option to configure multipart put/copy [\#616](https://github.com/fog/fog-aws/pull/616) ([slonopotamus](https://github.com/slonopotamus))
111
+ - Bump actions/stale from 3.0.19 to 4 [\#615](https://github.com/fog/fog-aws/pull/615) ([dependabot[bot]](https://github.com/apps/dependabot))
112
+ - Update file.rb [\#613](https://github.com/fog/fog-aws/pull/613) ([iqre8](https://github.com/iqre8))
113
+ - fix storage for ruby 3.0 [\#611](https://github.com/fog/fog-aws/pull/611) ([vincentjoseph](https://github.com/vincentjoseph))
114
+ - Implement AWS TagSpecifications \(closes \#603\) [\#610](https://github.com/fog/fog-aws/pull/610) ([eLvErDe](https://github.com/eLvErDe))
115
+ - Bump actions/stale from 3.0.18 to 3.0.19 [\#609](https://github.com/fog/fog-aws/pull/609) ([dependabot[bot]](https://github.com/apps/dependabot))
116
+ - Bump actions/stale from 3 to 3.0.18 [\#608](https://github.com/fog/fog-aws/pull/608) ([dependabot[bot]](https://github.com/apps/dependabot))
117
+ - Bump actions/checkout from 2 to 2.3.4 [\#607](https://github.com/fog/fog-aws/pull/607) ([dependabot[bot]](https://github.com/apps/dependabot))
118
+ - drop git in gemspec [\#602](https://github.com/fog/fog-aws/pull/602) ([abrahamparayil](https://github.com/abrahamparayil))
119
+ - Update rubyzip requirement from ~\> 1.3.0 to ~\> 2.3.0 [\#601](https://github.com/fog/fog-aws/pull/601) ([dependabot[bot]](https://github.com/apps/dependabot))
120
+
3
121
  ## [v3.10.0](https://github.com/fog/fog-aws/tree/v3.10.0) (2021-03-22)
4
122
 
5
123
  [Full Changelog](https://github.com/fog/fog-aws/compare/v3.9.0...v3.10.0)
@@ -12,7 +130,6 @@
12
130
  - Enable hibernation on creation of ec2 instance [\#566](https://github.com/fog/fog-aws/issues/566)
13
131
  - Tests broken with fog-core 2.1.0 [\#504](https://github.com/fog/fog-aws/issues/504)
14
132
  - changelog? [\#471](https://github.com/fog/fog-aws/issues/471)
15
- - Changelog: Listing breaking changes [\#419](https://github.com/fog/fog-aws/issues/419)
16
133
  - How to use iam\_instance\_profile? [\#342](https://github.com/fog/fog-aws/issues/342)
17
134
  - how to support additional aws regions, e.g. cn-north-1 [\#164](https://github.com/fog/fog-aws/issues/164)
18
135
  - Still empty content-encoding when it is not set [\#130](https://github.com/fog/fog-aws/issues/130)
@@ -883,7 +1000,7 @@
883
1000
  - Fix mock VPC ELB creation in regions other than us-east-1 [\#94](https://github.com/fog/fog-aws/pull/94) ([mrpoundsign](https://github.com/mrpoundsign))
884
1001
  - Fix repository URL in README.md [\#91](https://github.com/fog/fog-aws/pull/91) ([tricknotes](https://github.com/tricknotes))
885
1002
  - adding support for d2 instance type [\#90](https://github.com/fog/fog-aws/pull/90) ([yumminhuang](https://github.com/yumminhuang))
886
- - Support weight round robin mock [\#89](https://github.com/fog/fog-aws/pull/89) ([freddy1666](https://github.com/freddy1666))
1003
+ - Support weight round robin mock [\#89](https://github.com/fog/fog-aws/pull/89) ([freddy61025](https://github.com/freddy61025))
887
1004
  - Update README.md [\#87](https://github.com/fog/fog-aws/pull/87) ([nomadium](https://github.com/nomadium))
888
1005
  - Add mock for EC2 request\_spot\_instances API request [\#86](https://github.com/fog/fog-aws/pull/86) ([nomadium](https://github.com/nomadium))
889
1006
  - Move more requires to autoload [\#85](https://github.com/fog/fog-aws/pull/85) ([plribeiro3000](https://github.com/plribeiro3000))
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Fog::Aws
2
2
 
3
3
  ![Gem Version](https://badge.fury.io/rb/fog-aws.svg)
4
- [![Build Status](https://github.com/fog/fog-aws/actions/workflows/ruby.yml/badge.svg)](https://github.com/fog/fog-aws/workflows/ruby.yml)
4
+ [![Build Status](https://github.com/fog/fog-aws/actions/workflows/ruby.yml/badge.svg)](https://github.com/fog/fog-aws/actions/workflows/ruby.yml)
5
5
  [![Test Coverage](https://codeclimate.com/github/fog/fog-aws/badges/coverage.svg)](https://codeclimate.com/github/fog/fog-aws)
6
6
  [![Code Climate](https://codeclimate.com/github/fog/fog-aws.svg)](https://codeclimate.com/github/fog/fog-aws)
7
7
 
data/fog-aws.gemspec CHANGED
@@ -14,7 +14,8 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = "https://github.com/fog/fog-aws"
15
15
  spec.license = "MIT"
16
16
 
17
- spec.files = `git ls-files -z`.split("\x0")
17
+ spec.files = Dir['lib/**/*.rb', 'tests/**/*', 'CHANGELOG.md', 'CONTRIBUTING.md',
18
+ 'CONTRIBUTORS.md', 'LICENSE.md', 'README.md', 'fog-aws.gemspec',]
18
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
20
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
21
  spec.require_paths = ["lib"]
@@ -24,7 +25,7 @@ Gem::Specification.new do |spec|
24
25
  spec.add_development_dependency 'bundler'
25
26
  spec.add_development_dependency 'github_changelog_generator', '~> 1.16'
26
27
  spec.add_development_dependency 'rake', '>= 12.3.3'
27
- spec.add_development_dependency 'rubyzip', '~> 1.3.0'
28
+ spec.add_development_dependency 'rubyzip', '~> 2.3.0'
28
29
  spec.add_development_dependency 'shindo', '~> 0.3'
29
30
 
30
31
  spec.add_dependency 'fog-core', '~> 2.1'
@@ -50,6 +50,7 @@ module Fog
50
50
  attribute :subnet_id, :aliases => 'subnetId'
51
51
  attribute :tenancy
52
52
  attribute :tags, :aliases => 'tagSet'
53
+ attribute :tag_specifications, :aliases => 'tagSpecifications'
53
54
  attribute :user_data
54
55
  attribute :virtualization_type, :aliases => 'virtualizationType'
55
56
  attribute :vpc_id, :aliases => 'vpcId'
@@ -166,6 +167,7 @@ module Fog
166
167
  'SecurityGroupId' => security_group_ids,
167
168
  'SubnetId' => subnet_id,
168
169
  'UserData' => user_data,
170
+ 'TagSpecifications' => tag_specifications,
169
171
  }
170
172
  options.delete_if {|key, value| value.nil?}
171
173
 
@@ -4,8 +4,11 @@ module Fog
4
4
  module AWS
5
5
  class Storage
6
6
  class File < Fog::Model
7
- MIN_MULTIPART_CHUNK_SIZE = 5242880
8
- MAX_SINGLE_PUT_SIZE = 5368709120
7
+ # @deprecated use {Fog::AWS::Storage::MIN_MULTIPART_CHUNK_SIZE} instead
8
+ MIN_MULTIPART_CHUNK_SIZE = Fog::AWS::Storage::MIN_MULTIPART_CHUNK_SIZE
9
+ # @deprecated use {Fog::AWS::Storage::MAX_SINGLE_PUT_SIZE} instead
10
+ MAX_SINGLE_PUT_SIZE = Fog::AWS::Storage::MAX_SINGLE_PUT_SIZE
11
+ # @deprecated not used for anything
9
12
  MULTIPART_COPY_THRESHOLD = 15728640
10
13
 
11
14
  # @see AWS Object docs http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectOps.html
@@ -30,6 +33,7 @@ module Fog
30
33
  attribute :version, :aliases => 'x-amz-version-id'
31
34
  attribute :kms_key_id, :aliases => 'x-amz-server-side-encryption-aws-kms-key-id'
32
35
  attribute :tags, :aliases => 'x-amz-tagging'
36
+ attribute :website_redirect_location, :aliases => 'x-amz-website-redirect-location'
33
37
 
34
38
  UploadPartData = Struct.new(:part_number, :upload_options, :etag)
35
39
 
@@ -64,7 +68,7 @@ module Fog
64
68
  # Use small chunk sizes to minimize memory. E.g. 5242880 = 5mb
65
69
  attr_reader :multipart_chunk_size
66
70
  def multipart_chunk_size=(mp_chunk_size)
67
- raise ArgumentError.new("minimum multipart_chunk_size is #{MIN_MULTIPART_CHUNK_SIZE}") if mp_chunk_size < MIN_MULTIPART_CHUNK_SIZE
71
+ service.validate_chunk_size(mp_chunk_size, 'multipart_chunk_size')
68
72
  @multipart_chunk_size = mp_chunk_size
69
73
  end
70
74
 
@@ -144,10 +148,9 @@ module Fog
144
148
  def copy(target_directory_key, target_file_key, options = {})
145
149
  requires :directory, :key
146
150
 
147
- # With a single PUT operation you can upload objects up to 5 GB in size. Automatically set MP for larger objects.
148
- self.multipart_chunk_size = MIN_MULTIPART_CHUNK_SIZE * 2 if !multipart_chunk_size && self.content_length.to_i > MAX_SINGLE_PUT_SIZE
151
+ self.multipart_chunk_size = service.max_copy_chunk_size if multipart_chunk_size.nil?
149
152
 
150
- if multipart_chunk_size && self.content_length.to_i >= multipart_chunk_size
153
+ if multipart_chunk_size > 0 && self.content_length.to_i >= multipart_chunk_size
151
154
  upload_part_options = options.select { |key, _| ALLOWED_UPLOAD_PART_OPTIONS.include?(key.to_sym) }
152
155
  upload_part_options = upload_part_options.merge({ 'x-amz-copy-source' => "#{directory.key}/#{key}" })
153
156
  multipart_copy(options, upload_part_options, target_directory_key, target_file_key)
@@ -249,6 +252,7 @@ module Fog
249
252
  # @option options [String] storage_class sets x-amz-storage-class HTTP header. Defaults to 'STANDARD'. Or, 'REDUCED_REDUNDANCY'
250
253
  # @option options [String] encryption sets HTTP encryption header. Set to 'AES256' to encrypt files at rest on S3
251
254
  # @option options [String] tags sets x-amz-tagging HTTP header. For example, 'Org-Id=1' or 'Org-Id=1&Service=MyService'
255
+ # @option options [String] website_redirect_location sets x-amz-website-redirect-location HTTP header. For example, 'website_redirect_location=http://www.rubydoc.info/github/fog/fog-aws'
252
256
  # @return [Boolean] true if no errors
253
257
  #
254
258
  def save(options = {})
@@ -266,12 +270,11 @@ module Fog
266
270
  options.merge!(metadata)
267
271
  options['x-amz-storage-class'] = storage_class if storage_class
268
272
  options['x-amz-tagging'] = tags if tags
273
+ options['x-amz-website-redirect-location'] = website_redirect_location if website_redirect_location
269
274
  options.merge!(encryption_headers)
270
275
 
271
- # With a single PUT operation you can upload objects up to 5 GB in size. Automatically set MP for larger objects.
272
- self.multipart_chunk_size = MIN_MULTIPART_CHUNK_SIZE if !multipart_chunk_size && Fog::Storage.get_body_size(body) > MAX_SINGLE_PUT_SIZE
273
-
274
- if multipart_chunk_size && Fog::Storage.get_body_size(body) >= multipart_chunk_size && body.respond_to?(:read)
276
+ self.multipart_chunk_size = service.max_put_chunk_size if multipart_chunk_size.nil?
277
+ if multipart_chunk_size > 0 && Fog::Storage.get_body_size(body) >= multipart_chunk_size && body.respond_to?(:read)
275
278
  data = multipart_save(options)
276
279
  merge_attributes(data.body)
277
280
  else
@@ -44,6 +44,11 @@ module Fog
44
44
  # * 'PrivateIpAddresses.Primary'<~Bool> - Indicates whether the private IP address is the primary private IP address.
45
45
  # * 'SecondaryPrivateIpAddressCount'<~Bool> - The number of private IP addresses to assign to the network interface.
46
46
  # * 'AssociatePublicIpAddress'<~String> - Indicates whether to assign a public IP address to an instance in a VPC. The public IP address is assigned to a specific network interface
47
+ # * 'TagSpecifications'<~Array>: array of hashes
48
+ # * 'ResourceType'<~String> - Type of resource to apply tags on, e.g: instance or volume
49
+ # * 'Tags'<~Array> - List of hashs reprensenting tag to be set
50
+ # * 'Key'<~String> - Tag name
51
+ # * 'Value'<~String> - Tag value
47
52
  # * 'ClientToken'<~String> - unique case-sensitive token for ensuring idempotency
48
53
  # * 'DisableApiTermination'<~Boolean> - specifies whether or not to allow termination of the instance from the api
49
54
  # * 'SecurityGroup'<~Array> or <~String> - Name of security group(s) for instances (not supported for VPC)
@@ -144,6 +149,45 @@ module Fog
144
149
  end
145
150
  end
146
151
  end
152
+ if tag_specifications = options.delete('TagSpecifications')
153
+ # From https://docs.aws.amazon.com/sdk-for-ruby/v2/api/Aws/EC2/Client.html#run_instances-instance_method
154
+ # And https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html
155
+ # Discussed at https://github.com/fog/fog-aws/issues/603
156
+ #
157
+ # Example
158
+ #
159
+ # TagSpecifications: [
160
+ # {
161
+ # ResourceType: "instance",
162
+ # Tags: [
163
+ # {
164
+ # Key: "Project",
165
+ # Value: "MyProject",
166
+ # },
167
+ # ],
168
+ # },
169
+ # {
170
+ # ResourceType: "volume",
171
+ # Tags: [
172
+ # {
173
+ # Key: "Project",
174
+ # Value: "MyProject",
175
+ # },
176
+ # ],
177
+ # },
178
+ # ]
179
+ tag_specifications.each_with_index do |val, idx|
180
+ resource_type = val["ResourceType"]
181
+ tags = val["Tags"]
182
+ options["TagSpecification.#{idx}.ResourceType"] = resource_type
183
+ tags.each_with_index do |tag, tag_idx|
184
+ aws_tag_key = "TagSpecification.#{idx}.Tag.#{tag_idx}.Key"
185
+ aws_tag_value = "TagSpecification.#{idx}.Tag.#{tag_idx}.Value"
186
+ options[aws_tag_key] = tag["Key"]
187
+ options[aws_tag_value] = tag["Value"]
188
+ end
189
+ end
190
+ end
147
191
 
148
192
  idempotent = !(options['ClientToken'].nil? || options['ClientToken'].empty?)
149
193
 
@@ -50,7 +50,7 @@ module Fog
50
50
 
51
51
  idempotent = true
52
52
  if block_given?
53
- params[:response_block] = Proc.new
53
+ params[:response_block] = Proc.new(&block)
54
54
  idempotent = false
55
55
  end
56
56
 
@@ -14,6 +14,9 @@ module Fog
14
14
  'https' => 443
15
15
  }
16
16
 
17
+ MIN_MULTIPART_CHUNK_SIZE = 5242880
18
+ MAX_SINGLE_PUT_SIZE = 5368709120
19
+
17
20
  VALID_QUERY_KEYS = %w[
18
21
  acl
19
22
  cors
@@ -43,7 +46,7 @@ module Fog
43
46
  ]
44
47
 
45
48
  requires :aws_access_key_id, :aws_secret_access_key
46
- recognizes :endpoint, :region, :host, :port, :scheme, :persistent, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :path_style, :acceleration, :instrumentor, :instrumentor_name, :aws_signature_version, :enable_signature_v4_streaming, :virtual_host, :cname
49
+ recognizes :endpoint, :region, :host, :port, :scheme, :persistent, :use_iam_profile, :aws_session_token, :aws_credentials_expire_at, :path_style, :acceleration, :instrumentor, :instrumentor_name, :aws_signature_version, :enable_signature_v4_streaming, :virtual_host, :cname, :max_put_chunk_size, :max_copy_chunk_size
47
50
 
48
51
  secrets :aws_secret_access_key, :hmac
49
52
 
@@ -117,6 +120,17 @@ module Fog
117
120
  module Utils
118
121
  attr_accessor :region
119
122
 
123
+ # Amazon S3 limits max chunk size that can be uploaded/copied in a single request to 5GB.
124
+ # Other S3-compatible storages (like, Ceph) do not have such limit.
125
+ # Ceph shows much better performance when file is copied as a whole, in a single request.
126
+ # fog-aws user can use these settings to configure chunk sizes.
127
+ # A non-positive value will tell fog-aws to use a single put/copy request regardless of file size.
128
+ #
129
+ # @return [Integer]
130
+ # @see https://docs.aws.amazon.com/AmazonS3/latest/userguide/copy-object.html
131
+ attr_reader :max_put_chunk_size
132
+ attr_reader :max_copy_chunk_size
133
+
120
134
  def cdn
121
135
  @cdn ||= Fog::AWS::CDN.new(
122
136
  :aws_access_key_id => @aws_access_key_id,
@@ -171,6 +185,12 @@ module Fog
171
185
  params_to_url(params)
172
186
  end
173
187
 
188
+ # @param value [int]
189
+ # @param description [str]
190
+ def validate_chunk_size(value, description)
191
+ raise "#{description} (#{value}) is less than minimum #{MIN_MULTIPART_CHUNK_SIZE}" unless value <= 0 || value >= MIN_MULTIPART_CHUNK_SIZE
192
+ end
193
+
174
194
  private
175
195
 
176
196
  def validate_signature_version!
@@ -179,6 +199,16 @@ module Fog
179
199
  end
180
200
  end
181
201
 
202
+ def init_max_put_chunk_size!(options = {})
203
+ @max_put_chunk_size = options.fetch(:max_put_chunk_size, MAX_SINGLE_PUT_SIZE)
204
+ validate_chunk_size(@max_put_chunk_size, 'max_put_chunk_size')
205
+ end
206
+
207
+ def init_max_copy_chunk_size!(options = {})
208
+ @max_copy_chunk_size = options.fetch(:max_copy_chunk_size, MAX_SINGLE_PUT_SIZE)
209
+ validate_chunk_size(@max_copy_chunk_size, 'max_copy_chunk_size')
210
+ end
211
+
182
212
  def v4_signed_params_for_url(params, expires)
183
213
  now = Fog::Time.now
184
214
 
@@ -452,6 +482,10 @@ module Fog
452
482
 
453
483
 
454
484
  @path_style = options[:path_style] || false
485
+
486
+ init_max_put_chunk_size!(options)
487
+ init_max_copy_chunk_size!(options)
488
+
455
489
  @signature_version = options.fetch(:aws_signature_version, 4)
456
490
  validate_signature_version!
457
491
  setup_credentials(options)
@@ -515,6 +549,9 @@ module Fog
515
549
  validate_signature_version!
516
550
  @path_style = options[:path_style] || false
517
551
 
552
+ init_max_put_chunk_size!(options)
553
+ init_max_copy_chunk_size!(options)
554
+
518
555
  @region = options[:region] || DEFAULT_REGION
519
556
 
520
557
  if @endpoint = options[:endpoint]
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module AWS
3
- VERSION = "3.10.0"
3
+ VERSION = "3.11.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.0
4
+ version: 3.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lane
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-03-22 00:00:00.000000000 Z
12
+ date: 2021-08-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: 1.3.0
62
+ version: 2.3.0
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: 1.3.0
69
+ version: 2.3.0
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: shindo
72
72
  requirement: !ruby/object:Gem::Requirement
@@ -147,21 +147,12 @@ executables: []
147
147
  extensions: []
148
148
  extra_rdoc_files: []
149
149
  files:
150
- - ".github/dependabot.yml"
151
- - ".github/workflows/ruby.yml"
152
- - ".github/workflows/stale.yml"
153
- - ".gitignore"
154
150
  - CHANGELOG.md
155
151
  - CONTRIBUTING.md
156
152
  - CONTRIBUTORS.md
157
- - Gemfile
158
153
  - LICENSE.md
159
154
  - README.md
160
- - Rakefile
161
- - bin/console
162
- - bin/setup
163
155
  - fog-aws.gemspec
164
- - gemfiles/Gemfile-edge
165
156
  - lib/fog-aws.rb
166
157
  - lib/fog/aws.rb
167
158
  - lib/fog/aws/auto_scaling.rb
@@ -185,9 +176,7 @@ files:
185
176
  - lib/fog/aws/federation.rb
186
177
  - lib/fog/aws/glacier.rb
187
178
  - lib/fog/aws/iam.rb
188
- - lib/fog/aws/iam/default_policies.json
189
179
  - lib/fog/aws/iam/default_policies.rb
190
- - lib/fog/aws/iam/default_policy_versions.json
191
180
  - lib/fog/aws/iam/paged_collection.rb
192
181
  - lib/fog/aws/kinesis.rb
193
182
  - lib/fog/aws/kms.rb
@@ -1744,7 +1733,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1744
1733
  - !ruby/object:Gem::Version
1745
1734
  version: '0'
1746
1735
  requirements: []
1747
- rubygems_version: 3.1.2
1736
+ rubygems_version: 3.2.15
1748
1737
  signing_key:
1749
1738
  specification_version: 4
1750
1739
  summary: Module for the 'fog' gem to support Amazon Web Services.