2020-10-07 13:49:40 +05:00
|
|
|
#!/bin/bash -e
|
2019-12-13 09:48:00 -05:00
|
|
|
################################################################################
|
2023-11-22 21:49:23 +01:00
|
|
|
## File: install-aws-tools.sh
|
|
|
|
|
## Desc: Install the AWS CLI, Session Manager plugin for the AWS CLI, and AWS SAM CLI
|
2023-10-23 14:36:13 +02:00
|
|
|
## Supply chain security: AWS SAM CLI - checksum validation
|
2019-12-13 09:48:00 -05:00
|
|
|
################################################################################
|
|
|
|
|
|
2021-03-31 09:51:27 +03:00
|
|
|
# Source the helpers for use with the script
|
2020-07-02 19:29:50 +03:00
|
|
|
source $HELPER_SCRIPTS/os.sh
|
2021-03-31 09:51:27 +03:00
|
|
|
source $HELPER_SCRIPTS/install.sh
|
2019-12-13 09:48:00 -05:00
|
|
|
|
2023-11-29 20:25:29 +01:00
|
|
|
awscliv2_archive_path=$(download_with_retry "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip")
|
|
|
|
|
unzip -qq "$awscliv2_archive_path" -d /tmp
|
2022-06-16 11:09:45 +02:00
|
|
|
/tmp/aws/install -i /usr/local/aws-cli -b /usr/local/bin
|
2019-12-13 09:48:00 -05:00
|
|
|
|
2023-11-29 20:25:29 +01:00
|
|
|
smplugin_deb_path=$(download_with_retry "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb")
|
2024-05-29 13:43:07 +02:00
|
|
|
apt-get install "$smplugin_deb_path"
|
2020-07-08 10:30:15 +03:00
|
|
|
|
2023-10-23 14:36:13 +02:00
|
|
|
# Download the latest aws sam cli release
|
2023-11-29 20:25:29 +01:00
|
|
|
aws_sam_cli_archive_name="aws-sam-cli-linux-x86_64.zip"
|
2023-12-25 19:47:58 +01:00
|
|
|
sam_cli_download_url=$(resolve_github_release_asset_url "aws/aws-sam-cli" "endswith(\"$aws_sam_cli_archive_name\")" "latest")
|
|
|
|
|
aws_sam_cli_archive_path=$(download_with_retry "$sam_cli_download_url")
|
2023-10-23 14:36:13 +02:00
|
|
|
|
|
|
|
|
# Supply chain security - AWS SAM CLI
|
2023-12-25 19:47:58 +01:00
|
|
|
aws_sam_cli_hash=$(get_checksum_from_github_release "aws/aws-sam-cli" "${aws_sam_cli_archive_name}.. " "latest" "SHA256")
|
2023-11-29 20:25:29 +01:00
|
|
|
use_checksum_comparison "$aws_sam_cli_archive_path" "$aws_sam_cli_hash"
|
2023-10-23 14:36:13 +02:00
|
|
|
|
|
|
|
|
# Install the latest aws sam cli release
|
2023-11-29 20:25:29 +01:00
|
|
|
unzip "$aws_sam_cli_archive_path" -d /tmp
|
2021-05-17 21:55:32 +03:00
|
|
|
/tmp/install
|
|
|
|
|
|
2020-12-29 12:04:25 +05:00
|
|
|
invoke_tests "CLI.Tools" "AWS"
|