Skip to main content

Command-line tool to lint and modify bash scripts that use AWS CLI v1 to prevent breakage from changes introduced in AWS CLI v2.

Project description

AWS CLI v1-to-v2 Migration Tool

A command-line tool that lints bash scripts for AWS CLI v1 usage and updates them to avoid breaking changes introduced in AWS CLI v2. Not all breaking changes can be detected statically, thus not all of them are supported by this tool.

For a full list of the breaking changes introduced with AWS CLI v2, see Breaking changes between AWS CLI version 1 and AWS CLI version 2.

Jump to:

Installation

Most users should install AWS CLI v1-to-v2 Migration Tool via pip in a virtualenv:

$ python3 -m pip install aws-cli-migrate

or, if you are not installing in a virtualenv, to install globally:

$ sudo python3 -m pip install aws-cli-migrate

or for your user:

$ python3 -m pip install --user aws-cli-migrate

If you have the aws-cli-migrate package installed and want to upgrade to the latest version, you can run:

$ python3 -m pip install --upgrade aws-cli-migrate

This will install the aws-cli-migrate package as well as all dependencies.

Usage

Dry-run mode (default)

Display issues without modifying the script:

migrate-aws-cli --script upload_s3_files.sh

Auto-fix mode

Automatically update the input script:

migrate-aws-cli --script upload_s3_files.sh --fix

Optionally, supply an output path to write the updated script, rather than updating the input bash script:

migrate-aws-cli --script upload_s3_files.sh --output upload_s3_files_v2.sh --fix

Interactive mode

Review and accept/reject each change individually:

migrate-aws-cli --script upload_s3_files.sh --interactive --output upload_s3_files_v2.sh

In interactive mode, you can:

  • Press y to accept the current change
  • Press n to skip the current change
  • Press a to accept all findings with the current type
  • Press r to reject all findings with the current type
  • Press u to accept all remaining changes
  • Press s to save and exit
  • Press q to quit without saving

Supported Breaking Changes

The AWS CLI v1-to-v2 Migration Tool lints bash scripts for usage of AWS CLI v1 commands that are likely to face breaking changes after upgrading to AWS CLI v2. Additionally, the migration tool can automatically modify bash scripts to prevent breakage caused by breaking changes that would be caused by upgrading to AWS CLI v2.

Using the migration tool does not guarantee that all breaking changes will be fully prevented. We recommend that users upgrading from AWS CLI v1 to AWS CLI v2 read Breaking changes between AWS CLI version 1 and AWS CLI version 2 in New features and changes in the AWS CLI version 2.

The table below describes which breaking changes the migration tool can detect or automatically fix.

Breaking Change Detection Auto-fix
Environment variable added to set text file encoding ❌ No ❌ No
Binary parameters are passed as base64-encoded strings by default ✅ Yes ✅ Yes
Improved Amazon S3 handling of file properties and tags for multipart copies ✅ Yes ✅ Yes
No automatic retrieval of http:// or https:// URLs for parameters ❌ No ❌ No
Pager used for all output by default ✅ Yes ✅ Yes
Timestamp output values are standardized to ISO 8601 format ❌ No ❌ No
Improved handling of CloudFormation deployments that result in no changes ✅ Yes ✅ Yes
Changed default behavior for Regional Amazon S3 endpoint for us-east-1 Region ❌ No ❌ No
Changed default behavior for Regional AWS STS endpoints ❌ No ❌ No
ecr get-login removed and replaced with ecr get-login-password ✅ Yes ❌ No
AWS CLI version 2 support for plugins is changing ❌ No ❌ No
Hidden alias support removed ✅ Yes ✅ Yes
The api_versions configuration file setting is not supported ❌ No ❌ No
AWS CLI version 2 uses only Signature v4 to authenticate Amazon S3 requests ❌ No ❌ No
AWS CLI version 2 is more consistent with paging parameters ✅ Yes ❌ No
AWS CLI version 2 provides more consistent return codes across all commands ❌ No ❌ No

Backwards Compatibility Policy

The AWS CLI v1-to-v2 Migration Tool does not guarantee backwards compatibility. In particular, this tool may face breaking changes in any future versions.

See CHANGELOG.md for details on the changes introduced in each update of the AWS CLI v1-to-v2 Migration Tool.

Contributing

If you'd like to contribute to the project, please see our Contributing Guide for development setup instructions and guidelines.

Getting Help

The best way to interact with our team is through GitHub. You can open an issue and choose the templates for the AWS CLI v1-to-v2 Migration Tool.

If you have a support plan with AWS Support, you can also create a new support case.

Please check for open similar issues before opening another one.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws_cli_migrate-1.0.0.tar.gz (27.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aws_cli_migrate-1.0.0-py3-none-any.whl (28.9 kB view details)

Uploaded Python 3

File details

Details for the file aws_cli_migrate-1.0.0.tar.gz.

File metadata

  • Download URL: aws_cli_migrate-1.0.0.tar.gz
  • Upload date:
  • Size: 27.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for aws_cli_migrate-1.0.0.tar.gz
Algorithm Hash digest
SHA256 60143f017d7c19c2402e4cabcdd92e51b3ef9e4c8fa4966638dcdbe80b82a9ac
MD5 984f42987dc1cc52e5b2d0c069fe2962
BLAKE2b-256 b2eb1e075a8fc2b9f840aaec486533a94c48250c4133b2a5aeaad285e00d3218

See more details on using hashes here.

File details

Details for the file aws_cli_migrate-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aws_cli_migrate-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4fb27533406f03b35171f2671b3fc0125349dcac04cce2339808aedb5cad20b4
MD5 2b09367e5b939037e7f951117c1f61ed
BLAKE2b-256 8a4a375cd0014031ef7accae07bf475e614de0c5efba89cac51d6cfe0bbff520

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page