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

Upgrade AWS SDK for Go from V1 to V2 #78

Merged
merged 7 commits into from
Oct 8, 2023
Merged

Conversation

snaka
Copy link
Contributor

@snaka snaka commented Sep 18, 2023

Overview

This Pull Request aims to upgrade the version of the AWS SDK for Go from V1 to V2.

Changes

  • Updated the AWS SDK for Go dependency from V1 to V2.
  • Refactored relevant code to be compatible with the V2 SDK changes.
  • Fixed any deprecated methods and ensured the application's functionality remains consistent.

Main changes from V1 to V2

Changes Made with Uncertainty

  • I'm not confident that replacing session.NewSessionWithOptions() with config.LoadDefaultConfig() maintains equivalent behavior to the original. ( However, as far as I have confirmed, it seems to work the same way, so there may not be a problem.)

Testing

The following has been tested

  • Unit test succeeded.
  • Verified that the subcommands apply, dump, run, and diff can be executed.

Behavior Incompatibility

  • dump now always includes the propagateTag when retrieving remote Rule information.
    • This means that propagateTag: "" will be output as a diff if propagateTag is not explicitly specified in config.yaml.
    • This behavior has the same result when displaying differences with apply or diff.
    • To solve this problem, it is necessary to change the way config default values are handled, which is out of the scope of this PR. ( I think it would be better to address this in a another PR).

The type of `r.Rules` has been changed from pointer type to value type
since SDK V2.

When a value is retrieved from value type using `for ... range`, the
pointer of the loop variable that stores the value is fixed.

That causes the problem that all elements of slice eventually refer to
the same pointer.
To avoid that problem, change the base of slice from pointer type to
value type.
@snaka snaka marked this pull request as draft September 18, 2023 08:31
@snaka snaka marked this pull request as ready for review September 18, 2023 09:14
@Songmu Songmu added the minor label Oct 8, 2023
@Songmu Songmu merged commit 1742b7a into Songmu:main Oct 8, 2023
6 checks passed
@github-actions github-actions bot mentioned this pull request Oct 8, 2023
@Songmu
Copy link
Owner

Songmu commented Oct 8, 2023

Thank you. Released as v0.11.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants