This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
lambda-boilerplate/script/plan

18 lines
497 B
Text
Raw Permalink Normal View History

#!/usr/bin/bash
# Generates a plan for the given project.
#
# The project name is expected to be passed as an environment variable,
# i.e. PROJECT=app . script/plan
(
source $(dirname $0)/../.config
PROJECT_ROOT=$(realpath $BOOTSTRAP_ROOT/infrastructure/$PROJECT)
2022-10-09 16:42:18 +00:00
DEFAULT_ENVNAME="dev-$USER"
cd $PROJECT_ROOT
terraform init
2022-10-09 16:42:18 +00:00
terraform plan --var-file $VARIABLES_PATH -var="env_name=${ENV_NAME:-$DEFAULT_ENVNAME}" -var="commit_sha=$(git log --pretty=format:'%H' -n 1)"
)