<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Sarah Aligbe</title>
    <description>The latest articles on Forem by Sarah Aligbe (@sarahligbe).</description>
    <link>https://forem.com/sarahligbe</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1061054%2F3987966d-32c0-4caa-9689-a375d852e595.png</url>
      <title>Forem: Sarah Aligbe</title>
      <link>https://forem.com/sarahligbe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sarahligbe"/>
    <language>en</language>
    <item>
      <title>User Management Automation in Linux Using Bash Script</title>
      <dc:creator>Sarah Aligbe</dc:creator>
      <pubDate>Wed, 03 Jul 2024 02:27:10 +0000</pubDate>
      <link>https://forem.com/sarahligbe/user-management-automation-in-linux-using-bash-script-197l</link>
      <guid>https://forem.com/sarahligbe/user-management-automation-in-linux-using-bash-script-197l</guid>
      <description>&lt;h2&gt;
  
  
  Scenario
&lt;/h2&gt;

&lt;p&gt;As a SysOps engineer, you have been tasked to write a bash script that creates Users, Groups, and home directories with appropriate permissions for new employees in your company.&lt;/p&gt;

&lt;p&gt;This article will walk you through writing the bash script to automate the process of creating users and groups in a Linux system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Pre-requisites
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;An Ubuntu server&lt;/li&gt;
&lt;li&gt;Basic Linux knowledge &lt;/li&gt;
&lt;li&gt;User with sudo privileges&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Script Overview
&lt;/h3&gt;

&lt;p&gt;The script &lt;code&gt;create_users.sh&lt;/code&gt; reads a text file containing usernames and group names, creates the specified users and groups, sets up home directories, generates random passwords for each user, and logs all actions. It is important to run the script with a user with sudo privileges as using your root user is not considered best practice. The script takes the input file as a command-line argument.&lt;/p&gt;

&lt;h3&gt;
  
  
  Breakdown of the create_users.sh script
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Initial Checks
&lt;/h4&gt;

&lt;p&gt;The script starts with some important checks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Function to check if user has sudo privileges&lt;/span&gt;
check_sudo&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="nb"&gt;true &lt;/span&gt;2&amp;gt;/dev/null&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
        return &lt;/span&gt;0
    &lt;span class="k"&gt;else
        return &lt;/span&gt;1
    &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;# Check if user has sudo privileges&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; check_sudo &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"This script requires sudo privileges to run"&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Please run this script with sudo or as a user with sudo privileges"&lt;/span&gt;
    &lt;span class="nb"&gt;exit &lt;/span&gt;1
&lt;span class="k"&gt;fi&lt;/span&gt;

&lt;span class="c"&gt;# Check if input file is provided&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$# &lt;/span&gt;&lt;span class="nt"&gt;-eq&lt;/span&gt; 0 &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Please provide an input file"&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Usage: &lt;/span&gt;&lt;span class="nv"&gt;$0&lt;/span&gt;&lt;span class="s2"&gt; &amp;lt;input-file&amp;gt;"&lt;/span&gt;
    &lt;span class="nb"&gt;exit &lt;/span&gt;1
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These checks ensure that the script is run with root privileges and that an input file is provided.&lt;/p&gt;

&lt;h4&gt;
  
  
  Directory and File Setup
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;input_file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;
&lt;span class="nv"&gt;log_file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/var/log/user_management.log"&lt;/span&gt;
&lt;span class="nv"&gt;password_csv&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/var/secure/user_passwords.csv"&lt;/span&gt;
&lt;span class="nv"&gt;password_file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/var/secure/user_passwords.txt"&lt;/span&gt;
&lt;span class="nv"&gt;password_dir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/var/secure"&lt;/span&gt;

&lt;span class="c"&gt;#create the password directory if it doesn't exist&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nv"&gt;$password_dir&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; &lt;span class="nv"&gt;$password_dir&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;

&lt;span class="c"&gt;# Create log file, password csv, and password file and set permissions&lt;/span&gt;
&lt;span class="nb"&gt;sudo touch&lt;/span&gt; &lt;span class="nv"&gt;$log_file&lt;/span&gt; &lt;span class="nv"&gt;$password_csv&lt;/span&gt; &lt;span class="nv"&gt;$password_file&lt;/span&gt;
&lt;span class="nb"&gt;sudo chmod &lt;/span&gt;600 &lt;span class="nv"&gt;$password_csv&lt;/span&gt; &lt;span class="nv"&gt;$password_file&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The variables denoting the various files and directories are defined. The input_file containing the user and group names is assigned &lt;strong&gt;$1&lt;/strong&gt; denoting that it is the first command-line argument supplied.&lt;/p&gt;

