What is S3 Bucket in AWS?
Amazon Simple Storage Service (Amazon S3) is a scalable object storage service provided by Amazon Web Services (AWS). It is designed to store and retrieve any amount of data from anywhere on the web.
S3 is commonly used for a variety of purposes, such as backup and restore, archiving, content distribution, and hosting static websites.
What is IAM in AWS?
IAM stands for Identity and Access Management. IAM is a web service that helps you securely control access to AWS resources. It enables you to manage users, groups, and permissions to securely access and use AWS services and resources.
key components of IAM:
- Users
- Groups
- Roles
- Policies
What is AWSCLI?
The AWS Command Line Interface (AWS CLI) is a set of open-source command-line tools for interacting with Amazon Web Services (AWS) services. It allows users to control and manage AWS services directly from the command line, rather than using the AWS Management Console.
Tasks:
1) Make a private S3 bucket in AWS and change the policy so you can access its stuff without making it public.
To achieve this, you can configure an S3 bucket policy and IAM user or role permissions that allow specific access while keeping the bucket private. Here’s a step-by-step guide:
Step 1: Create a Private S3 Bucket
- Log in to the AWS Management Console.
- Go to the S3 service.
- Click Create Bucket and:
-Provide a Bucket Name (e.g., my-private-bucket).
- Select the appropriate Region.
- Ensure Block all public access is enabled.
- Click Create Bucket.
Step 2: Modify Bucket Policy for Specific Access
- Navigate to your bucket in the S3 Console.
- Go to the Permissions tab.
- Under Bucket Policy, click Edit.
- Add a policy allowing specific access to a user, role, or IP range.
Step 3: Update IAM Permissions for the User or Role
- Go to the IAM Console.
- Select the User or Role you want to grant access to.
- Attach a policy like this:
2) Configure AWSCLI on your Ubuntu machine.
Step 1: Install AWS CLI
Update your system packages:
sudo apt update
Install AWS CLI using the package manager (version 1):
sudo apt install awscli -y
OR (for the latest AWS CLI version 2):
curl
"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip"
-o
"awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
Verify the installation:
aws --version
Step 2: Configure AWS CLI
aws configure
Provide the following details when prompted:
- AWS Access Key ID: Enter the access key for your IAM user.
- AWS Secret Access Key: Enter the secret key for your IAM user.
- Default Region Name: Enter the AWS region (e.g., us-east-1 or ap-south-1).
- Default Output Format: Choose the format (json, table, or text).
3) Create an EC2 instance using AWSCLI.
Top comments (0)