Skip to content

Commit 17fb730

Browse files
committed
Reverting part of the FIPS change
Only the very latest version of the S3 tool has the region tips computation. As such any older loads of the library will fail to operate.
1 parent d6f65a7 commit 17fb730

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

lib/instance_agent/plugins/codedeploy/command_executor.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,11 @@ def s3_options
288288
options[:endpoint] = URI(InstanceAgent::Config.config[:s3_endpoint_override])
289289
elsif InstanceAgent::Config.config[:use_fips_mode]
290290
ProcessManager::Log.info("using fips endpoint")
291-
# This is not a true region but a way to signal to the S3 client that a FIPS enpoint should be used; added in SDK3.
292-
options[:region] = "fips-#{region}"
291+
# There was a recent change to S3 client to decompose the region and use a FIPS endpoint is "fips-" is appended
292+
# to the region. However, this is such a recent change that we cannot rely on the latest version of the SDK to be loaded.
293+
# For now, the endpoint will be set directly if FIPS is active but can switch to the S3 method once we have broader support.
294+
# options[:region] = "fips-#{region}"
295+
options[:endpoint] = "https://s3-fips.#{region}.amazonaws.com"
293296
end
294297
proxy_uri = nil
295298
if InstanceAgent::Config.config[:proxy_uri]

test/instance_agent/plugins/codedeploy/command_executor_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ def generate_signed_message_for(map)
353353
InstanceAgent::Config.config[:use_fips_mode] = true
354354
end
355355
should "use correct region and custom endpoint" do
356-
assert_equal 'fips-us-east-1', @command_executor.s3_options[:region]
357-
assert_false @command_executor.s3_options.include? :endpoint
356+
assert_equal 'us-east-1', @command_executor.s3_options[:region]
357+
assert_true @command_executor.s3_options.include? :endpoint
358358
end
359359
end
360360
end

0 commit comments

Comments
 (0)