Installing Guard for Linux and macOS
You can install AWS CloudFormation Guard for Linux and macOS by using the pre-built release binary, Cargo, or through Homebrew.
Install Guard from a pre-built release binary
Use the following procedure to install Guard from a pre-built binary.
- 
    
Open a terminal, and run the following command.
curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/aws-cloudformation/cloudformation-guard/main/install-guard.sh | sh - 
    
Run the following command to set your
PATHvariable.export PATH=~/.guard/bin:$PATHResults: You have successfully installed Guard and set the
PATHvariable.- 
      
(Optional) To confirm the installation of Guard, run the following command.
cfn-guard --versionThe command returns the following output.
cfn-guard 3.1.2
 
 - 
      
 
Install Guard from Cargo
Cargo is the Rust package manager. Complete the following steps to install Rust, which includes Cargo. Then, install Guard from Cargo.
- 
    
Run the following command from a terminal, and follow the onscreen instructions to install Rust.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh- 
      
(Optional) For Ubuntu environments, run the following command.
sudo apt-get update; sudo apt install build-essential 
 - 
      
 - 
    
Configure your
PATHenvironment variable, and run the following command.source $HOME/.cargo/env - 
    
With Cargo installed, run the following command to install Guard.
cargo install cfn-guardResults: You have successfully installed Guard.
- 
      
(Optional) To confirm the installation of Guard, run the following command.
cfn-guard --versionThe command returns the following output.
cfn-guard 3.1.2
 
 - 
      
 
Install Guard from Homebrew
Homebrew is a package manager for macOS and Linux. Complete the following steps to install Homebrew. Then, install Guard from Homebrew.
- 
    
Run the following command from a terminal, and follow the onscreen instructions to install Homebrew.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - 
    
With Homebrew installed, run the following command to install Guard.
brew install cloudformation-guardResults: You have successfully installed Guard.
- 
      
(Optional) To confirm the installation of Guard, run the following command.
cfn-guard --versionThe command returns the following output.
cfn-guard 3.1.2
 
 -