configure-s3-website 1.7.4 → 1.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/changelog.md +4 -0
- data/lib/configure-s3-website/s3_client.rb +8 -3
- data/lib/configure-s3-website/version.rb +1 -1
- data/spec/s3_client_spec.rb +8 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 772c1776d6327d9b5f05962dc98c2db3993efbd8
|
4
|
+
data.tar.gz: 941789187e3608cdb2e7ab0a878ab8d06ea6818d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5031cd1225cde3d2c30988ca8588f0b10ca9b67a115d1cb3c7ff2bda2405533f22638a15eac1f428dc05d1f6f8799f8f2445d412fb37fe04a1f981b96171850
|
7
|
+
data.tar.gz: 576061e3ca1fcb50e24af52dc9d924c8fee08082d0a9035e456cd10fb35cbbfbd21d4261760e6330c8d16a4e490b27e9c15c46dd1cf95370cc5aaa17f3c58255
|
data/changelog.md
CHANGED
@@ -95,9 +95,14 @@ module ConfigureS3Website
|
|
95
95
|
def self.create_bucket(config_source)
|
96
96
|
s3(config_source).create_bucket({
|
97
97
|
bucket: config_source.s3_bucket_name,
|
98
|
-
create_bucket_configuration:
|
99
|
-
|
100
|
-
|
98
|
+
create_bucket_configuration:
|
99
|
+
if config_source.s3_endpoint && config_source.s3_endpoint != 'us-east-1'
|
100
|
+
{
|
101
|
+
location_constraint: config_source.s3_endpoint
|
102
|
+
}
|
103
|
+
else
|
104
|
+
nil
|
105
|
+
end
|
101
106
|
})
|
102
107
|
puts "Created bucket %s in the %s Region" %
|
103
108
|
[
|
data/spec/s3_client_spec.rb
CHANGED
@@ -76,9 +76,14 @@ describe ConfigureS3Website::S3Client do
|
|
76
76
|
it 'calls the S3 CreateBucket API with the correct location constraint' do
|
77
77
|
allow_any_instance_of(Aws::S3::Client).to receive(:create_bucket).with(
|
78
78
|
hash_including(
|
79
|
-
create_bucket_configuration:
|
80
|
-
|
81
|
-
|
79
|
+
create_bucket_configuration:
|
80
|
+
if conf[:region] == 'us-east-1'
|
81
|
+
nil
|
82
|
+
else
|
83
|
+
{
|
84
|
+
location_constraint: conf[:region]
|
85
|
+
}
|
86
|
+
end
|
82
87
|
)
|
83
88
|
)
|
84
89
|
config_source = double('config_source')
|