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
PATH
variable.export PATH=~/.guard/bin:$PATH
Results: You have successfully installed Guard and set the
PATH
variable.-
(Optional) To confirm the installation of Guard, run the following command.
cfn-guard --version
The command returns the following output.
cfn-guard 3.0.0
-
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
PATH
environment variable, and run the following command.source $HOME/.cargo/env
-
With Cargo installed, run the following command to install Guard.
cargo install cfn-guard
Results: You have successfully installed Guard.
-
(Optional) To confirm the installation of Guard, run the following command.
cfn-guard --version
The command returns the following output.
cfn-guard 3.0.0
-
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-guard
Results: You have successfully installed Guard.
-
(Optional) To confirm the installation of Guard, run the following command.
cfn-guard --version
The command returns the following output.
cfn-guard 3.0.0
-