File tree Expand file tree Collapse file tree 5 files changed +19
-7
lines changed
Expand file tree Collapse file tree 5 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 77:verbose : false
88:wait_between_runs : 1
99:proxy_uri :
10- :max_revisions : 5
10+ :max_revisions : 5
Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ def initialize
4242 :proxy_uri => nil ,
4343 :enable_deployments_log => true ,
4444 :use_fips_mode => false ,
45- :deploy_control_endpoint => nil
45+ :deploy_control_endpoint => nil ,
46+ :s3_endpoint_override => nil
4647 } )
4748 end
4849
Original file line number Diff line number Diff line change @@ -266,12 +266,13 @@ def s3_options
266266
267267 region = ENV [ 'AWS_REGION' ] || InstanceMetadata . region
268268 options [ :region ] = region
269- if InstanceAgent ::Config . config [ :use_fips_mode ]
269+ if !InstanceAgent ::Config . config [ :s3_endpoint_override ] . to_s . empty?
270+ options [ :endpoint ] = URI ( InstanceAgent ::Config . config [ :s3_endpoint_override ] )
271+ elsif InstanceAgent ::Config . config [ :use_fips_mode ]
270272 #S3 Fips pseudo-regions are not supported by the SDK yet
271273 #source for the URL: https://aws.amazon.com/compliance/fips/
272274 options [ :endpoint ] = "https://s3-fips.#{ region } .amazonaws.com"
273- end
274-
275+ end
275276 proxy_uri = nil
276277 if InstanceAgent ::Config . config [ :proxy_uri ]
277278 proxy_uri = URI ( InstanceAgent ::Config . config [ :proxy_uri ] )
Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ class InstanceAgentConfigTest < InstanceAgentTestCase
3333 :enable_deployments_log => true ,
3434 :kill_agent_max_wait_time_seconds => 7200 ,
3535 :use_fips_mode => false ,
36- :deploy_control_endpoint => nil
36+ :deploy_control_endpoint => nil ,
37+ :s3_endpoint_override => nil
3738 } , InstanceAgent ::Config . config )
3839 end
3940
Original file line number Diff line number Diff line change @@ -332,7 +332,16 @@ def generate_signed_message_for(map)
332332 InstanceAgent ::Config . config [ :use_fips_mode ] = false
333333 end
334334
335- should "use no endpoint when not using Fips" do
335+ should "use right endpoint when using endpoint override" do
336+ s3_endpoint_override_url = 'htpp://testendpointoverride'
337+ InstanceAgent ::Config . config [ :s3_endpoint_override ] = s3_endpoint_override_url
338+ assert_equal s3_endpoint_override_url , @command_executor . s3_options [ :endpoint ] . to_s
339+ InstanceAgent ::Config . config [ :s3_endpoint_override ] = nil
340+ end
341+
342+ should "use no endpoint when neither using Fips nor Endpoint override" do
343+ InstanceAgent ::Config . config [ :s3_endpoint_override ] = nil
344+ InstanceAgent ::Config . config [ :use_fips_mode ] = false
336345 assert_false @command_executor . s3_options . include? :endpoint
337346 end
338347
You can’t perform that action at this time.
0 commit comments