跳至主要內容

[aws] Lab 1-Exploring and Interacting with the AWS Management Console and AWS CLI

LAB ENVIRONMENT

The lab environment provides you with the following resources to get started: an Amazon Virtual Private Cloud (Amazon VPC), the necessary underlying network structure, a security group allowing the HTTP protocol over port 80, an Amazon Elastic Compute Cloud (Amazon EC2) instance with the Amazon CLI installed, and an associated Amazon EC2 instance profile. The instance profile contains the permissions necessary to allow Session Manager, a capability of AWS Systems Manager, to access the Amazon EC2 instance.

The following diagram shows the interactive flow of the AWS API for creating AWS services and resources used in the lab through the AWS Management Console and AWS CLI.

Interactive Flow Diagram for creating AWS services and resources using AWS Management Console and AWS CLI.

AWS SERVICES NOT USED IN THIS LAB

AWS services not used in this lab are deactivated in the lab environment. In addition, the capabilities of the services used in this lab are limited to only what the lab requires. Expect errors when accessing other services or performing actions beyond those provided in this lab guide.


Task 1: Explore and configure the AWS Management Console

In this task, you explore the AWS Management Console and the unified search tool. You then configure the Region, widgets, and services.

 Learn more: The AWS Management Console provides secure sign-in using your AWS account root user credentials or AWS Identity and Access Management (IAM) account credentials. When you first sign in, the user credentials are authenticated and the home page is displayed. The home page provides access to each service console and offers a single place to access the information you need to perform your AWS related tasks. For more information, see What is the AWS Management Console?.

TASK 1.1: CHOOSE AN AWS REGION

In this task, you choose an AWS Region that specifies where your resources are managed. Regions are sets of AWS resources located in the same geographical area.

  1. On the navigation bar, choose the Region selector displayed at the top-right corner of the console, and then choose the Region to which you want to switch.

The Region on the console home page is now changed to the Region you chose.

 Caution: If the chosen Region opens up a different webpage instead of the console home page, choose Cancel and try to choose a different Region.

Next, you configure the default Region.

  1. To open the General Settings page, click gear icon from menu bar.
  2. Click on More user settings.

The Unified Settings page is displayed.

  1. In the Localization and default Region section, choose Edit.
  2. For Default Region, select any Region from the dropdown menu.
  3. Choose Save settings.

A  Successfully updated localization and Region settings message is displayed on top of the screen.

 Caution: If the current Region shown on the Region selector in the top-right corner is the same Region you choose in the default Region dropdown list, you will not see the success message with Go to new default Region. Try choosing a different Region from the dropdown menu to see this message and complete the next step.

  1. Choose Go to new default Region.

The Unified Settings page is displayed with the Region set to the Default Region you chose.

 Note: If you do not choose a default Region, the last Region you visited becomes your default.

  1. Choose the AWS logo displayed in the upper-left-hand corner to return to the console home page.
  2. On the navigation bar, choose the Region selector displayed at the top-right corner of the console, and then choose the Region that matches the LabRegion value located to the left of these instructions.

 Caution: Verify that you are in the correct region that matches to the LabRegion value located to the left of these instructions.

TASK 1.2: SEARCH WITH THE AWS MANAGEMENT CONSOLE

In this task, you explore the search box on the navigation bar, which provides a unified search tool for locating AWS services and features, service documentation, and the AWS Marketplace.

  1. To open a console for a service, go to the  Search box in the navigation bar of the AWS Management Console, and enter .

The more characters you type, the more the search refines your results.

  1. To narrow the results to the type of content that you want, choose one of the categories on the left navigation pane.
  2. To quickly navigate to a service or popular features of a service, in the Services section, hover over the AWS Cloud Map service name in the results and choose the link.

The AWS Cloud Map console page is displayed.

 Note: For more details about a documentation result or AWS Marketplace result, hover on the result title and choose a link.

  1. Choose the AWS logo displayed in the upper-left-hand corner to return to the console home page.

TASK 1.3: ADD AND REMOVE FAVORITES

In this task, you explore the AWS Management Console to add AWS services to your Favorites list and remove added services from the Favorites list.

Add a service to the list of favorites

  1. On the navigation bar, choose Services to open a full list of services.
  2. From the left navigation menu, choose All services or Recently visited, and then choose a service from the list that you want to add as a favorite.
  3. To the left of the service name, select the star.

 Note: Repeat the previous step to add more services to your Favorites list.

  1. To view the list of favorite services, from the left navigation menu, choose Favorites.

 Note: Alternatively, Favorites are pinned and visible on the navigation bar at the top of the console window.

Remove a service from the list of favorites

  1. On the navigation bar, choose Services to open a full list of services.
  2. In the Favorites list, deselect the star next to the name of a service you wish to remove.

 Note: Alternatively, in the Recently visited list or All services list, deselect the star next to the name of a service that is in your Favorites list.

TASK 1.4: OPEN A CONSOLE FOR A SERVICE

  1. On the navigation bar, choose Services to open a full list of services.
  2. Choose a service under Favorites or Recently visited or All services to quickly navigate to a specific service.

The chosen service console page is displayed.

  1. Choose the AWS logo displayed in the upper-left-hand corner to return to the AWS Management Console home page.

TASK 1.5: CREATE AND USE DASHBOARD WIDGETS

In this task, you learn about the widgets that display important information about your AWS environment and provide shortcuts to your services. You can customize your experience by adding and removing widgets, rearranging them, or changing their size.

  1. To add a widget, choose + Add widgets.

The Add widgets window is displayed.

  1. In the Add widgets menu, choose the title bar at the top of the widget that you want to add and then drag the widget on the console page.
  2. To rearrange a widget, configure the following:
  • Choose the title bar at the top of the widget, for example, Favorites, and then drag the widget to a new location on the console page.
  1. To resize a widget, configure the following:
  • Choose the Recently Visited widget.
  • Drag the bottom-right corner of the widget to resize.

 Note: You cannot adjust the size of the Welcome to AWS, Explore AWS, and AWS Health widgets.

  1. To remove a widget, configure the following:
  • Choose the Welcome to AWS widget.
  • In the upper-right corner of the widget, choose the widget actions ellipsis icon, represented by three vertical dots.
  • Choose Remove widget.

 Congratulations! You have explored the AWS Management Console and learned to customize your console home screen.


Task 2: Create an Amazon S3 bucket using the AWS Management Console

In this task, you create and configure a new Amazon S3 bucket in the LabRegion using the AWS Management Console.

 Caution: Verify that you are in the correct region that matches to the LabRegion value located to the left of these instructions.

 Learn more: Amazon S3 is an object storage service that offers industry-leading scalability, data availability, security, and performance. Customers 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, Internet of Things (IoT) devices, and big data analytics. For more information, see What is Amazon S3?.

Interactive Flow Diagram for creating AWS Services and resources using AWS Management Console.
  1. On the Services menu, choose All Services.
  2. On the left navigation menu, scroll down the list and choose Storage.
  3. From the Storage list, choose S3.

 Note: You can also search for  in the search bar  Search at the top of the console.

  1. In the navigation pane on the left-hand side of the console, choose Buckets.
  2. Choose Create bucket.

The Create bucket page is displayed.

  1. In the General configuration section, for Bucket name, enter .

 Note: Replace NUMBER in the bucket name with a random number. This ensures that you have a unique name.

  • Example bucket name: 

 Note: Amazon S3 bucket names must be globally unique and Domain Name System (DNS) compliant.

  1. The AWS Region should match the LabRegion value found to the left of these lab instructions.
  2. Leave all other settings on this page as the default configurations.
  3. Choose Create bucket at the bottom of the screen.

 In terms of implementation, you can create a bucket using the Amazon S3 API, but you performed the same operation using the Amazon S3 console instead. The console uses the Amazon S3 APIs to send requests to Amazon S3.

A  Successfully created bucket “labbucket-xxxxx” message is displayed on top of the screen.

The S3 console is displayed. The newly created bucket is displayed among the list of all the buckets for the account.

 Congratulations! You have created a new Amazon S3 bucket with the default configuration.


Task 3: Upload an object into the Amazon S3 bucket using the S3 console

In this task, you upload an object into the previously created S3 bucket using the S3 console.

  1. To open the context (Right-click) menu, choose this image link and choose the option to save the image to your computer.
  • Name your file similar to HappyFace.jpg.

 Note: The method to save files varies by web browser. Choose the appropriately worded option from your context menu.

  1. In the Amazon S3 console, choose the labbucket-xxxxx bucket.
  2. Choose Upload.

