Skip to content

chore: Updates package aws-sdk-go to aws-sdk-go-v2 - follow up#1491

Merged
maastha merged 11 commits intomasterfrom
CLOUDP-339863-aws-sdk-v2-2
Dec 1, 2025
Merged

chore: Updates package aws-sdk-go to aws-sdk-go-v2 - follow up#1491
maastha merged 11 commits intomasterfrom
CLOUDP-339863-aws-sdk-v2-2

Conversation

@maastha
Copy link
Copy Markdown
Collaborator

@maastha maastha commented Nov 27, 2025

Proposed changes

Jira ticket: CLOUDP-339863

This PR is a follow-up to #1467

Link to any related issue(s):

Type of change:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as
    expected)
  • This change requires a documentation update
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Manual QA performed:

  • cfn invoke for each of CRUDL/cfn test
  • Updated resource in example
  • Published to AWS private registry
  • Used the template in example to create and update a stack in AWS
  • Deleted stack to ensure resources are deleted
  • Created multiple resources in same stack
  • Validated in Atlas UI
  • Included screenshots

Required Checklist:

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • For CFN Resources: I have released by changes in the private registry and proved by change
    works in Atlas

Further comments

@maastha maastha changed the title chore: Updates part 2 Cloudp 339863 aws sdk v2 2 chore: Updates package aws-sdk-go to aws-sdk-go-v2 - follow up Nov 29, 2025
@mongodb mongodb deleted a comment from semgrep-code-mongodb Bot Nov 29, 2025
@maastha maastha marked this pull request as ready for review November 29, 2025 05:01
@maastha maastha requested a review from a team as a code owner November 29, 2025 05:01
Copilot AI review requested due to automatic review settings November 29, 2025 05:01
@maastha
Copy link
Copy Markdown
Collaborator Author

maastha commented Nov 29, 2025

Organization contract test failure is flaky, this has been validated locally.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR completes the migration from AWS SDK Go v1 (aws-sdk-go) to AWS SDK Go v2 (aws-sdk-go-v2) across CloudFormation resources. The changes update import paths, API call patterns, and error handling to align with SDK v2 conventions.

Key Changes:

  • Updated AWS SDK imports from v1 to v2 across all resource handlers
  • Modified API calls to use context-based patterns (e.g., CreateSecret(context.Background(), input))
  • Converted error code handling from constants to string conversions (string(types.HandlerErrorCode...))
  • Updated helper utility functions for AWS service client creation

Reviewed changes

Copilot reviewed 53 out of 54 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
cfn-resources/x509-authentication-database-user/cmd/resource/resource.go Updated error handling to use SDK v2 types and refined nil pointer checks
cfn-resources/util/secrets/secret_manager.go Migrated AWS Secrets Manager client initialization to SDK v2 with context support
cfn-resources/util/aws/utils.go Refactored EC2 client creation and VPC endpoint operations for SDK v2 compatibility
cfn-resources/trigger/cmd/resource/resource.go Replaced SDK v1 string utilities with SDK v2 equivalents
cfn-resources/search-index/cmd/resource/resource.go Updated error codes and operation status handling to SDK v2 patterns
cfn-resources/profile/profile.go Added documentation explaining SDK v2 credential handling in CloudFormation context
cfn-resources/private-endpoint/cmd/resource/steps/awsvpcendpoint/aws_vpc_endpoint.go Migrated EC2 VPC endpoint operations to SDK v2
cfn-resources/go.mod Reorganized dependencies to properly reflect SDK v2 as primary dependency
Multiple test shell scripts Fixed indentation inconsistencies in shell scripts
Multiple resource handlers Systematically converted error codes to SDK v2 string format
Comments suppressed due to low confidence (1)

cfn-resources/online-archive/test/cfn-test-create-inputs.sh:1

  • The --mdbVersion 5.0 parameter was removed from the cluster creation command. If a specific MongoDB version is required for testing, this parameter should be retained to ensure consistent test environments.
#!/usr/bin/env bash

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cfn-resources/search-index/test/cfn-test-create-inputs.sh
Comment thread cfn-resources/ldap-verify/test/cfn-test-create-inputs.sh
Comment thread cfn-resources/global-cluster-config/test/cfn-test-create-inputs.sh
Comment thread cfn-resources/cloud-backup-snapshot/test/cfn-test-create-inputs.sh
Comment thread cfn-resources/cloud-backup-schedule/test/cfn-test-create-inputs.sh
Comment thread cfn-resources/serverless-private-endpoint/cmd/resource/resource.go Outdated
Comment thread cfn-resources/federated-settings-org-role-mapping/cmd/resource/resource.go Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@manupedrozo
Copy link
Copy Markdown
Collaborator

manupedrozo commented Dec 1, 2025

Not merging #1495 and #1496 to avoid conflicts in this PR

@maastha maastha added this pull request to the merge queue Dec 1, 2025
Merged via the queue into master with commit 67e3d4f Dec 1, 2025
39 of 40 checks passed
@maastha maastha deleted the CLOUDP-339863-aws-sdk-v2-2 branch December 1, 2025 15:40
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.

5 participants