-
Notifications
You must be signed in to change notification settings - Fork 612
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
Migrate ecs-init to aws-sdk-go-v2 #4372
Conversation
d41ff6d
to
f6ce1c5
Compare
f6ce1c5
to
85a28b9
Compare
@@ -0,0 +1,76 @@ | |||
package awsrulesfn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This go generate
copies this AWS SDK file from vendor into our package.
@@ -0,0 +1,403 @@ | |||
// Code generated by endpoint/awsrulesfn/internal/partition. DO NOT EDIT. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This go generate
copies this AWS SDK file from vendor into our package.
2168662
to
76b1930
Compare
89894aa
to
e5f35ce
Compare
e5f35ce
to
1291ca2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks much for your work on this migration change!
1291ca2
to
3573727
Compare
3573727
to
6b18caa
Compare
Summary
Migrate the
ecs-init
module toaws-sdk-go-v2
becauseaws-sdk-go
will reach end of support on July 31, 2025.Implementation details
session.Session
toaws.Config
per the docs.ec2metadata.EC2Metadata
toimds.Client
and update client construction per the docs.s3manager.Downloader
tomanager.Downloader
per the docs.endpoints
package,EndpointResolver
andEndpointResolverV2
). The partition and region metadata needed byecs-init
is only available via the internalawsrulesfn
package.ecs-init
, usego generate
to copy over relevant SDK files [1][2] into anecs-init
package.endpoints.PartitionForRegion
toawsrulesfn.GetPartitionForRegion
, which is our own implementation ofgetPartition
. We do not usegetPartition
because it defaults to theaws
partition if it cannot find a match for the region.amazon-ecs-agent/ecs-init/config/common.go
Lines 141 to 143 in cf8c7a6
aws-sdk-go-v2
modules to go.mod inecs-init
.go mod tidy && go mod verify && go mod vendor
make gogenerate-init
Testing
ecs-init
RPM/DEB packages built from this PR. Installed the packages on EC2 instances running AL2, AL2023, and Ubuntu. Verified that Agent started/stopped/restarted when the systemdecs-init
service was started/stopped/restarted.New tests cover the changes: no
Description for the changelog
Migrate ecs-init to aws-sdk-go-v2.
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.