
TWITCH_CE_HOST_AWS = "447680546588"
TWITCH_CE_HOST_DEV = "038504843107"
EPOCH = $(shell date +"%s")

.PHONY: validate
validate:
	python ../scripts/validate_aws.py ${TWITCH_CE_HOST_DEV}
	aws cloudformation validate-template --template-body file://network/network.yaml

# Network stack targets

.PHONY: update_production_network_stack
deploy_production_network_stack:
	python ../scripts/validate_aws.py ${TWITCH_CE_HOST_AWS}
	aws cloudformation create-change-set \
		--template-body file://network/network.yaml \
		--cli-input-json file://network/production.json \
		--change-set-name latest-${EPOCH}
	@echo "Apply updates from the AWS console. (CloudFormation > [Stack] > Change sets > latest-${EPOCH})"

.PHONY: update_staging_network_stack
deploy_staging_network_stack:
	python ../scripts/validate_aws.py ${TWITCH_CE_HOST_DEV}
	aws cloudformation create-change-set \
		--template-body file://network/network.yaml \
		--cli-input-json file://network/staging.json \
		--change-set-name latest-${EPOCH}
	@echo "Apply updates from the AWS console. (CloudFormation > [Stack] > Change sets > latest-${EPOCH})"

