How to run AWS CLI commands based on AWS CLI Version in Bash
If you find yourself having the requirements to support both AWS CLI v1 and v2 simultaneously, then you can use the following conditional in Bash to only run the specific version required:
|
|
This can be useful for deploying to environments where you cannot guarantee the AWS CLI version installed. Such as distributed pipelines, or customer environments.