&lt;p&gt;The if statement checks whether the directory where the user passwords will be stored exists and creates the directory if it doesn’t .&lt;/p&gt;

&lt;p&gt;The password files are given restrictive permissions (600) to ensure only the owner can read it.&lt;/p&gt;

&lt;h4&gt;
  
  
  Helper Functions
&lt;/h4&gt;

&lt;p&gt;Two helper functions are defined:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Function to log actions&lt;/span&gt;
log&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;: &lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$log_file&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /dev/null
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;# Function to generate random password&lt;/span&gt;
generate_password&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    openssl rand &lt;span class="nt"&gt;-base64&lt;/span&gt; 12
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;log&lt;/code&gt; function appends timestamped messages to the log file, while &lt;code&gt;generate_password&lt;/code&gt; creates a random 12-character password.&lt;/p&gt;

&lt;h4&gt;
  
  
  Reading the input file and Error Handling
&lt;/h4&gt;

&lt;p&gt;The input file is read line-by-line using the &lt;code&gt;while&lt;/code&gt; loop&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#set line number to zero. to be used in error handling for invalid inputs&lt;/span&gt;
&lt;span class="nv"&gt;line_number&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0

&lt;span class="c"&gt;# Read input file line by line&lt;/span&gt;
&lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="nv"&gt;IFS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;';'&lt;/span&gt; &lt;span class="nb"&gt;read&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; username &lt;span class="nb"&gt;groups&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="c"&gt;# Remove leading/trailing whitespace&lt;/span&gt;
    &lt;span class="nv"&gt;username&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$username&lt;/span&gt; | xargs&lt;span class="si"&gt;)&lt;/span&gt;
    &lt;span class="nb"&gt;groups&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$groups&lt;/span&gt; | xargs&lt;span class="si"&gt;)&lt;/span&gt;

    &lt;span class="c"&gt;#increment the line number after reading each line&lt;/span&gt;
    &lt;span class="nv"&gt;line_number&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$((&lt;/span&gt;line_number &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="k"&gt;))&lt;/span&gt;

    &lt;span class="c"&gt;# Check that the username and group is present&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="nt"&gt;-z&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$username&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nt"&gt;-z&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$groups&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
        &lt;/span&gt;log &lt;span class="s2"&gt;"Error: Invalid input on line &lt;/span&gt;&lt;span class="nv"&gt;$line_number&lt;/span&gt;&lt;span class="s2"&gt;. Ensure Username and groups are provided"&lt;/span&gt;
        &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Error: Invalid input on line &lt;/span&gt;&lt;span class="nv"&gt;$line_number&lt;/span&gt;&lt;span class="s2"&gt;. Ensure Username and groups are provided"&lt;/span&gt;
        &lt;span class="k"&gt;continue
    fi&lt;/span&gt;

    &lt;span class="c"&gt;# Check if user already exists&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$username&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &amp;amp;&amp;gt;/dev/null&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
        &lt;/span&gt;log &lt;span class="s2"&gt;"User &lt;/span&gt;&lt;span class="nv"&gt;$username&lt;/span&gt;&lt;span class="s2"&gt; already exists. Skipping."&lt;/span&gt;
        &lt;span class="k"&gt;continue
    fi&lt;/span&gt;

    &lt;span class="c"&gt;# Create user's personal group&lt;/span&gt;
    &lt;span class="nb"&gt;sudo &lt;/span&gt;groupadd &lt;span class="nv"&gt;$username&lt;/span&gt;
    log &lt;span class="s2"&gt;"Created personal group &lt;/span&gt;&lt;span class="nv"&gt;$username&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

    &lt;span class="c"&gt;# Create user with home directory with appropriate ownership and permissions to allow only the user read, write, and execute&lt;/span&gt;
    &lt;span class="nb"&gt;sudo &lt;/span&gt;useradd &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; &lt;span class="nv"&gt;$username&lt;/span&gt; &lt;span class="nv"&gt;$username&lt;/span&gt;
    &lt;span class="nb"&gt;sudo chmod &lt;/span&gt;700 &lt;span class="s2"&gt;"/home/&lt;/span&gt;&lt;span class="nv"&gt;$username&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$username&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;$username&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"/home/&lt;/span&gt;&lt;span class="nv"&gt;$username&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    log &lt;span class="s2"&gt;"Created user &lt;/span&gt;&lt;span class="nv"&gt;$username&lt;/span&gt;&lt;span class="s2"&gt; with home directory"&lt;/span&gt;

    &lt;span class="c"&gt;# Set random password for user&lt;/span&gt;
    &lt;span class="nv"&gt;password&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;generate_password&lt;span class="si"&gt;)&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$username&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;$password&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;sudo &lt;/span&gt;chpasswd
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$username&lt;/span&gt;&lt;span class="s2"&gt;,&lt;/span&gt;&lt;span class="nv"&gt;$password&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nv"&gt;$password_csv&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /dev/null
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$username&lt;/span&gt;&lt;span class="s2"&gt;,&lt;/span&gt;&lt;span class="nv"&gt;$password&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nv"&gt;$password_file&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /dev/null
    log &lt;span class="s2"&gt;"Set password for user &lt;/span&gt;&lt;span class="nv"&gt;$username&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

    &lt;span class="c"&gt;# Add user to additional groups&lt;/span&gt;
    &lt;span class="nv"&gt;IFS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;','&lt;/span&gt; &lt;span class="nb"&gt;read&lt;/span&gt; &lt;span class="nt"&gt;-ra&lt;/span&gt; group_array &lt;span class="o"&gt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$groups&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="k"&gt;for &lt;/span&gt;group &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;group_array&lt;/span&gt;&lt;span class="p"&gt;[@]&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
        &lt;/span&gt;&lt;span class="nv"&gt;group&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$group&lt;/span&gt; | xargs&lt;span class="si"&gt;)&lt;/span&gt;
        &lt;span class="c"&gt;# Create group if it doesn't exist&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; getent group &lt;span class="nv"&gt;$group&lt;/span&gt; &amp;amp;&amp;gt;/dev/null&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
            &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;groupadd &lt;span class="nv"&gt;$group&lt;/span&gt;
            log &lt;span class="s2"&gt;"Created group &lt;/span&gt;&lt;span class="nv"&gt;$group&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
        &lt;span class="k"&gt;fi
        &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nt"&gt;-G&lt;/span&gt; &lt;span class="nv"&gt;$group&lt;/span&gt; &lt;span class="nv"&gt;$username&lt;/span&gt;
        log &lt;span class="s2"&gt;"Added user &lt;/span&gt;&lt;span class="nv"&gt;$username&lt;/span&gt;&lt;span class="s2"&gt; to group &lt;/span&gt;&lt;span class="nv"&gt;$group&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="k"&gt;done

done&lt;/span&gt; &amp;lt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$input_file&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before the loop, a variable called &lt;code&gt;line_number&lt;/code&gt; is defined as 0. This variable will be used as a form of error handling to note any lines in the input file that does not have a username or a group defined.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;IFS=';'&lt;/code&gt; sets the field separator to semicolon because the user and group names are separated by a semicolon. &lt;code&gt;read -r username groups&lt;/code&gt; reads a line, splitting it into username and groups variables. Leading and trailing whitespaces are removed from username and groups using &lt;code&gt;xargs&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;line_number=$((line_number + 1))&lt;/code&gt; increases by 1 at the start of each iteration in order to reference the current line number in the error logs and notifications.&lt;/p&gt;

&lt;p&gt;The script then goes on to check if the username or groupname is present in the file and sends an error message to the log file and also notifies you on the command line about which line has the error. The script then goes on to the next line to run the script. It also checks whether or not a user has already been created and skips that user to the next.&lt;/p&gt;

&lt;p&gt;After that it creates the user's personal group, creates the user with a home directory and permissions set to 700 to only allow the owner access to it, and sets a random password for the user.&lt;/p&gt;

&lt;p&gt;The script also handles multiple group assignments in the instance where a user is to join multiple groups. This is separated in the input file by a comma delimiter. The script loops through the array of &lt;code&gt;groups&lt;/code&gt; and creates the groups if they don't exist and adds the user to each specified group.&lt;/p&gt;

&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;

&lt;p&gt;To use the script, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo chmod&lt;/span&gt; +x create_users.sh
./create_users.sh input_file.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where input_file.txt contains lines in the format&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;username;group1,group2,group3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Security Considerations
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;The user running the script must have sudo privileges&lt;/li&gt;
&lt;li&gt;Passwords are stored in a file with restricted permissions.&lt;/li&gt;
&lt;li&gt;Random passwords are generated using OpenSSL for better security.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This bash script provides a powerful and flexible way to automate user and group creation in Linux systems. By handling various scenarios and providing detailed logging, it simplifies the process of managing multiple user accounts, making it an invaluable tool for system administrators.&lt;/p&gt;

&lt;p&gt;This is a practical example of the skills developed at &lt;a href="https://hng.tech/hire"&gt;HNG&lt;/a&gt;, where participants learn to create efficient, scalable solutions for real-world problems.&lt;br&gt;
Register for the &lt;a href="https://hng.tech/internship"&gt;HNG internship&lt;/a&gt; to develop these skills.&lt;/p&gt;

