Skip to content

Commit

Permalink
feat(aws-tools): Verify integrity of downloaded file
Browse files Browse the repository at this point in the history
Follows the instructions on https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html to verify the ZIP file.
  • Loading branch information
akash1810 committed Nov 13, 2024
1 parent 083991c commit 0e5f661
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions roles/aws-tools/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
get_url: url=https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip dest=/tmp/awscliv2/awscliv2.zip
when: ansible_architecture == "x86_64"

# This key ID was obtained from https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
- name: [AWS CLI v2] Import AWS GPG Key
command: gpg --keyserver hkp://keys.openpgp.org --recv-keys A6310ACC4672475C

- name: [AWS CLI v2] Download signature (aarch64)
get_url: url=https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip.sig dest=/tmp/awscliv2/awscliv2.sig
when: ansible_architecture == "aarch64"

- name: [AWS CLI v2] Download signature (x86_64)
get_url: url=https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip.sig dest=/tmp/awscliv2/awscliv2.sig
when: ansible_architecture == "x86_64"

- name: [AWS CLI v2] Verify downloaded ZIP file
command: gpg --verify /tmp/awscliv2/awscliv2.sig /tmp/awscliv2/awscliv2.zip

- name: [AWS CLI v2] Extract
command: unzip -o /tmp/awscliv2/awscliv2.zip -d /tmp/awscliv2

Expand Down

0 comments on commit 0e5f661

Please sign in to comment.