Skip to content

Commit 8f74c87

Browse files
Add awslogs-endpoint for isolated regions when creating containers
1 parent 51c7484 commit 8f74c87

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

agent/engine/docker_task_engine.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1876,10 +1876,10 @@ func (engine *DockerTaskEngine) createContainer(task *apitask.Task, container *a
18761876
}
18771877
}
18781878

1879-
// This is a short term solution only for specific regions until AWS SDK Go is upgraded to V2
1879+
// This is a short term solution only for specific regions
18801880
if hostConfig.LogConfig.Type == logDriverTypeAwslogs {
18811881
region := engine.cfg.AWSRegion
1882-
if region == "eu-isoe-west-1" || region == "us-isof-south-1" || region == "us-isof-east-1" {
1882+
if region == "us-isob-east-1" || region == "us-iso-east-1" || region == "us-iso-west-1" || region == "eu-isoe-west-1" || region == "us-isof-south-1" || region == "us-isof-east-1" {
18831883
endpoint := ""
18841884
dnsSuffix := ""
18851885
partition, ok := ep.PartitionForRegion(ep.DefaultPartitions(), region)

agent/engine/docker_task_engine_test.go

+15
Original file line numberDiff line numberDiff line change
@@ -2972,6 +2972,21 @@ func TestCreateContainerAwslogsLogDriver(t *testing.T) {
29722972
region: "us-isof-east-1",
29732973
expectedLogConfigEndpoint: "https://logs.us-isof-east-1.csp.hci.ic.gov",
29742974
},
2975+
{
2976+
name: "test container that uses awslogs log driver in LCK",
2977+
region: "us-isob-east-1",
2978+
expectedLogConfigEndpoint: "https://logs.us-isob-east-1.sc2s.sgov.gov",
2979+
},
2980+
{
2981+
name: "test container that uses awslogs log driver in DCA",
2982+
region: "us-isof-south-1",
2983+
expectedLogConfigEndpoint: "https://logs.us-iso-east-1.c2s.ic.gov",
2984+
},
2985+
{
2986+
name: "test container that uses awslogs log driver in APA",
2987+
region: "us-isof-east-1",
2988+
expectedLogConfigEndpoint: "https://logs.us-iso-west-1.c2s.ic.gov",
2989+
},
29752990
}
29762991
for _, tc := range testCases {
29772992
t.Run(tc.name, func(t *testing.T) {

0 commit comments

Comments
 (0)