</description>
      <category>bash</category>
      <category>automation</category>
      <category>linux</category>
      <category>devops</category>
    </item>
    <item>
      <title>How to Create an Azure Kubernetes Cluster and Deploy an Application Using Azure CLI</title>
      <dc:creator>Sarah Aligbe</dc:creator>
      <pubDate>Fri, 19 May 2023 01:08:40 +0000</pubDate>
      <link>https://forem.com/sarahligbe/how-to-create-an-azure-kubernetes-cluster-and-deploy-an-application-using-azure-cli-1aoj</link>
      <guid>https://forem.com/sarahligbe/how-to-create-an-azure-kubernetes-cluster-and-deploy-an-application-using-azure-cli-1aoj</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Azure Kubernetes Service (AKS) cluster is a managed container orchestration platform provided by Microsoft Azure. It enables the deployment, scaling, and management of containerized applications using Kubernetes.&lt;/p&gt;

&lt;p&gt;Kubernetes is an open-source container orchestration system that helps you manage and automate the deployment, scaling, and management of containerized applications.&lt;/p&gt;

&lt;p&gt;AKS clusters simplify the deployment and management of applications by abstracting away the underlying infrastructure complexities. They offer benefits such as automatic scaling, load balancing, and high availability. AKS clusters provide a reliable and scalable environment for running containerized applications on Azure.&lt;/p&gt;

&lt;p&gt;Azure CLI (Command-Line Interface) is a powerful command-line tool for managing Azure resources. It provides a convenient and efficient way to interact with Azure services, including the creation and management of AKS clusters. Azure CLI offers a consistent experience across platforms and can be easily scripted, allowing for automation and streamlined workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pre-requisites
&lt;/h2&gt;

&lt;p&gt;Before diving into creating an AKS cluster and deploying applications, ensure you have the following prerequisites in place:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://azure.microsoft.com/en-us/free/"&gt;An Azure subscription:&lt;/a&gt; Sign up for an Azure account if you don't have one.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://learn.microsoft.com/en-us/cli/azure/install-azure-cli"&gt;Azure CLI installed&lt;/a&gt;: Install Azure CLI on your local machine.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://kubernetes.io/docs/tasks/tools/"&gt;Kubectl installed&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Working knowledge of Kubernetes.&lt;/li&gt;
&lt;li&gt;Authenticate Azure CLI with your Azure account by running the command below and following the prompts:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Setting up an AKS Cluster
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1.&lt;/strong&gt; Create a resource group. A resource group is a logical container that holds related Azure resources.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az group create --name &amp;lt;resource-group-name&amp;gt; --location &amp;lt;azure-region&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S3d7PB9F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gppss6641ex7v5cwe4ns.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S3d7PB9F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gppss6641ex7v5cwe4ns.jpg" alt="resource group" width="700" height="169"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2.&lt;/strong&gt; Create the AKS cluster&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az aks create --resource-group &amp;lt;resource-group-name&amp;gt; \
--name &amp;lt;aks-cluster-name&amp;gt; \
--node-count 2 \
--generate-ssh-keys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;--resource-group&lt;/code&gt;: Specifies the name of the resource group where the AKS cluster will be created. Replace  with the desired name of the resource group.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--name&lt;/code&gt;: Specifies the name of the AKS cluster to be created. Replace  with the desired name of the AKS cluster.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--node-count&lt;/code&gt;: Specifies the number of nodes (virtual machines) that should be provisioned in the AKS cluster. In this example, we have set the node count to 2, but you can adjust it based on your application requirements.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--generate-ssh-keys&lt;/code&gt;: Generates SSH public and private keys to be used for accessing the cluster nodes. This parameter simplifies the process of managing SSH keys. Azure CLI will automatically generate the keys and configure them for you.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hrFJ7EvK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/asb4znksc0rswpw9iqwo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hrFJ7EvK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/asb4znksc0rswpw9iqwo.jpg" alt="create aks" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pM1CNNk0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0i6q6zxxofrsgqkkxsyn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pM1CNNk0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0i6q6zxxofrsgqkkxsyn.jpg" alt="aks successful" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3.&lt;/strong&gt; Get cluster credentials&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az aks get-credentials --name &amp;lt;aks-cluster-name&amp;gt; --resource-group &amp;lt;resource-group-name 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By executing this command, Azure CLI retrieves the necessary credentials, including the Kubernetes cluster endpoint and authentication token, and configures the Kubernetes context on your local machine. This allows you to interact with the AKS cluster using Kubernetes command-line tools (kubectl) or any other Kubernetes client.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tOqlv7sz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e2gqm35itqi9jazum4z2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tOqlv7sz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e2gqm35itqi9jazum4z2.jpg" alt="aks cluster credentials" width="764" height="35"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can run &lt;code&gt;kubectl get nodes&lt;/code&gt; to see the nodes in your cluster.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4.&lt;/strong&gt; Clone the azure voting app github repo &lt;a href="https://github.com/Azure-Samples/azure-voting-app-redis"&gt;here&lt;/a&gt;.&lt;br&gt;
The repo already has the Kubernetes deployment and service files needed to deploy the application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5.&lt;/strong&gt; Deploy the application. &lt;br&gt;
A Kubernetes manifest file containing all the deployments and services is in the azure-vote-all-in-one-redis.yml file. To deploy this manifest, run this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f azure-vote-all-in-one-redis.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ytxn_XJE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wfglxvks1tqrhb1l4vuy.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ytxn_XJE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wfglxvks1tqrhb1l4vuy.jpg" alt="kubectl apply" width="800" height="81"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6.&lt;/strong&gt; Visit your deployed site&lt;br&gt;
The azure voting frontend has a service type of LoadBalancer, in order to visit your newly deployed site run the following command to get the external IP address of the LoadBalancer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get service --watch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The --watch flag is added because the external IP address takes a little while before it is added to the LoadBalancer so instead of running the command multiple times, just add the watch flag to watch for any changes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8WHvQUnc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3gnkj0o4au3c8obdk9vv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8WHvQUnc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3gnkj0o4au3c8obdk9vv.jpg" alt="loadbalancer external ip" width="592" height="78"&gt;&lt;/a&gt;&lt;br&gt;
Copy the external IP and paste in your web browser to see the azure voting app website.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---MRAiHhY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x9wjchxqyxz2wajbokh1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---MRAiHhY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x9wjchxqyxz2wajbokh1.jpg" alt="live site" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 7. Clean up your resources&lt;br&gt;
It is important to clean up resources when you no longer have use for them to avoid incurring charges. To delete your resources, simply delete the resource group with the command below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az group delete --name &amp;lt;resource-group-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Throughout this article, we covered key steps for creating an AKS cluster and deploying applications using Azure CLI. We created a resource group, an AKS cluster, and deployed the Azure voting application to our cluster.&lt;/p&gt;

&lt;p&gt;By leveraging Azure CLI and the power of AKS clusters, you can efficiently deploy and manage your applications on Azure, taking advantage of the scalability and flexibility of Kubernetes. Happy exploring and deploying your applications on Azure&lt;/p&gt;

</description>
      <category>devops</category>
      <category>azure</category>
      <category>kubernetes</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How To Create an Azure Static Web App</title>
      <dc:creator>Sarah Aligbe</dc:creator>
      <pubDate>Wed, 12 Apr 2023 23:03:01 +0000</pubDate>
      <link>https://forem.com/sarahligbe/how-to-create-an-azure-static-web-app-2m63</link>
      <guid>https://forem.com/sarahligbe/how-to-create-an-azure-static-web-app-2m63</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;For week 2 at SheCode Africa Cloud School, we were asked to create an Azure static web app. &lt;/p&gt;

&lt;p&gt;Azure Static Web Apps is a service offered by Microsoft Azure that allows developers to deploy and host static web applications quickly and easily. Static web applications are web applications that do not require server-side code, which makes them faster and easier to deploy than traditional web applications.&lt;/p&gt;

&lt;p&gt;The purpose of this article is to provide a step-by-step guide on how to create an Azure Static Web App. This guide will cover the prerequisites, creating the app, and deploying it. By the end of this article, you should have a good understanding of how to create an Azure Static Web App and how to deploy your static web applications quickly and easily using Microsoft Azure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pre-requisites
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Microsoft Azure account.&lt;/li&gt;
&lt;li&gt;A Github repository. You'll need to have your web app's source code in this repository, and you'll need to connect this repository to your Azure Static Web App to enable automated deployments.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Steps to Create an Azure Static Web App
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Sign in to your Azure account, search 'Static Web Apps' in the search bar and select it.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YS-8AGtA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xev1q64lgqmsx57grrbd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YS-8AGtA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xev1q64lgqmsx57grrbd.jpg" alt="search static web apps" width="800" height="441"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the Static Web Apps page, click the create button.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RsvohN8---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pck67uywn9v09xf2377b.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RsvohN8---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pck67uywn9v09xf2377b.jpg" alt="click create" width="800" height="356"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select a subscription, a resource group, and name your Static Web App.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5f1A-BFz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cv394298j9l4ed1wlls6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5f1A-BFz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cv394298j9l4ed1wlls6.jpg" alt="name your web app" width="800" height="279"&gt;&lt;/a&gt;&lt;br&gt;
An Azure subscription provides access to Azure resources and to track usage and costs, while an Azure resource group is used to organize and manage related resources within a subscription.&lt;br&gt;
If you do not have a pre-existing resource group, click create new to create a new resource group. All Azure resources must be created within a resource group.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select your plan type, region, and source&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--s3OruvEX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xhd0k9nlj4ki7ngd7p8a.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--s3OruvEX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xhd0k9nlj4ki7ngd7p8a.jpg" alt="select your region and source" width="800" height="340"&gt;&lt;/a&gt;&lt;br&gt;
Your plan type should be free.&lt;br&gt;
It is important to select a region closest to you because the closer the region is to your location, the lower the latency or delay in communication between your application and the Azure resources. This can result in faster application performance, lower response times, and better user experiences. &lt;br&gt;
You can visit this website &lt;a href="https://www.azurespeed.com/Azure/Latency"&gt;https://www.azurespeed.com/Azure/Latency&lt;/a&gt; to tests latency from your IP location to Azure datacenters worldwide. The region with the lowest average latency in milliseconds is the closest region to you.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--he1X7DJ_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/escxxg0r2osibbkus43q.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--he1X7DJ_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/escxxg0r2osibbkus43q.jpg" alt="latency" width="800" height="146"&gt;&lt;/a&gt;&lt;br&gt;
Select sign in with Github and authorize Azure's access to your Github account.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select your Github organization (your account), the repository housing your source code and the branch&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UpSXn-2W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g6hddhsj62662hbmlgka.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UpSXn-2W--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g6hddhsj62662hbmlgka.jpg" alt="select your github repo" width="800" height="345"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the Build details section, add configurations specific to your application&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bNsH33Js--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9nhtocu04qo0apbndxh1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bNsH33Js--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9nhtocu04qo0apbndxh1.jpg" alt="build details" width="800" height="452"&gt;&lt;/a&gt;&lt;br&gt;
Select Custom in the Build presets since the application is not using any framework.&lt;br&gt;
Select the root directory ("/") since the index.html file of the application is in the root directory. This may be different for you.&lt;br&gt;
Leave the rest of the configurations empty.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click Preview workflow file to view the Github Actions workflow file generated by Azure.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--E5ib4kRQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3a701vqyn29ly6ku15by.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--E5ib4kRQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3a701vqyn29ly6ku15by.jpg" alt="github actions workflow file" width="800" height="183"&gt;&lt;/a&gt;&lt;br&gt;
Azure automatically generates one and pushes it to your Github repository. This file is used to automate the deployment of your app to Azure whenever changes are pushed to the specified branch of your GitHub repository.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click Review+Create&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0onyQhxF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sx9dlgs12hucg0pva8o9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0onyQhxF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sx9dlgs12hucg0pva8o9.jpg" alt="review and create" width="800" height="98"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The deployment takes a few minutes and when it is complete, click Go to resource&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wmQN6344--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6p5emqil99234o2swd93.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wmQN6344--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6p5emqil99234o2swd93.jpg" alt="go to resource" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3UCWcN5q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/77w98vsi1ult9ayb9o2x.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3UCWcN5q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/77w98vsi1ult9ayb9o2x.jpg" alt="resource" width="800" height="246"&gt;&lt;/a&gt;&lt;br&gt;
Copy the URL link to see your application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--exiUQ2mX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ok9kkn4h3tfdks2te6lm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--exiUQ2mX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ok9kkn4h3tfdks2te6lm.jpg" alt="live application" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;To wrap up, I hope this article has been helpful in guiding you through the process of creating an Azure Static Web App. By following the steps outlined in this article, you can quickly and easily deploy your own static web app in Azure.&lt;/p&gt;

&lt;p&gt;Remember to select a region closest to you when deploying resources in Azure, and take advantage of Azure subscriptions and resource groups to manage costs and resources.&lt;/p&gt;

&lt;p&gt;If you're interested in learning more about Azure Static Web Apps or other Azure services, Microsoft provides a wealth of documentation and resources for getting started. Some additional resources and links for further learning include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Microsoft Learn: &lt;a href="https://learn.microsoft.com"&gt;https://learn.microsoft.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>azure</category>
      <category>cloud</category>
      <category>devops</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to Create an AWS S3 Bucket</title>
      <dc:creator>Sarah Aligbe</dc:creator>
      <pubDate>Sun, 09 Apr 2023 13:54:02 +0000</pubDate>
      <link>https://forem.com/sarahligbe/how-to-create-an-aws-s3-bucket-41nf</link>
      <guid>https://forem.com/sarahligbe/how-to-create-an-aws-s3-bucket-41nf</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Amazon Simple Storage Service (S3) is a cloud-based storage service provided by Amazon Web Services (AWS). It is designed to store and retrieve any amount of data, from anywhere in the world, at any time. S3 provides a simple web interface that can be used to store and retrieve data objects using standard HTTP or HTTPS protocols. It can be used for a wide range of applications, such as storing backup data, hosting static websites, and serving as a content repository for web and mobile applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pre-requisites
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;An AWS account&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Steps to create an S3 Bucket
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Log in to your AWS account and search for S3 in the search bar
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vUGhuta1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/42ju22jcaq4ewweygkoe.jpg" alt="search s3" width="800" height="397"&gt;
&lt;/li&gt;
&lt;li&gt;Navigate to the S3 page and click "Create bucket" 
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ArOSqKzu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/abt369vr6fje0itxdagw.jpg" alt="click create bucket" width="800" height="412"&gt; &lt;/li&gt;
&lt;li&gt;Choose a unique name for your S3 bucket and select the region in which you want to create your bucket.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uiseGEdg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7x4mg2u5qkw2pxxm4lyy.jpg" alt="name your bucket" width="800" height="362"&gt;
It is required that no two AWS S3 buckets have the same name. If you choose a name that is already taken, you will not be able to create your bucket, and you will need to choose a different name.&lt;/li&gt;
&lt;li&gt;Leave the Object ownership ACL as disabled
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o3DJZXdq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/504qz11xenpb95uibedz.jpg" alt="object ownership" width="800" height="381"&gt;
Object ACLs are used to set permissions on individual objects within the bucket. You can use object ACLs to grant read, write, or delete access to specific users, groups, or AWS accounts.&lt;/li&gt;
&lt;li&gt;You can choose to enable or disable public access. 
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fsRQhxLn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l3vuzyljnrpw6j1l0gpu.jpg" alt="block public access" width="800" height="419"&gt;
Public access is disabled by default in AWS S3 buckets to help prevent unauthorized access to your data. When public access is enabled, anyone on the internet can access the data in your S3 bucket, which can put your data at risk.
You can always edit it later to enable public access.&lt;/li&gt;
&lt;li&gt;You can choose to enable or disable bucket versioning
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XHr_mQLf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y2xhskjkgml871yzreob.jpg" alt="bucket versioning" width="800" height="362"&gt;
Bucket versioning is important in AWS S3 because it provides a way to protect against accidental deletion or overwriting of objects in your bucket. With versioning enabled, you are able to recover previous versions of the object if it is accidentally deleted or modified.
We'll leave ours as disabled just for test purposes.&lt;/li&gt;
&lt;li&gt;Leave the rest of the configurations as is and click create bucket.&lt;/li&gt;
&lt;li&gt;To upload objects into your bucket, click on your bucket, and click upload
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g7y5-DVf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kan59ikqz4r55ah4khb0.jpg" alt="upload objects" width="800" height="407"&gt;
You can then drag and drop your objects into your bucket.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Deleting an S3 bucket
&lt;/h2&gt;

