Skip to content

[Feature Branch] Upgrade AWS SDK v2 library to the latest version#31224

Merged
sayden merged 82 commits intomainfrom
feature/xpack/aws/upgrade-library
Jul 22, 2022
Merged

[Feature Branch] Upgrade AWS SDK v2 library to the latest version#31224
sayden merged 82 commits intomainfrom
feature/xpack/aws/upgrade-library

Conversation

@sayden
Copy link
Copy Markdown
Contributor

@sayden sayden commented Apr 7, 2022

What does this PR do?

This PR upgrades the current AWS SDK library we use to the latest version. It should include all the latest fixes from AWS as well as many corrections in our code to keep working with it.

Consider this a feature branch where smaller areas of our code will be gradually integrated, like metricsets and inputs on different PR's.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

Status

  • Added changes required in Cloudwatch Input

Break down tasks for testing this PR

  • Metricbeat CloudWatch metricset to make sure metrics are collected correctly with Access keys authentication - @kaiyan-sheng
  • Metricbeat CloudWatch metricset to make sure metrics are collected correctly with credential profile name authentication - @girodav
  • Metricbeat CloudWatch metricset to make sure metrics are collected correctly with role arn authentication @kaiyan-sheng
  • Metricbeat EC2 metricset to make sure metadata is collected for EC2 - @girodav
  • Filebeat s3 input with SQS - @aspacca run the integration tests locally
  • Filebeat s3 input without SQS - @aspacca run the integration tests locally
  • Filebeat cloudwatch input @sayden (@aspacca run the integration tests locally)

@sayden sayden added the Team:Cloud-Monitoring Label for the Cloud Monitoring team label Apr 7, 2022
@sayden sayden requested a review from kaiyan-sheng April 7, 2022 19:39
@sayden sayden self-assigned this Apr 7, 2022
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Apr 7, 2022
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Apr 7, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-07-22T11:31:15.133+0000

  • Duration: 201 min 50 sec

Test stats 🧪

Test Results
Failed 0
Passed 24418
Skipped 2106
Total 26524

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@sayden sayden marked this pull request as ready for review April 13, 2022 07:03
@sayden sayden requested a review from a team as a code owner April 13, 2022 07:03
@cmacknz cmacknz removed the request for review from a team April 13, 2022 18:54
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jul 6, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feature/xpack/aws/upgrade-library upstream/feature/xpack/aws/upgrade-library
git merge upstream/main
git push upstream feature/xpack/aws/upgrade-library

@francescayeye
Copy link
Copy Markdown

@kaiyan-sheng the PR seems almost complete

I'd like to review the validity my initial comments: #31224 (comment) and #31224 (comment)

would you mind checking them?

thanks

Copy link
Copy Markdown

@francescayeye francescayeye left a comment

Choose a reason for hiding this comment

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

here how I implemented pagination error handling on the s3 objects listing:
https://github.com/elastic/beats/pull/31224/files#diff-c6357a5d68a965123a3b3dc3cbf0bddfe7a5628dceb5327885da33f1735a3facR158-R173

it might be too defensive, up to you if using the same pattern for the two paginators in this commit

in the case of s3 ListObjectsPaginator.NextPage() an error can be caused by !ListObjectsPaginator.HasMorePages(). we should never reach such state since the for loop would have already exited.

if the cwlogs LogEventsPaginator.NextPage() and DescribeLogGroupsPaginator.NextPage() do not have an error caused by !HasMorePages() no need of the extra if

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jul 11, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feature/xpack/aws/upgrade-library upstream/feature/xpack/aws/upgrade-library
git merge upstream/main
git push upstream feature/xpack/aws/upgrade-library

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jul 11, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feature/xpack/aws/upgrade-library upstream/feature/xpack/aws/upgrade-library
git merge upstream/main
git push upstream feature/xpack/aws/upgrade-library

@kaiyan-sheng
Copy link
Copy Markdown
Contributor

kaiyan-sheng commented Jul 11, 2022

in the case of s3 ListObjectsPaginator.NextPage() an error can be caused by !ListObjectsPaginator.HasMorePages(). we should never reach such state since the for loop would have already exited.

if the cwlogs LogEventsPaginator.NextPage() and DescribeLogGroupsPaginator.NextPage() do not have an error caused by !HasMorePages() no need of the extra if

I checked the aws-sdk-go-v2, both FilterLogEventsPaginator.NextPage() and DescribeLogGroupsPaginator.NextPage() also check for error caused by !HasMorePages(). But I don't think we absolutely require the additional check for !paginator.HasMorePages() since that would never be true with the condition of the for loop right above. Do you think it's required?

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jul 13, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feature/xpack/aws/upgrade-library upstream/feature/xpack/aws/upgrade-library
git merge upstream/main
git push upstream feature/xpack/aws/upgrade-library

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jul 20, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feature/xpack/aws/upgrade-library upstream/feature/xpack/aws/upgrade-library
git merge upstream/main
git push upstream feature/xpack/aws/upgrade-library

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jul 21, 2022

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feature/xpack/aws/upgrade-library upstream/feature/xpack/aws/upgrade-library
git merge upstream/main
git push upstream feature/xpack/aws/upgrade-library

@sayden sayden merged commit f5ff0a9 into main Jul 22, 2022
@kaiyan-sheng kaiyan-sheng deleted the feature/xpack/aws/upgrade-library branch July 22, 2022 15:44
@francescayeye
Copy link
Copy Markdown

/test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team:Cloud-Monitoring Label for the Cloud Monitoring team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants