0% found this document useful (0 votes)
4 views5 pages

CCD Assignment2

The document outlines a step-by-step assignment to utilize AWS cloud storage services, specifically focusing on EC2 and S3. It includes instructions for launching an Ubuntu instance, creating an IAM user with S3 access, configuring AWS CLI, and writing a Python script to back up a file to an S3 bucket. Additionally, it covers verifying the uploaded file and retrieving it back to EC2.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views5 pages

CCD Assignment2

The document outlines a step-by-step assignment to utilize AWS cloud storage services, specifically focusing on EC2 and S3. It includes instructions for launching an Ubuntu instance, creating an IAM user with S3 access, configuring AWS CLI, and writing a Python script to back up a file to an S3 bucket. Additionally, it covers verifying the uploaded file and retrieving it back to EC2.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

‭ASSIGNMENT 2‬

‭OBJECTIVE:‬ ‭To understand and utilize cloud storage services provided by AWS/‬
‭ zure‬
A
‭1.‬ ‭Login to your AWS Console.‬
‭Go to EC2 → Instances → Launch Instance‬
‭AMI: Select “Ubuntu Server 22.04 LTS (Free Tier Eligible)”‬
‭Key Pair: Create new OR use existing‬
‭File format: .pem (download and save safely)‬
‭Launch Instance‬

‭2. Connect via SSH Using command prompt‬


‭3. Create IAM User with S3 Full Access‬
‭Copy paste access key and secret key for future use‬

‭4. AWS CLI Configure on EC2‬

‭5. Create an S3 Bucket‬

‭6. Python Script to Backup File to S3‬

‭ notepad file is created‬


A
‭Paste the following code in notepad‬
i‭mport boto3‬
‭from botocore.exceptions import NoCredentialsError‬

‭s3 = boto3.client('s3')‬

‭ ucket_name = 'anushka-backup-bucket-2025'‬
b
‭file_name = 'backup.txt'‬
‭object_name = 'backup.txt'‬

‭try:‬
‭s3.upload_file(file_name, bucket_name, object_name)‬
‭print(f"Upload Successful: {object_name}")‬
‭except FileNotFoundError:‬
‭print("The file was not found")‬
‭except NoCredentialsError:‬
‭print("Credentials not available")‬

‭7. Verify File in S3 Bucket‬

‭8. Retrieve File from S3 to EC2‬

You might also like