Make ecs-anywhere-install.sh IPv6-only compatible #4747
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This change makes ecs-anywhere-install.sh script compatible with IPv6-only environments. It now auto-detects if the instance is IPv6-only by looking at default IPv4 and IPv6 routes. An override option
--ip-compatibility ipv4|ipv6
is also provided so that users can turn off auto-detection if it's not working as expected.For IPv6-only environments, the script -
/etc/amazon/ssm/amazon-ssm-agent.json
with contents like below. These are dualstack endpoints of key SSM Agent dependencies as the current version of SSM Agent is not compatible with IPv6-only environments without such manual configuration.This is a temporary workaround until we have an SSM Agent version that is IPv6-only compatible out of the box.
Testing
Tested on CentOS 9 and Amazon Linux 2023 running in IPv6-only networks. The script correctly auto-detected IPv6-only environment on these instances and successfully registered the instance with ECS. Also tested that the new
--ip-compatibility
command line argument works as expected and overrides auto-detection.New tests cover the changes: NA
Description for the changelog
Enhancement: Make ecs-anywhere-install.sh compatible with IPv6-only environments
Additional Information
Does this PR include breaking model changes? If so, Have you added transformation functions?
Does this PR include the addition of new environment variables in the README?
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.