Skip to content

Use resolv.conf from host for Service Connect tasks on ECS managed instnaces - #4849

Merged
xxx0624 merged 1 commit into
aws:devfrom
xxx0624:dev
Jan 27, 2026
Merged

xxx0624 merged 1 commit into
aws:devfrom
xxx0624:dev

Conversation

@xxx0624

@xxx0624 xxx0624 commented Jan 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR is use force Service Connect/SC tasks on ECS Managed Instances to use /etc/resolv.conf from the host because Control Plane won't send down this information. Which is same as ECS on EC2.

Implementation details

Copy /etc/resolv.conf from host to SC tasks.

Testing

New tests cover the changes:

Yes

Description for the changelog

  • Enhancement - fix resolv.conf for SC tasks on ECS Managed Instances

Additional Information

Does this PR include breaking model changes? If so, Have you added transformation functions?

No
Does this PR include the addition of new environment variables in the README?
No

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@xxx0624
xxx0624 force-pushed the dev branch 2 times, most recently from 8fc4fa3 to 7fb7b13 Compare January 23, 2026 20:27
@xxx0624 xxx0624 changed the title Revert "Fixes bug in DNS configuration for SC-enabled tasks in BR. (… Use resolv.conf from host for Service Connect tasks on ECS managed instnaces Jan 23, 2026
@xxx0624
xxx0624 marked this pull request as ready for review January 23, 2026 22:11
@xxx0624
xxx0624 requested a review from a team as a code owner January 23, 2026 22:11

@JoseVillalta JoseVillalta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

if err != nil {
return errors.Wrap(err, "unable to create hostname file for netns")
}
err = m.createHostnameFileForDefaultNetNS()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question - why is this needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's copied from here although I can't think of any case where the file is missing. To be safe, I just added it. It will do nothing if it exists.

@xxx0624
xxx0624 merged commit 0abf17d into aws:dev Jan 27, 2026
44 of 46 checks passed
This was referenced Jan 29, 2026
alexcmms pushed a commit to alexcmms/amazon-ecs-agent that referenced this pull request Jan 30, 2026
alexcmms pushed a commit to alexcmms/amazon-ecs-agent that referenced this pull request Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants