Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Adding vpc subnets variables #165

Merged
merged 3 commits into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions aws/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ AWS ?= $(shell echo $$(if [ "$(LINUX_ARCH)" = "arm64" ]; then echo "$(AWS_ARM)";
CMD_AWS_LOGS_TAIL = @$(AWS) logs tail $(SERVICE_NAME) --follow --format "short"
CMD_AWS_EC2_IMPORT_KEY_PAIR = @$(AWS) ec2 import-key-pair --key-name="$(EC2_KEY_PAIR_NAME)" --public-key-material="$(SSH_PUBLIC_KEY_BASE64)"

# VPC settings
VPC_PUBLIC_SUBNETS ?= $(shell $(AWS) ssm get-parameter --name "/$(ENV)/terraform-output" --with-decryption | $(JQ) -r '.Parameter.Value' | $(BASE64) -d | $(JQ) -r '.vpc_public_subnets.value')
VPC_PRIVATE_SUBNETS ?= $(shell $(AWS) ssm get-parameter --name "/$(ENV)/terraform-output" --with-decryption | $(JQ) -r '.Parameter.Value' | $(BASE64) -d | $(JQ) -r '.vpc_private_subnets.value')

# Getting OS|Linux info
OS_NAME ?= $(shell uname -s)
LINUX_OS_DISTRIB ?= $$(cat /etc/issue)
Expand Down
2 changes: 2 additions & 0 deletions main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ GOMPLATE ?= $(DOCKER) run --user "$(CURRENT_USER_ID):$(CURRENT_USERGROUP_ID)" \
-e TERRAFORM_STATE_REGION="$(TERRAFORM_STATE_REGION)" \
-e TERRAFORM_STATE_PROFILE="$(TERRAFORM_STATE_PROFILE)" \
-e TERRAFORM_STATE_DYNAMODB_TABLE="$(TERRAFORM_STATE_DYNAMODB_TABLE)" \
-e VPC_PUBLIC_SUBNETS="$(VPC_PUBLIC_SUBNETS)" \
-e VPC_PRIVATE_SUBNETS="$(VPC_PRIVATE_SUBNETS)" \
-e SHORT_SHA="$(SHORT_SHA)" \
-e COMMIT_MESSAGE="$(COMMIT_MESSAGE)" \
-e GITHUB_ACTOR="$(GITHUB_ACTOR)" \
Expand Down
2 changes: 2 additions & 0 deletions waypoint/templates/waypoint.wpvars.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ ec2_key_pair_name="{{ .Env.EC2_KEY_PAIR_NAME }}"
docker_image_tag="{{ .Env.TAG }}"
ssh_public_key="{{ .Env.SSH_PUBLIC_KEY }}"
namespace="{{ .Env.NAMESPACE }}"
vpc_private_subnets={{ .Env.VPC_PRIVATE_SUBNETS }}
vpc_public_subnets={{ .Env.VPC_PUBLIC_SUBNETS }}