Skip to content

Commit 800eb28

Browse files
authored
Merge pull request #415 from aws/1.8.1
1.8.1
2 parents a002df5 + e5084f0 commit 800eb28

7 files changed

Lines changed: 72 additions & 9 deletions

File tree

certs/windows-ca-bundle.crt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3924,3 +3924,19 @@ ONFLAzkopR6RctR9q5czxNM+4Gm2KHmgCY0c0f9BckgG/Jou5yD5m6Leie2uPAmvylezkolwQOQv
39243924
T8Jwg0DXJCxr5wkf09XHwQj02w47HAcLQxGEIYbpgNR12KvxAmLBsX5VYc8T1yaw15zLKYs4SgsO
39253925
kI26oQ==
39263926
-----END CERTIFICATE-----
3927+
3928+
Sectigo Public Server Authentication Root E46
3929+
=============================================
3930+
-----BEGIN CERTIFICATE-----
3931+
MIICOjCCAcGgAwIBAgIQQvLM2htpN0RfFf51KBC49DAKBggqhkjOPQQDAzBfMQswCQYDVQQGEwJH
3932+
QjEYMBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMTYwNAYDVQQDEy1TZWN0aWdvIFB1YmxpYyBTZXJ2
3933+
ZXIgQXV0aGVudGljYXRpb24gUm9vdCBFNDYwHhcNMjEwMzIyMDAwMDAwWhcNNDYwMzIxMjM1OTU5
3934+
WjBfMQswCQYDVQQGEwJHQjEYMBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMTYwNAYDVQQDEy1TZWN0
3935+
aWdvIFB1YmxpYyBTZXJ2ZXIgQXV0aGVudGljYXRpb24gUm9vdCBFNDYwdjAQBgcqhkjOPQIBBgUr
3936+
gQQAIgNiAAR2+pmpbiDt+dd34wc7qNs9Xzjoq1WmVk/WSOrsfy2qw7LFeeyZYX8QeccCWvkEN/U0
3937+
NSt3zn8gj1KjAIns1aeibVvjS5KToID1AZTc8GgHHs3u/iVStSBDHBv+6xnOQ6OjQjBAMB0GA1Ud
3938+
DgQWBBTRItpMWfFLXyY4qp3W7usNw/upYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB
3939+
/zAKBggqhkjOPQQDAwNnADBkAjAn7qRaqCG76UeXlImldCBteU/IvZNeWBj7LRoAasm4PdCkT0RH
3940+
lAFWovgzJQxC36oCMB3q4S6ILuH5px0CMk7yn2xVdOOurvulGu7t0vzCAxHrRVxgED1cf5kDW21U
3941+
SAGKcw==
3942+
-----END CERTIFICATE-----

codedeploy_agent.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |spec|
22
spec.name = 'aws_codedeploy_agent'
3-
spec.version = '1.8.0'
3+
spec.version = '1.8.1'
44
spec.summary = 'Packages AWS CodeDeploy agent libraries'
55
spec.description = 'AWS CodeDeploy agent is responsible for doing the actual work of deploying software on an individual EC2 instance'
66
spec.author = 'Amazon Web Services'

lib/instance_agent/plugins/codedeploy/command_executor.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,9 @@ def s3_options
364364
options[:signature_version] = 'v4'
365365

366366
region = ENV['AWS_REGION'] || InstanceMetadata.region
367+
if region == "eusc-de-east-1"
368+
options[:endpoint] = 'https://s3.eusc-de-east-1.amazonaws.eu'
369+
end
367370
options[:region] = region
368371

369372
if !InstanceAgent::Config.config[:s3_endpoint_override].to_s.empty?

test/instance_agent/plugins/codedeploy/codedeploy_control_test.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,20 @@ class CodeDeployControlTest < InstanceAgentTestCase
122122
assert_equal "codedeploy-commands.us-east-1.amazonaws.com", codedeploy_control_client.get_client.config.endpoint.host
123123
end
124124

125-
should "resolve non .com domains" do
125+
should "resolve China (Beijing) domain" do
126126
codedeploy_control_client = CodeDeployControl.new :region => "cn-north-1"
127127
assert_equal "codedeploy-commands.cn-north-1.amazonaws.com.cn", codedeploy_control_client.get_client.config.endpoint.host
128128
end
129+
130+
should "resolve China (Ningxia) domain" do
131+
codedeploy_control_client = CodeDeployControl.new :region => "cn-northwest-1"
132+
assert_equal "codedeploy-commands.cn-northwest-1.amazonaws.com.cn", codedeploy_control_client.get_client.config.endpoint.host
133+
end
134+
135+
should "resolve eu gov cloud domain" do
136+
codedeploy_control_client = CodeDeployControl.new :region => "eusc-de-east-1"
137+
assert_equal "codedeploy-commands.eusc-de-east-1.amazonaws.eu", codedeploy_control_client.get_client.config.endpoint.host
138+
end
129139
end
130140

