TWITCH_CB_AWS = 989470033077
EPOCH = $(shell date +"%s")

setup:
	pip3 install awscli --upgrade

create_eventbus:
	python scripts/validate_aws.py ${TWITCH_CB_AWS}
	aws cloudformation create-stack --template-body file://eventbus/eventbus.yaml --cli-input-json file://eventbus/create_eventbus.json

update_eventbus:
	python scripts/validate_aws.py ${TWITCH_CB_AWS}
	aws cloudformation create-change-set --template-body file://eventbus/eventbus.yaml --cli-input-json file://eventbus/update_eventbus.json --change-set-name latest-${EPOCH}
	@echo "Apply updates at https://us-west-2.console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks?tab=changesets"

validate_template:
	aws cloudformation validate-template --template-body file://eventbus/eventbus.yaml
