The goals of this project is as follows:
- Understand the overhead involved with streaming multimedia (MM) data from IoT sensors
- Understand how AWS IoT Core handles MM streaming
- Gain a deeper understanding of Terraform
- Install Terraform
- Sign up for AWS, navigate to Security Credentials and create an access key
- Create a
.env
and add the followingAWS_ACCESS_KEY_ID=<access-key-id> AWS_SECRET_ACCESS_KEY=<secret-access-key>
- Replace
tf/s3.tf#3
with your own bucket name - Initialize Terraform
terraform init
make setup
terraform apply --auto-approve
Reference deploy
ruby client.rb subscribe <subscriber-count> <log-id>
Example:
ruby client.rb subscribe 100 100_big_2
ruby client.rb publish <file-path> <log-id>
Example:
ruby client.rb publish fixtures/big_2.jpg 100_big_2
Note:
- Reference the files in
/fixtures
- Ensure that the
log_id
used here is the same as thelog_id
used in the step 2
ruby statistics_calculator.rb <log-id>
Example:
ruby statistics_calculator.rb 100_big_2
Note:
- Ensure that the
log_id
used here is the same as thelog_id
used in the step 2
aws s3api delete-object --bucket $bucket --key <key-to-delete>
terraform destroy --auto-approve
For good measure, ensure that resources
in terraform.tfstate
is an empty list.
bucket=<your-bucket-name>
aws s3api list-objects --bucket $bucket | jq -r '.Contents[].Key'
Identify the latest object based on the key name.
aws s3api get-object --bucket $bucket --key <key-from-previous-step> example.png
aws iot-data publish \
--topic "iot-core-topic" \
--cli-binary-format raw-in-base64-out \
--payload fileb://example.png \
--region "us-east-1"