Problem
After upgrading Terraform Enterprise to version v202305-1 or later, runs that use the local-exec provisioner with command = "aws" fail with the error:
Exit Status: 127. Output: /bin/sh:aws: not found.
Cause
According to the v202304-1 (692) release notes, Terraform Build Workers were deprecated and removed in Terraform Enterprise v202305-1. The new base image for executing Terraform runs, hashicorp/tfc-agent, does not include the AWS CLI executable by default.
Solution
Build a Custom Agent Image
To guarantee aws CLI availability for your runs, you must build a custom agent image with the AWS CLI installed.
The article, How to add AWS, GCP, and Azure CLI to your custom tfc-agent image, details this process.