&lt;p&gt;It is important to delete resources when you're done using them. To delete an S3 bucket, you must first empty the bucket of its objects and then delete it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, AWS S3 offers a wide range of capabilities for storing and managing data in the cloud.&lt;br&gt;
By following the steps outlined in this article, you can create an S3 bucket, upload objects to it, and manage access control to ensure that your data is secure and available. Additionally, it's important to regularly review your AWS environment and delete resources that are no longer needed, to optimize your cloud environment for cost, security, and compliance.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>s3</category>
      <category>cloud</category>
      <category>devops</category>
    </item>
    <item>
      <title>How To Create an EC2 Instance on AWS</title>
      <dc:creator>Sarah Aligbe</dc:creator>
      <pubDate>Fri, 07 Apr 2023 23:17:15 +0000</pubDate>
      <link>https://forem.com/sarahligbe/how-to-create-an-ec2-instance-on-aws-j4e</link>
      <guid>https://forem.com/sarahligbe/how-to-create-an-ec2-instance-on-aws-j4e</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;For week 1 at She Code Africa Cloud School, we were required to write an article to document the process of creating an AWS EC2 instance.&lt;br&gt;
An EC2 (Elastic Compute Cloud) instance is a virtual machine hosted on AWS that allows users run their applications.&lt;br&gt;
EC2 instances are highly scalable, flexible, and customizable, allowing users to configure the instances to meet their specific needs. With EC2 instances, users can quickly launch new instances, change the instance type, increase or decrease storage capacity, and scale their applications up or down to meet changes in demand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pre-requisites
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;An AWS account&lt;/li&gt;
&lt;li&gt;Familiarity with the AWS management console&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Creating an EC2 Instance
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Log into your AWS account, search EC2 in the search bar, and click on it.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VKo90QW9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7thp08j3c8d1wzi725ia.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VKo90QW9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7thp08j3c8d1wzi725ia.jpg" alt="EC2 search" width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the EC2 dashboard select instances&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ed6iYbEH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/av33d7symqr6khugi1hi.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ed6iYbEH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/av33d7symqr6khugi1hi.jpg" alt="select instances" width="800" height="344"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click Launch instances&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lWXw85IK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lbu7dpgf5m64zvrk4djc.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lWXw85IK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lbu7dpgf5m64zvrk4djc.jpg" alt="launch instance" width="800" height="300"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Give your instance a name&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jbMMVhld--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iykj0ftrtwn69h3w9bep.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jbMMVhld--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iykj0ftrtwn69h3w9bep.jpg" alt="instance name" width="800" height="277"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select the appropriate AMI for your instance&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ccjAxCOQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/apsd880mx1fwgyhpgkcp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ccjAxCOQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/apsd880mx1fwgyhpgkcp.jpg" alt="AMI" width="800" height="352"&gt;&lt;/a&gt;&lt;br&gt;
An Amazon Machine Image (AMI) is a pre-configured virtual machine image that is used to create EC2 instances. It is a fundamental building block in the EC2 service as it enables users to easily and quickly launch an instance that is pre-configured with their desired operating system and application stack, saving significant time and effort in configuring and deploying new instances.&lt;br&gt;
We will be using the Ubuntu 20.04 AMI for this instance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select an instance type and a key pair&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X2PIeJdh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/75shr1lim071xvkdtgux.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X2PIeJdh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/75shr1lim071xvkdtgux.jpg" alt="instance type and key pair" width="800" height="308"&gt;&lt;/a&gt;&lt;br&gt;
An Instance type is a specification for the virtual hardware of an EC2 instance. It determines the amount of CPU, memory, storage, and networking capacity that an EC2 instance has.&lt;br&gt;
You can choose the instance type to use based on your specific workload.&lt;br&gt;
AWS offers certain instance types as part of its free tier such t2.micro and t3.micro.&lt;br&gt;&lt;br&gt;
A key pair  is a set of security credentials that are used to securely authenticate a user's login credentials to an EC2 instance. It consists of two parts: a public key and a private key. The public key is shared with the instance, while the private key is kept secure by the user.&lt;br&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--c4NX06Sj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tcjmwssg1md2k55b1rqe.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c4NX06Sj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tcjmwssg1md2k55b1rqe.jpg" alt="key pair" width="800" height="343"&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
AWS key pairs can be downloaded in .pem or .ppk formats. &lt;br&gt;
The .pem format is commonly used with SSH clients on Unix/Linux systems.&lt;br&gt;
The .ppk file format is a proprietary format used by PuTTY, a popular SSH client for Windows.&lt;br&gt;&lt;br&gt;
It is important to keep your private keys secure and should not be shared with others as anyone with access to your private key can gain access to your instance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enter your preferred network settings&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4ENxy1Ja--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7l7smiacf0gxuf8m3gxz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4ENxy1Ja--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7l7smiacf0gxuf8m3gxz.jpg" alt="network settings" width="800" height="326"&gt;&lt;/a&gt;&lt;br&gt;
Your network settings include setting your VPC (Virtual Private Cloud) which is a virtual network infrastructure provided by AWS that allows users to launch resources in a logically isolated section of the AWS Cloud. &lt;br&gt;
Your VPC enables you to create your own IP address ranges, subnets, route tables, security groups, etc.&lt;br&gt;
AWS assigns a default VPC to every account, we'll use the default VPC and create a new security group that only allows SSH access to the instance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select the number of instances you want to create and review your selection&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6fKfeYIh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sqb33w1v0pj0k1w9a2vj.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6fKfeYIh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sqb33w1v0pj0k1w9a2vj.jpg" alt="review" width="488" height="555"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click launch instance&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UP0bLg69--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sf3dn3lgu89cz194di0m.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UP0bLg69--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sf3dn3lgu89cz194di0m.jpg" alt="successful" width="800" height="154"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The instance is running and has passed the checks&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--soXxiNI9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b2qmnopv5i0v1nabx8ex.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--soXxiNI9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b2qmnopv5i0v1nabx8ex.jpg" alt="running instance" width="800" height="196"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, we discussed how to create an EC2 instance on AWS. We covered the basic steps involved in launching an EC2 instance, including selecting an Amazon Machine Image (AMI), choosing an instance type, configuring security settings, and creating a key pair to connect to the instance.&lt;br&gt;
We also discussed some important concepts related to EC2 instances, such as instance types, key pairs, and the free tier offering. Additionally, we provided a brief overview of VPCs and their importance in creating a secure and isolated environment in the cloud.&lt;br&gt;
If you are new to AWS or cloud computing, creating an EC2 instance can be a great way to get started and learn about the benefits of cloud computing.&lt;br&gt;
So, if you're interested in trying it out for yourself, sign up for an AWS account and launch your own EC2 instance today.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
