0% found this document useful (0 votes)
66 views25 pages

Ccpractical 9

Uploaded by

socialmedi324
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views25 pages

Ccpractical 9

Uploaded by

socialmedi324
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Practical-9

Aim:-Categorize Amazon Web Service (AWS) and implement


its various cloud entities using its Cloud Toolbox support.

Theory:
Amazon Web Service(AWS):
Amazon Web Services (AWS) is a cloud computing platform offered by
Amazon. It provides a wide range of on-demand services like computing power,
storage, and databases, allowing businesses to scale and manage their IT resources
efficiently. AWS offers services such as EC2 for virtual servers, S3 for scalable
storage, RDS for managed databases, and Lambda for serverless computing. By
using AWS, companies can reduce infrastructure costs, improve flexibility, and
deploy applications globally with ease.

AWS TOOLS:

 AWS Infrastructure Composer


 AWS Cloud9
 AWS CloudShell
 AWS CodeArtifact
 AWS CodeBuild
 Amazon CodeCatalyst
 AWS CodeCommit
 AWS CodeDeploy
 AWS CodePipeline
 Amazon Corretto
 AWS Fault Injection Service
 Amazon Q Developer
 AWS X-Ray

Services
….and much more.

* Launching a WebPage using AWS EC2


AWS CodeDeploy Tool:

AWS CodeDeploy is a service that automates code deployments to any


instance, including EC2 instances and instances running on premises. CodeDeploy
makes it easier for you to rapidly release new features, helps you avoid downtime
during application deployment, and handles the complexity of updating your
applications. You can use CodeDeploy to automate software deployments,
eliminating the need for error-prone manual operations. The service scales with your
infrastructure so you can easily deploy to one instance or thousands.

AWS EC2:
Amazon Web Service EC2 is a web service which is provided by the AWS
cloud which is secure, resizable, and scalable. These virtual machines are pre-
configured with the operating systems and some of the required software. Instead of
managing the infrastructure AWS will do that so you can just launch and terminate
the EC2 instance whenever you want. You can scale up and down the EC2
instance depending on the incoming traffic. The other advantage of AWS EC2 is
that you need to pay only for how much you use it is like the pay-as-you-go model.
Steps:-
1. Search the AWS console on Google and click on AWS console

2. Click on Sign in

3. Sign in to AWS account using mail id

4. Give the password and click on sign in


5.Click on EC2 services

6.Click on instances
7.Click Launch Instance

8.Choose Amazon Linux 2 AMI (Free Tier Eligible).

9.Select t2.micro as the instance type and click on launch instance.


10.Connect to the EC2 Instance

Locate Public IP:

Go to the EC2 dashboard and find the instance's public IP.


SSH into the Instance:

Open a terminal on your local machine and connect:


ssh -i /path/to/your-key.pem ec2-user@<public-ip>

Install and Configure Apache


Update the System:

sudo yum update -y

Install Apache:

sudo yum install httpd -y

Start Apache:

sudo systemctl start httpd


Enable Apache on Boot:
sudo systemctl enable httpd

Verify Apache is Running:

 Open your browser and navigate to the instance's public IP (http://<public-


ip>).
 You should see the default Apache test page.
 Upload Your Static Website Files
 Transfer Your Files:

From your local machine, use the scp command to upload files:

scp -i /path/to/your-key.pem /path/to/index.html ec2-user@<public-ip>:/tmp


Move Files to the Web Root:

SSH into the instance and move the files to the Apache root directory:

sudo mv /tmp/index.html /var/www/html/


11.Access the Website

Open a browser and go to http://<public-ip>.


Your static web page should now be visible.

With this setup, our Amazon Linux-based EC2 instance should be serving our static
web page successfully.
*Hosting a Static Web Page using AWS S3 service

Using AWS S3 to host a static website is a straightforward and cost-effective solution,


as S3 is optimized for serving static content.

Steps:

1. Create an S3 Bucket

1. Log in to AWS Console:


o Navigate to AWS Management Console

2. Create the Bucket:


o Click Create Bucket.
Fill the bucket name and allow public access.

Bucket is successfully creted.


2. Upload Website Files

1. Go to Your Bucket
o In the S3 dashboard, click the bucket you just created.
2. Upload Files:
o Click Upload and select your index.html file and any other static
assets (e.g., CSS, JS, images).
o Click Upload to confirm.
3. Configure the Bucket for Static Website Hosting

1. Enable Static Website Hosting:


o In your bucket, go to the Properties tab.
o Scroll down to Static Website Hosting.
o Enable the option and specify:
 Index Document: index.html.
 Error Document: error.html (if you have one; optional).
o Save changes.

4.Set Permissions for Public Access

1. Update Bucket Policy:


o Go to the Permissions tab in the S3 bucket.
o Scroll to Bucket Policy and add a policy like the one below (replace
<bucket-name> with your bucket's name):

json
Copy code
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::<bucket-name>/*"
}
]
}

OR just allow public view from root user account of AWS.

o Click Save.

2. OR just edit permissions from Permission option in GUI


3. Verify Permissions:

o Ensure public access is allowed by checking Bucket Policy and Public


Access Settings.

5. Test Your Static Website

1. Access the Website:


o Open the endpoint URL (from Step 3) in a browser.
o Your static website should now be visible.
6.Optional Enhancements

1. Custom Domain with Route 53:


o In Route 53, create a hosted zone for your domain.
o Add an Alias Record pointing to your S3 bucket's website endpoint.
2. Enable HTTPS:
o Use AWS CloudFront as a CDN:
 Create a CloudFront distribution pointing to your S3 bucket.
 Enable SSL/TLS with an AWS Certificate Manager (ACM)
certificate.
3. Advanced Permissions:
o For more granular control, use AWS Identity and Access Management
(IAM) roles to define access policies.
With these steps, your static website will be live on AWS S3, scalable, and highly
available!

*Uploading the file in Amazon S3 and Transfer file from one bucket
to another bucket in S3
Amazon Simple Storage Service (Amazon S3) is an object storage service that
offers industry-leading scalability, data availability, security, and performance.
Customers of all sizes and industries can use Amazon S3 to store and protect any
amount of data for a range of use cases, such as data lakes, websites, mobile
applications, backup and restore, archive, enterprise applications, IoT devices, and big
data analytics.
Steps:
1. click on S3 services

2.click on create bucket


3.provide unique name to the bucket

4.click on create bucket


Keep as it is all the settings and click on the create bucket option.
5.bucket is created successfully.

6.create another bucket


create another bucket using above same procedure. The second bucket is
created successfully.

7. Upload the file in bucket


Click on sourcebuckettype.

Click on upload.

Click on Add Files.

Choose the file and click on upload.


File is successfully uploaded.

8. To Transfer file click on search bar and search datasync.


-click on datasync services.
The datasync service helps to move data between on-premise storage and Aws
storage services. So here datasync is used to transfer file from sourcebuckettype to
destinationbuckettype.
click on create task.

choose the lovation type amazon s3.

Type the source bucket name at S3 URI


Click on Next button.

Type the destination bucket name at S3 URI

Click on Next button.


Choose the Enhanced task mode and provide name to task.

Click on Next button

Review the all information.


Click on create task.

Click on start button and click on start with default

Task status is available then go back


Here task is created.

Go to the s3 services and click on destinationbuckettype.


The file is transferred from sourcebuckettype to destinationbuckettype successfully.

Conclusion:
In this practical we learned about AWS tools(AWS CodeDeploy
tools) and AWS services ( AWS EC2,AWS S3) with their
implementation.

You might also like