Retrieve you temporary credentials from Learner's Lab. Enter your configuration when prompted:
aws configure
And set your session token:
aws configure set aws_session_token <YOUR-TEMP-SESSION-TOKEBN>
cd terraform
terraform init
terraform apply -auto-approve
Make sure you are in terraform folder
Get public ip address
aws ec2 describe-network-interfaces \
--network-interface-ids $(
aws ecs describe-tasks \
--cluster $(terraform output -raw ecs_cluster_name) \
--tasks $(
aws ecs list-tasks \
--cluster $(terraform output -raw ecs_cluster_name) \
--service-name $(terraform output -raw ecs_service_name) \
--query 'taskArns[0]' --output text
) \
--query "tasks[0].attachments[0].details[?name=='networkInterfaceId'].value" \
--output text
) \
--query 'NetworkInterfaces[0].Association.PublicIp' \
--output text
Send some requests:
curl http://<PUBLIC-IP-ADDRESS>:8080/albums
terraform destroy -auto-approve