COmplete Project :
The first elements that need to be created are the S3
bucket and the SQS queue. These elements are connected together because the queue should be notified
when someone uploads any file to S3.
You have prepared the requirements and now you're ready to implement them in Terraform.
Objectives
[login to view URL] should be an S3 bucket referenced in Terraform as bucket and named “upload-bucket” . The ACL
should be private.
2. There should be an SQS queue referenced in Terraform as queue and named “upload-queue” .
[login to view URL] above queue should have a delay specified as 60 seconds, a max message size of 8kB, should
discard messages after 48 hours and should wait for up to 15 seconds for messages to be received.
[login to view URL] should be an IAM policy document created as Terraform “data”, referenced as
“iam_notify_policy_doc”, which should describe the policy that will be used by the bucket notification
hook to post messages to the queue, or you can use EOF expression in policy and omit this step.
5. The above document should contain one statement with id equal to 1.
6. The above statement should work only for “upload-bucket” and it should be tested by checking if the
source ARN matches.
7. The above statement should work only on upload-queue and it should allow messages to be sent to it.
8. The above statement should use the aws type of principal with identifiers set to * .
9. The above document should be used to create the upload-queue policy referenced in Terraform as
“notify-policy” . You may as well use inline policy implementing the same thing instead of using policy
document.
10. Finally, bucket notification should be enabled (referenced in Terraform as “bucket_notif”) to send a
message to upload-queue when an object is created in “upload-bucket” .
11. All references to other resources should be specified as Terraform identifiers, not as text.