Integration of EC2,ebs S3 and CloudFront in Aws

Aws(amazon web services) provides cloud computing services to the user .
In today’s world cloud computing is best for every startup companies and other companies which want to provide effective services to the customer without spending heavy amount for buying physical devices for computing power.
In Aws many services are available for computing power EC2 service is used . Using EC2 service instance is launched which have OS installed, which is installed using AMI(amazon machine image).
For create security group , key pair and launch the EC2 instances using CLI go to Launch EC2 instances .
For add block storage in instances, Aws EBS service is used , EBS volume creation and attach to the instances.

Any data is stored in file and file is stored in folder . In cloud file is known as object and folder is known as bucket .
In Aws , S3 is serverless fully managed service as object storage . S3 is global service, for use S3 service first of all create bucket to store object. bucket name should be unique because it is global service.
For create bucket use below cmd
aws s3 mb s3://dhiruarth123
This cmd will create bucket of name “dhiruarth123” after creation of bucket ,put bucket on public read mode for access the object publicly.
aws s3api put-bucket-acl --acl public-read --bucket dhiruarth123
After creation of bucket object is uploaded to bucket , for upload object use below cmd
aws s3 cp <file_url/local_path> s3://dhiruarth123

After upload object in bucket make it public for read only , for this use below cmd
aws s3api put-object-acl --acl public-read --bucket dhiruarth123 --key dhiraj.jpg
CloudFront

Aws CloudFront works as CDN(content delivery network) service .CDN is a group of servers which works together to provide fast delivery of internet content .In CDN which data centers are used that is known as edge location . When data expires from edge location then cache is retrived from region edge cache .
Edge location stores cache of static data first time when any user click to access data then first data cache is stored in nearby data center , known as edge location . Data cache is stored by default 1 day that is known as TTL(time to live).After one day data cache is removed from edge location .
For CDN service first of all create distribution in Aws CloudFront use below cmd
aws cloudfront create-distribution --origin-domain-name dhiruarth123.s3.amazonaws.com
After creation of distribution use Domain Name of CloudFront for access object of S3 by less latency.



