Posts

Showing posts from May, 2023

AWS - S3 Replication

Image
In this post will see what is s3 replication and how to use it. Replication enables automatic, asynchronous copying of objects across Amazon S3 buckets.  Buckets that are configured for object replication can be owned by the same AWS account or by different accounts. You can replicate objects to a single destination bucket or to multiple destination buckets. The destination buckets can be in different AWS Regions or within the same Region as the source bucket. To automatically replicate new objects as they are written to the bucket, use live replication, such as Cross-Region Replication (CRR).   To replicate existing objects to a different bucket on demand, use S3 Batch Replication . To enable CRR, you add a replication configuration to your source bucket. The minimum configuration must provide the following: The destination bucket or buckets where you want Amazon S3 to replicate objects. An AWS Identity and Access Management (IAM) role that Amazon S3 can assum...

Terraform - Automation of S3 event notification to SNS

Image
  This is an automation of  https://rsinfomindss.blogspot.com/2023/04/aws-s3-bucket-event-notification.html via terraform. We will start below modules: 1) Creating an S3 bucket. 2) Creating SNS topics. 3) Creating an SNS topic subscription. 4) Creating S3 bucket notification - Event notification for all S3 events. While applying you may get 400 errors and it means IAM policy issue with SNS Publish on the S3 service. We will start with provider configuration. terraform {   required_providers {     aws = {       source   = "hashicorp/aws"       #version = "~> 3.21" # Optional but recommended in production     }   } } provider "aws" {     region = "us-east-1"   } # Creating a S3 bucket module "s3_bucket" {     source = "terraform-aws-modules/s3-bucket/aws"     bucket = "rsinfominds"     versioning = {         enabled = true ...