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

Migrate ECS client to aws-sdk-go-v2 #4447

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from

Conversation

tinnywang
Copy link
Contributor

@tinnywang tinnywang commented Dec 5, 2024

Summary

Migrate ECS client to aws-sdk-go-v2.

#4406 added our bespoke codegen'd aws-sdk-go-v2 ECS client. This PR integrates the v2 ECS client with Agent and removes all uses of our v1 ECS client.

Implementation details

In go.mod for the agent and ecs-agent modules,

  1. add a dependency ongithub.com/aws/aws-sdk-go-v2/service/ecs
  2. add a replace directive so that we use our bespoke ECS package instead of the official SDK package
replace github.com/aws/aws-sdk-go-v2/service/ecs => ../aws-sdk-go-v2/service/ecs

Update ECS client construction per the docs.

Replace all uses of our v1 ECS client with the v2 ECS client.

Update error handling to handle SDKv1 and SDKv2 errors. v1 error handling can be removed after all clients have been migrated to aws-sdk-go-v2. See the docs for more info on error handling in v2.

Rewrite the oneDayRetrier to be compatible with aws-sdk-go-v2 per the docs.

Testing

GitHub checks pass.

New tests cover the changes: no

Description for the changelog

Migrate ECS client toaws-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.

@tinnywang tinnywang force-pushed the aws-sdk-go-v2/ecs branch 2 times, most recently from 6b18859 to a1a9480 Compare December 6, 2024 08:34
@tinnywang tinnywang marked this pull request as ready for review December 6, 2024 18:06
@tinnywang tinnywang requested a review from a team as a code owner December 6, 2024 18:06
@tinnywang tinnywang force-pushed the aws-sdk-go-v2/ecs branch 2 times, most recently from 1c2d4b8 to 7d2a689 Compare December 10, 2024 11:19
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.

3 participants