Skip to content

Instantly share code, notes, and snippets.

@ScriptAutomate
Last active August 27, 2021 21:43
Show Gist options
  • Save ScriptAutomate/7b8574023ef9a5994a9172c5a65cb891 to your computer and use it in GitHub Desktop.
Save ScriptAutomate/7b8574023ef9a5994a9172c5a65cb891 to your computer and use it in GitHub Desktop.
Install SAM (Serverless Application Model) CLI via Salt State
{% set user_name = salt['pillar.get']('common:lookup:user') %}
aws-sam-cli-extract:
archive.extracted:
- name: /home/{{ user_name }}/Downloads/aws-sam-cli
- if_missing: /home/{{ user_name }}/Downloads/aws-sam-cli/install
- archive_format: zip
- enforce_toplevel: false
- source: https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip
- user: {{ user_name }}
- group: {{ user_name }}
- skip_verify: True
aws-sam-cli-install:
cmd.run:
- name: /home/{{ user_name }}/Downloads/aws-sam-cli/install
- creates: /usr/local/bin/sam
aws-sam-cli-disable-telemetry:
file.append:
- name: /home/{{ user_name }}/.bashrc
- text: |
# Disable aws sam cli telemetry
export SAM_CLI_TELEMETRY=0
aws-sam-cli-update:
cmd.run:
- name: /home/{{ user_name }}/Downloads/aws-sam-cli/install --update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment