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

Deprecate AWS SDK V1 Support in Plugin #2370

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Jan 8, 2025

Integration test logs

Logs
Add passing integration test logs here

Example query results

Results
> select vpc_id, region from aws_vpc
+-----------------------+----------------+
| vpc_id                | region         |
+-----------------------+----------------+
| vpc-097ed715748293054 | us-east-1      |
| vpc-070dcf85b82e773be | us-east-1      |
| vpc-0e8e31d2c03750f7a | ap-south-1     |
| vpc-0c34189d09770cdba | ap-south-1     |
| vpc-0308016b          | ap-south-1     |
| vpc-4438322d          | eu-west-3      |
| vpc-70304918          | eu-west-2      |
| vpc-3cb25e45          | eu-west-1      |
| vpc-9c488bf6          | eu-central-1   |
| vpc-3c053f5b          | ap-southeast-2 |
| vpc-4f8e9928          | ap-southeast-1 |
| vpc-00fedf50bbc180cf2 | me-central-1   |
| vpc-06d7cf161df3af8b1 | me-south-1     |
| vpc-0fbdaa2addb65b03f | ap-southeast-3 |
| vpc-2c591f44          | ca-central-1   |
| vpc-5c1ecc35          | eu-north-1     |
| vpc-09b59cc2e412311d4 | ap-northeast-3 |
| vpc-09b8899d28cd2afe0 | ap-northeast-3 |
| vpc-aa63a1c1          | us-east-2      |
| vpc-09afad0360e9e9e61 | us-east-2      |
| vpc-0884cc3e220be8370 | ap-east-1      |
| vpc-2ca9a84b          | ap-northeast-1 |
| vpc-039b616565a5c9b9b | af-south-1     |
| vpc-06c6156d          | ap-northeast-2 |
| vpc-0979059646e244b4c | eu-south-1     |
| vpc-0e41a09234cfac0c8 | us-west-2      |
| vpc-0eb0b270446015d85 | us-west-2      |
| vpc-69f9180f          | us-west-1      |
| vpc-04c48faffa7dc913f | ap-southeast-5 |
| vpc-33d8d954          | sa-east-1      |
+-----------------------+----------------+

@ParthaI ParthaI self-assigned this Jan 8, 2025
@ParthaI ParthaI marked this pull request as draft January 8, 2025 14:50
@ParthaI
Copy link
Contributor Author

ParthaI commented Jan 8, 2025

Why is This Change Required?

This PR addresses an issue where the plugin was unable to list resources in the region ap-southeast-5. The root cause was that the plugin relied on the deprecated AWS SDK V1 to make API calls, which did not include support for the ap-southeast-5 endpoint. By removing the dependency on AWS SDK V1 and transitioning to AWS SDK V2, the plugin now fully supports all regions, including ap-southeast-5.

For additional context, see the related discussion: GitHub Issue.

Note: While there is still an indirect reference to AWS SDK V1 (github.com/aws/aws-sdk-go) in the go.mod file because it is used by the Steampipe SDK (github.com/turbot/steampipe-plugin-sdk/v5 v5.10.4), the plugin code no longer uses AWS SDK V1 directly.


Changes Overview

  1. Removed Dependency on AWS SDK V1:
    The plugin no longer relies on AWS SDK V1 to fetch supported regions for services.

  2. Added a Script to Automate Endpoint Updates:

    • Introduced scripts/update_supported_service_endpoints.sh to fetch supported regions and generate files for endpoints and service IDs.
    • The generated files are:
      • awsSupportedEndpoints/endpoints_gen.go: Contains all supported regions for services.
      • awsSupportedEndpoints/service_id_gen.go: Contains service IDs that can be used to determine supported regions during new table additions.
  3. Data Source Updated to AWS SDK V2:

    • The supported regions and services are now fetched from the AWS SDK V2.

By transitioning to AWS SDK V2, the plugin ensures compatibility with new regions and endpoints, improving its overall functionality and reliability.

TODO:

  • Clean up the code to improve readability and maintainability.
  • Ensure the code passes all golangci-lint checks.
  • Perform additional testing to identify any potential breaking changes or issues that may arise.

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.

1 participant