The Upload page is displayed.

  1. Choose Add files.
  2. Browse to and choose the HappyFace.jpg picture you downloaded.
  3. Choose Upload.

A  Upload succeeded message is displayed on top of the screen.

  1. Choose Close.

 Congratulations! You have uploaded an object into the Amazon S3 bucket.


Task 4: Create an Amazon S3 bucket and uploading an object using the AWS CLI

In this task, you use the AWS CLI to create an Amazon S3 bucket. The AWS CLI is an open-source tool that you can use to interact with AWS services using commands in your command line shell.

TASK 4.1: CREATE A CONNECTION TO THE COMMAND HOST USING SESSION MANAGER

An Amazon EC2 instance pre-configured with the AWS CLI has been provided for you to use in this lab. It has the name Command Host.

Interactive Flow Diagram for creating AWS Services and resources using AWS CLI.
  1. At the top of the AWS Management Console, in the search box, search for and choose .
  2. In the navigation pane on the left-hand side of the console, choose Instances.
  3. Select  Command Host.
  4. Choose Connect.

The Connect to instance page is displayed.

  1. Choose the Session Manager tab.

 Learn more: With Session Manager, you can connect to Amazon EC2 instances without having to expose the SSH port on your firewall or Amazon VPC security group. For more information, see AWS Systems Manager Session Manager.

  1. Choose Connect.

 Note: Alternatively, you can copy the CommandHostSessionUrl value from the left side of these lab instructions and paste it in a new browser tab. The terminal for the Command Host instance opens.

A new browser tab or window opens with a connection to the Command Host instance.

TASK 4.2: USE HIGH-LEVEL S3 COMMANDS WITH THE AWS CLI

In this task, you access the high-level features of Amazon S3 using the AWS CLI.

  1.  Command: Enter the following command in your Command Host session:

 Tip: To copy the command, hover on it and choose the copy  icon. Paste the command in the Command Host session.

 Note: The following ls command lists all of the buckets owned by the user.

aws s3 ls
  1.  Command: Copy the following command to a text editor, replace NUMBER with the random number you chose for your bucket, and paste the command in the Command Host session.

 Note: The following mb command creates a bucket.

aws s3 mb s3://labclibucket-NUMBER
  • Example bucket name: 
  1. To run the modified command in your Command Host session, press Enter.

 Expected output:

make_bucket: labclibucket-xxxxx

 Note: To simplify the instructions in this lab, this newly created bucket will be referred to as the labclibucket-NUMBER for the remainder of the instructions, regardless of what bucket name you actually choose in this step.

  1.  Command: Enter the following command in your Command Host session:
aws s3 ls

Notice the newly created bucket in the output list.

  1.  Command: Copy the following command to a text editor, replace labclibucket-NUMBER with the name of the S3 bucket you created in the previous step, and paste the command in the Command Host session.

 Note: The following cp command copies a single file to a specified bucket.

aws s3 cp /home/ssm-user/HappyFace.jpg s3://labclibucket-NUMBER
  1. To run the modified command in your Command Host session, press Enter.

 Expected output:

upload: ../../home/ssm-user/HappyFace.jpg to s3://labclibucket-xxxxx/HappyFace.jpg
  1.  Command: Copy the following command to a text editor, replace labclibucket-NUMBER with the name of the S3 bucket you created in the previous step, and paste the command in the Command Host session.

 Note: The following ls command lists objects under a specified bucket.

aws s3 ls s3://labclibucket-NUMBER

 Notice the uploaded object in the newly created bucket in the output list. You can close the browser tab.

As demonstrated in this task, the high-level Amazon S3 commands simplify managing Amazon S3 objects. Using these commands, you can manage the contents of Amazon S3 within itself and with local directories. The S3 commands are built on top of the operations found in the S3 API commands.

 Congratulations! You have used the AWS CLI to create, list, and copy objects into the Amazon S3 bucket.


Conclusion

 Congratulations! You now have successfully:

  • Explored and interacted with the AWS Management Console.
  • Created resources using the AWS Management Console.
  • Explored and interacted with the AWS CLI.
  • Created resources using the AWS CLI.

End lab

分類:aws
由 Compete Themes 設計的 Author 佈景主題