#!/bin/bash

set -xeuo pipefail

aws --endpoint-url=http://localstack:4575 sns create-topic --name mission_created
aws --endpoint-url=http://localstack:4576 sqs create-queue --queue-name assign_mission
aws --endpoint-url=http://localstack:4575 sns subscribe --topic-arn arn:aws:sns:us-west-1:123456789012:mission_created --protocol sqs --notification-endpoint arn:aws:sqs:us-east-1:queue:assign_mission

aws --endpoint-url=http://localstack:4575 sns create-topic --name robot_vitals
aws --endpoint-url=http://localstack:4576 sqs create-queue --queue-name vitals_storage
aws --endpoint-url=http://localstack:4575 sns subscribe --topic-arn arn:aws:sns:us-west-1:123456789012:robot_vitals --protocol sqs --notification-endpoint arn:aws:sqs:us-east-1:queue:vitals_storage
