Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add awslogs-endpoint for isolated regions when creating containers
Browse files Browse the repository at this point in the history
prateekchaudhry committed Jul 26, 2024
1 parent 51c7484 commit 3a0fd22
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions agent/engine/docker_task_engine.go
Original file line number Diff line number Diff line change
@@ -1876,10 +1876,10 @@ func (engine *DockerTaskEngine) createContainer(task *apitask.Task, container *a
}
}

// This is a short term solution only for specific regions until AWS SDK Go is upgraded to V2
// This is a short term solution only for specific regions
if hostConfig.LogConfig.Type == logDriverTypeAwslogs {
region := engine.cfg.AWSRegion
if region == "eu-isoe-west-1" || region == "us-isof-south-1" || region == "us-isof-east-1" {
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" {
endpoint := ""
dnsSuffix := ""
partition, ok := ep.PartitionForRegion(ep.DefaultPartitions(), region)
15 changes: 15 additions & 0 deletions agent/engine/docker_task_engine_test.go
Original file line number Diff line number Diff line change
@@ -2972,6 +2972,21 @@ func TestCreateContainerAwslogsLogDriver(t *testing.T) {
region: "us-isof-east-1",
expectedLogConfigEndpoint: "https://logs.us-isof-east-1.csp.hci.ic.gov",
},
{
name: "test container that uses awslogs log driver in LCK",
region: "us-isob-east-1",
expectedLogConfigEndpoint: "https://logs.us-isob-east-1.sc2s.sgov.gov",
},
{
name: "test container that uses awslogs log driver in DCA",
region: "us-iso-east-1",
expectedLogConfigEndpoint: "https://logs.us-iso-east-1.c2s.ic.gov",
},
{
name: "test container that uses awslogs log driver in APA",
region: "us-iso-west-1",
expectedLogConfigEndpoint: "https://logs.us-iso-west-1.c2s.ic.gov",
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {

0 comments on commit 3a0fd22

Please sign in to comment.