Migrate SSM client to AWS SDK Go V2 #4549
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 PR will migrate over the SSM client implementation and corresponding code that consumes it over to AWS SDK Go V2.
Implementation details
NewSSMClient
ofagent/ssm/factory/factory.go
:ssm.NewFromConfig
from AWS SDK Go V2Config
fromgithub.com/aws/aws-sdk-go-v2/config
in favor ofSession
fromgithub.com/aws/aws-sdk-go/aws/session
inNewSSMClient
error
in the case thatLoadDefaultConfig
fails*Updated all calls of
NewSSMClient
to reflect the changes mentioned beforeGetParameters
inagent/ssm/interface.go
to use the same one as in AWS SDK Go V2 -> https://github.com/aws/aws-sdk-go-v2/blob/64a2f067f475f9bb2129e792a9bc62bf658f9da2/service/ssm/api_op_GetParameters.go#L18-L31GetParameters
to reflect changes mentioned beforeGetParametersInput
andGetParametersOutput
to now use non-pointers for some of their struct fields as part of AWS SDK Go V2 migrationaws-sdk-go/aws
toaws-sdk-go-v2/aws
Testing
Manual testing:
FIPS testing
FIPs on agent prior to SSM V2 migration
FIPS after SSM V2
New tests cover the changes: yes
Description for the changelog
Enhancement - Migrate SSM client to AWS SDK Go V2
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.