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

chore: Upgrade to aws-sdk-go-v2 #481

Merged
merged 3 commits into from
May 14, 2024
Merged

chore: Upgrade to aws-sdk-go-v2 #481

merged 3 commits into from
May 14, 2024

Conversation

bhavanki
Copy link
Contributor

@bhavanki bhavanki commented Apr 23, 2024

This is a major update to chamber's support for the S3, SSM, and Secrets Manager store implementations. Every effort was made to preserve functionality, but there is one gap.

The v2 SDK does not expose a retryer field for a minimum throttle delay, so that argument is currently ignored when constructing new SSM stores. Support for the delay will be addressed later.

The v2 SDK does not offer "iface" interfaces for the various clients, so instead interfaces tailored to what chamber uses are defined. For testing, these new interfaces are mocked, and mock types are generated using github.com/matryer/moq. You don't need moq to use chamber or even to build it, but only if you are developing chamber and make a change to an API interface.

Also, old code in the SSM store implementation that allowed it to work without IAM permissions for ssm:GetParametersByPath has been eliminated. The permissions have been expected for a long time now.


Resolves #478.

This is a major update to chamber's support for the S3, SSM, and Secrets
Manager store implementations. Every effort was made to preserve
functionality, but there is one gap.

The v2 SDK does not expose a retryer field for a minimum throttle delay,
so that argument is currently ignored when constructing new SSM stores.
Support for the delay will be addressed later.

The v2 SDK does not offer "iface" interfaces for the various clients, so
instead interfaces tailored to what chamber uses are defined. For
testing, these new interfaces are mocked, and mock types are generated
using github.com/matryer/moq. You don't need moq to use chamber or even
to build it, but only if you are developing chamber and make a change to
an API interface.

Also, old code in the SSM store implementation that allowed it to work
without IAM permissions for ssm:GetParametersByPath has been eliminated.
The permissions have been expected for a long time now.
@bhavanki bhavanki requested a review from a team as a code owner April 23, 2024 18:29
@bhavanki bhavanki requested review from mckern, cdignam-segment and a team and removed request for a team April 23, 2024 18:30
@cdignam-segment cdignam-segment removed their request for review April 24, 2024 18:12
@erikdw
Copy link

erikdw commented May 1, 2024

FWIW, I've been running with this version of chamber for a week and I use it pretty often.

Copy link
Contributor

@mckern mckern left a comment

Choose a reason for hiding this comment

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

Gonna build this and put it through some functional tests but nothing jumps out at me.

.gitattributes Outdated Show resolved Hide resolved
@@ -32,7 +43,7 @@ dist/:

build: chamber

chamber:
chamber: $(SRC)
Copy link
Contributor

Choose a reason for hiding this comment

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

Double-checking intent: a change to any .go file in the repository will now mark the chamber target as out of date?

Copy link
Contributor Author

@bhavanki bhavanki May 3, 2024

Choose a reason for hiding this comment

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

That's the idea. I'm not wedded to this change, so if you have concerns, I'm happy to drop it.

store/awsapi.go Outdated Show resolved Hide resolved
@@ -265,28 +273,33 @@ func (s *SSMStore) ListServices(service string, includeSecretName bool) ([]strin

if s.usePaths {
describeParametersInput = &ssm.DescribeParametersInput{
MaxResults: aws.Int64(50),
ParameterFilters: []*ssm.ParameterStringFilter{
MaxResults: aws.Int32(50),
Copy link
Contributor

Choose a reason for hiding this comment

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

functional change or stylistic change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The v2 SDK changes the field type.

@mckern
Copy link
Contributor

mckern commented May 1, 2024

What're you thinking about for a version number on this? Clearly not a patch release but I'm not sure it's a major. Minor?

Co-authored-by: Ryan McKern <344926+mckern@users.noreply.github.com>
@bhavanki
Copy link
Contributor Author

bhavanki commented May 3, 2024

What're you thinking about for a version number on this? Clearly not a patch release but I'm not sure it's a major. Minor?

At least minor, for sure. But, I was thinking we could use this disruption as an opportunity to remove some deprecated features. For example, in this commit I removed some old workaround code for a IAM permission that became required in the distant past. Those removals would count as breakage, meriting a major release.

asaf-erlich
asaf-erlich previously approved these changes May 3, 2024
@mckern
Copy link
Contributor

mckern commented May 3, 2024

Those removals would count as breakage, meriting a major release.

Ah, if a major version is on the table then do we want to talk about what else might go into it and hold off releasing after this is merged?

@bhavanki
Copy link
Contributor Author

bhavanki commented May 3, 2024

Those removals would count as breakage, meriting a major release.

Ah, if a major version is on the table then do we want to talk about what else might go into it and hold off releasing after this is merged?

Definitely! There's at least one other thing I recall spotting that could be dropped, I forget what it is at the moment. Also, there are some improvements that can follow from this PR, like how contexts are handled (oh, and figuring out what to do about the minimum throttle delay setting). I don't see any problem letting this update sit unreleased on master while we do some spring cleaning.

@bhavanki bhavanki merged commit cb8c837 into master May 14, 2024
12 checks passed
@bhavanki bhavanki deleted the aws-sdk-go-v2 branch May 14, 2024 16:25
This pull request was closed.
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.

Update to aws-sdk-go-v2
4 participants