Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add awslogs-endpoint for isolated regions when creating containers #4262

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add awslogs-endpoint for isolated regions when creating containers
prateekchaudhry committed Jul 26, 2024
commit 3a0fd225b55f97ebbb4bd89d585baa9d3aaf0010
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) {