131141
context "common config" do

test/instance_agent/plugins/codedeploy/command_executor_test.rb

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ def github_env_vars()
501501
assert_equal "https://example.override.endpoint.com", @command_executor.s3_options[:endpoint].to_s
502502
end
503503
end
504-
504+
505505
context "when no override endpoint provided and not using fips" do
506506
setup do
507507
InstanceAgent::Config.config[:s3_endpoint_override] = nil
@@ -523,6 +523,31 @@ def github_env_vars()
523523
assert_true @command_executor.s3_options.include? :endpoint
524524
end
525525
end
526+
527+
context "when region is EU GovCloud with instance metadata" do
528+
setup do
529+
InstanceAgent::Config.config[:s3_endpoint_override] = nil
530+
InstanceAgent::Config.config[:use_fips_mode] = false
531+
ENV['AWS_REGION'] = nil
532+
InstanceMetadata.stubs(:region).returns('eusc-de-east-1')
533+
end
534+
should "use S3 EU GovCloud specific endpoint" do
535+
assert_equal 'eusc-de-east-1', @command_executor.s3_options[:region]
536+
assert_equal 'https://s3.eusc-de-east-1.amazonaws.eu', @command_executor.s3_options[:endpoint]
537+
end
538+
end
539+
540+
context "when region is EU GovCloud" do
541+
setup do
542+
InstanceAgent::Config.config[:s3_endpoint_override] = nil
543+
InstanceAgent::Config.config[:use_fips_mode] = false
544+
ENV['AWS_REGION'] = 'eusc-de-east-1'
545+
end
546+
should "use S3 EU GovCloud specific endpoint" do
547+
assert_equal 'eusc-de-east-1', @command_executor.s3_options[:region]
548+
assert_equal 'https://s3.eusc-de-east-1.amazonaws.eu', @command_executor.s3_options[:endpoint]
549+
end
550+
end
526551
end
527552

528553
context "downloading bundle from S3" do

vendor/gems/codedeploy-commands-1.0.0/lib/aws/plugins/deploy_control_endpoint.rb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ class DeployControlEndpoint < Seahorse::Client::Plugin
2525
if is_on_prem?
2626
partitions_region_pattern = File.read(File.join(File.dirname(__FILE__), 'partition-region-pattern.json'))
2727
partitions_region_pattern_hash = JSON.parse(partitions_region_pattern)
28-
28+
2929
unless partitions_region_pattern_hash.include?(domain)
3030
raise "Unknown domain: #{domain}"
3131
end
32-
32+
3333
known_region_pattern = partitions_region_pattern_hash[domain]["regionRegex"]
34-
34+
3535
unless region.match(known_region_pattern)
3636
raise "Invalid region: #{region}"
3737
end
@@ -40,8 +40,13 @@ class DeployControlEndpoint < Seahorse::Client::Plugin
4040
ProcessManager::Log.info("Creating client url from IMDS region and domain")
4141
else
4242
region = cfg.region
43-
domain = 'amazonaws.com'
44-
domain += '.cn' if region.split("-")[0] == 'cn'
43+
suffix = case
44+
when region == 'eusc-de-east-1' then 'eu' # Special region has special domain
45+
when region.split("-")[0] == 'cn' then 'com.cn'
46+
else 'com'
47+
end
48+
49+
domain = "amazonaws.#{suffix}"
4550

4651
ProcessManager::Log.info("Creating client url from configurations")
4752
end

vendor/gems/codedeploy-commands-1.0.0/lib/aws/plugins/partition-region-pattern.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
"regionRegex" : "^[0-9a-z-]{1,20}$"
44
},
55

6-
"amazonaws.com.cn": {
6+
"amazonaws.eu": {
7+
"regionRegex" : "^[0-9a-z-]{1,20}$"
8+
},
9+
10+
"amazonaws.com.cn": {
711
"regionRegex" : "^cn\\-\\w+\\-\\d+$"
812
}
913
}

0 commit comments

Comments
 (0)