This Terraform script sets up an AWS S3 bucket and an SNS topic for user updates. When a new object is created in the S3 bucket, an email notification is sent to the specified address.
- Terraform: Ensure it's installed.
- AWS Credentials: Set up AWS credentials.
-
Clone the Repository:
git clone <repository-url> cd <repository-directory>
-
Update Configuration: Open
main.tf
and replace"[email protected]"
with your email address in theaws_sns_topic_subscription
section. -
Run Terraform:
terraform init terraform apply
-
Clean Up (Optional):
terraform destroy
-
S3 Bucket:
- Name:
my-tf-test-bucket-aayush
- Name:
-
S3 Bucket Notification:
- Triggers SNS notifications on new object creation.
-
SNS Topic:
- Name:
user-updates-topic
- Name:
-
SNS Topic Subscription:
- Email:
"[email protected]"
- Email:
-
SNS Topic Policy:
- Allows S3 to publish messages to the SNS topic.
- Ensure Terraform and AWS CLI are configured.
- Update AWS credentials and configurations in
main.tf
as needed.