Skip to main content

Posts

Showing posts from April, 2018

AWS S3: CROSS REGION REPLICATION

Cross-region replication is a bucket-level configuration that enables automatic, asynchronous copying of objects across buckets in different AWS Regions.It helps to replicate data of one bucket with another bucket in another region.For cross region replication to takes place versioning should be enabled in both buckets.Consider we have a bucket named mytestbuck333 on Us West(Oregon) region.Now we will create another bucket named new-bucket333 in Asia Pacific(Mumbai) region with versioning enabled. Now go inside bucket mytestbuck333.From Management > Replicatio n > add rul e.Here we can select weather we want to replicate all contents of bucket or a pericular object.Select as per our need.Here we are selecting whole bucket.Then click next. Here select the name of bucket to which we want to replicate and click next. Now select IAM role .As we have not created any role select create new role and click next and then save.   Now go inside our new

AWS S3: LIFECYCLE MANAGEMENT

Lifecycle management is and important feature available for s3 buckets.Using that we can move the contents in s3 to IA s3, glaciers or even delete it after a particular period of time that we set.In this scenerio we will create a life cycle management policy for an s3 bucket with versioning enabled.For that first go to our bucket. From Management > Add lifecycle rule On the window that appears give the name of our life cycle management rule under rule name.If we want to apply the policy for particular object in bucket we can also mention it under prefix.Then click next. In this window we will give details about transitions.We can see current version and previous version options there since we have versioning enabled.Here first we will set policy for current version.We will set 30 days for transition to IA and 60 to glaci er.It means that after 30 days the content will moves to IA and again after 30 days it will moves to glacier.Similarly set it for previous versions.Th

AWS S3: VERSIONING

Versioning is an important feature provided by s3.We can enable versioning while creating an s3 bucket.For that from aws dashboard > S3 > Create bucket On first section appears give name of the bucket.The name should be globally unique.Also specify region.Then click next.On the next step activate the properties we want.As we want to enable versioning enable that and click next.On next window we have to set permissions.Here under manage public permissions give public read access to bucket and then click next and create bucket.     We can see our bucket is created.Now we want to upload a file to bucket.Open notepad and make a sample file and save it.Now go inside or bucket and upload it. This is my sample file.Now to upload it go inside the bucket and click upload . Click on add files and select the file we saved earlier and click next.No we want to set permissions for that. Select grant public read access to the object under manage public per

CONTINUOUS INTEGRATION WITH GIT AND JENKINS USING GIT WEBHOOK

Assume we have jenkins and maven running on same server.Consider that we want to run a job each time when developer is commiting a code to our git hub repository. For that we can make use of webhook feature provided by git. Assume that we have installed github plugin and maven integration plugin. First go to our jenkins server. From Dashboard > New item . Now give the name of project we want ( Here we are giving webhook-test as project name).Here we will go with free style proje ct. So Select freestyle project and click ok. Here select github project.Give the github url where our code is present Now go to source code management . Select Git. Here we want to give  repository url.For that go to repository( new ) in our github account and copy url from there. As it is a public repository we don't want to give credentials.By default jenkins will take master branch.If we want to change it change it under Branches to build.   Now under build trigger s secion