Lab 1: Exploring and Interacting with the AWS Management Console and AWS CLI Lab overview The Amazon Web Services (AWS) environment is an integrated collection of hardware and software services designed to provide quick and inexpensive use of resources. The AWS API sits atop the AWS environment. An API represents a way to communicate with a resource. There are different ways to interact with AWS resources, but all interaction uses the AWS API. The AWS Management Console provides a simple web interface for AWS. The AWS Command Line Interface (AWS CLI) is a unified tool to manage your AWS services through the command line. Whether you access AWS through the AWS Management Console or using the command line tools, you are using tools that make calls to the AWS API. This lab follows the Architecting Fundamentals module, which focuses on the core requirements for creating workloads in AWS. This lab reinforces module discussions on the what, where, and how of building AWS workloads. Students first explore the features of the AWS Management Console and then use the Amazon Simple Storage Service (Amazon S3) API to deploy and test connectivity to an Amazon S3 bucket using two different methods: AWS Management Console AWS CLI OBJECTIVES After completing this lab, you should be able to do the following: Explore and interact with the AWS Management Console. Create resources using the AWS Management Console. Explore and interact with the AWS CLI. Create resources using the AWS CLI. ICON KEY Various icons are used throughout this lab to call attention to different types of instructions and notes. The following list explains the purpose for each icon:   Note:  A hint, tip, or important guidance.   Learn more:  Where to find more information.   Caution:  Information of special interest or importance (not so important to cause problems with the equipment or data if you miss it, but it could result in the need to repeat certain steps).   WARNING:  An action that is irreversible and could potentially impact the failure of a command or process (including warnings about configurations that cannot be changed after they are made).   Expected output:  A sample output that you can use to verify the output of a command or edited file.   Command:  A command that you must run.   Consider: A moment to pause to consider how you might apply a concept in your own environment or to initiate a conversation about the topic at hand. Scenario 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. 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. Steps 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. 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. To open the General Settings page, click gear icon from menu bar. Click on  More user settings . The  Unified Settings  page is displayed. In the  Localization and default Region  section, choose Edit. For  Default Region , select any  Region  from the dropdown menu. 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. 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. Choose the  AWS logo  displayed in the upper-left-hand corner to return to the console home page. 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. 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. To narrow the results to the type of content that you want, choose one of the categories on the left navigation pane. 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. 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 On the navigation bar, choose Services to open a full list of services. 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. To the left of the service name, select the  star .   Note:  Repeat the previous step to add more services to your Favorites list. 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 On the navigation bar, choose Services to open a full list of services. 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 On the navigation bar, choose Services to open a full list of services. 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. 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. To add a widget, choose + Add widgets. The  Add widgets  window is displayed. 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. 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. 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. 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? . On the Services menu, choose  All Services . On the left navigation menu, scroll down the list and choose  Storage . From the  Storage  list, choose  S3 .   Note: You can also search for   in the search bar Search  at the top of the console. In the navigation pane on the left-hand side of the console, choose  Buckets . Choose Create bucket. The  Create bucket  page is displayed. 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. The  AWS Region  should match the  LabRegion  value found to the left of these lab instructions. Leave all other settings on this page as the default configurations. 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. 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. In the  Amazon S3  console, choose the  labbucket-xxxxx  bucket. Choose Upload. The  Upload  page is displayed. Choose Add files. Browse to and choose the  HappyFace.jpg  picture you downloaded. Choose Upload. A Upload succeeded  message is displayed on top of the screen. 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 . At the top of the AWS Management Console, in the search box, search for and choose .   In the navigation pane on the left-hand side of the console, choose  Instances . Select Command Host . Choose Connect. The  Connect to instance  page is displayed. 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 . 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.   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   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: 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.   Command:  Enter the following command in your Command Host session: aws s3 ls Notice the newly created bucket in the output list.   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 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   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.