generated from ministryofjustice/cloud-platform-terraform-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added consistent Makefile and .env file
In order to make the engineer's experience more consistent between projects the new standard Makefile has been added.
- Loading branch information
Stephen James
committed
Sep 28, 2023
1 parent
65d748e
commit a686f84
Showing
2 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export AWS_PROFILE=mojo-shared-services-cli | ||
export AWS_VAULT_PROFILE=mojo-shared-services-cli | ||
|
||
### ci ### | ||
export ENV=ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,57 @@ | ||
#!make | ||
include .env | ||
export | ||
|
||
fmt: | ||
aws-vault exec $$AWS_VAULT_PROFILE -- terraform fmt --recursive | ||
|
||
init: | ||
aws-vault exec $$AWS_VAULT_PROFILE -- terraform init | ||
|
||
workspace-list: | ||
aws-vault exec $$AWS_VAULT_PROFILE -- terraform workspace list | ||
|
||
workspace-select: | ||
aws-vault exec $$AWS_VAULT_PROFILE -- terraform workspace select $$ENV || \ | ||
aws-vault exec $$AWS_VAULT_PROFILE -- terraform workspace new $$ENV | ||
|
||
validate: | ||
aws-vault exec $$AWS_VAULT_PROFILE -- terraform validate | ||
|
||
plan-out: | ||
aws-vault exec $$AWS_VAULT_PROFILE -- terraform plan -no-color > $$ENV.tfplan | ||
|
||
plan: | ||
aws-vault exec $$AWS_VAULT_PROFILE -- terraform plan | ||
|
||
refresh: | ||
aws-vault exec $$AWS_VAULT_PROFILE -- terraform refresh | ||
|
||
output: | ||
aws-vault exec $$AWS_VAULT_PROFILE -- terraform output -json | ||
|
||
apply: | ||
terraform apply | ||
./scripts/ensure_cloudwatch_log_retention_policies.sh | ||
aws-vault exec $$AWS_VAULT_PROFILE -- terraform apply | ||
./scripts/ensure_cloudwatch_log_retention_policies.sh | ||
|
||
state-list: | ||
aws-vault exec $$AWS_VAULT_PROFILE -- terraform state list | ||
|
||
show: | ||
aws-vault exec $$AWS_VAULT_PROFILE -- terraform show -no-color | ||
|
||
# destroy: | ||
# aws-vault exec $$AWS_VAULT_PROFILE -- terraform destroy | ||
|
||
clean: | ||
rm -rf .terraform/ terraform.tfstate* | ||
|
||
get-secrets: | ||
aws-vault exec $$AWS_VAULT_PROFILE -- sh ./scripts/get_secrets.sh | ||
|
||
s3-audit: | ||
aws-vault exec $$AWS_VAULT_PROFILE -- sh ./scripts/s3_versioning_audit.sh | ||
|
||
.PHONY: | ||
fmt init workspace-list workspace-select validate plan-out plan \ | ||
refresh output apply state-list show destroy clean get-secrets s3-audit |