<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Swaroop Shinde on Medium]]></title>
        <description><![CDATA[Stories by Swaroop Shinde on Medium]]></description>
        <link>https://medium.com/@swaroop751?source=rss-bc38df034f4a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*e9V_RoA_oEZIPAzhB23sYw.jpeg</url>
            <title>Stories by Swaroop Shinde on Medium</title>
            <link>https://medium.com/@swaroop751?source=rss-bc38df034f4a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 01:20:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@swaroop751/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Empowering Industries with Continuous Integration and Continuous Deployment]]></title>
            <link>https://swaroop751.medium.com/empowering-industries-with-continuous-integration-and-continuous-deployment-d93dbc7e680c?source=rss-bc38df034f4a------2</link>
            <guid isPermaLink="false">https://medium.com/p/d93dbc7e680c</guid>
            <dc:creator><![CDATA[Swaroop Shinde]]></dc:creator>
            <pubDate>Sat, 29 Jul 2023 05:00:28 GMT</pubDate>
            <atom:updated>2023-07-29T05:00:28.755Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s fast-paced and highly competitive software development landscape, the need for continuous integration and continuous deployment (CI/CD) has become paramount. Jenkins, an open-source automation server, has emerged as a powerful tool that enables organizations to streamline their software development and delivery processes. In this article, we will explore the industry use cases of Jenkins and delve into how it works to revolutionize the software development life cycle.</p><p>Industry Use Cases of Jenkins</p><p>1. Software Development: Jenkins is widely used across industries for automating software development processes. It seamlessly integrates with version control systems like Git, enabling developers to trigger builds automatically whenever new code is committed. By automating the build, test, and deployment stages, Jenkins significantly reduces manual intervention, accelerates development cycles, and ensures consistent, reliable results.</p><p>2. Continuous Integration and Testing: In industries where quality and stability are crucial, Jenkins facilitates continuous integration and testing. It automates the process of merging code from multiple developers, running unit tests, and generating reports. This ensures that any code changes are continuously tested for bugs, enabling early detection and resolution of issues.</p><p>3. DevOps and Collaboration: Jenkins is a fundamental tool for implementing DevOps practices. It fosters collaboration between development and operations teams by automating the integration and deployment of code changes. This collaborative approach improves communication, minimizes bottlenecks, and accelerates the software delivery pipeline.</p><p>4. Mobile App Development: For industries focusing on mobile app development, Jenkins plays a crucial role in streamlining the build and testing processes. It supports various mobile platforms and emulators, allowing developers to automate app building, testing, and distribution across multiple devices effortlessly.</p><p>5. Cloud Computing and Containers: Jenkins is an ideal choice for organizations leveraging cloud computing and container technologies. It can automate the deployment of applications to cloud platforms like AWS, Azure, or Google Cloud, as well as container orchestration platforms like Kubernetes. This ensures smooth, scalable deployments in cloud-native environments.</p><p>How Jenkins Works</p><p>1. Installation and Configuration: Jenkins can be installed on various operating systems, including Windows, macOS, and Linux. After installation, it can be accessed through a web interface. Users can configure Jenkins by installing plugins to extend its functionality and tailor it to their specific needs.</p><p>2. Jobs and Pipelines: Jenkins revolves around the concept of jobs, which are individual tasks or processes. Jobs can be created to perform specific tasks like building, testing, or deploying applications. For complex workflows, Jenkins uses pipelines, which define a series of stages and steps that are executed sequentially.</p><p>3. Integration with Version Control: Jenkins integrates seamlessly with popular version control systems like Git, SVN, and others. It can automatically trigger builds whenever code changes are pushed to the version control repository, ensuring continuous integration.</p><p>4. Build and Test Automation: Jenkins provides a wide range of plugins and integrations with build tools and testing frameworks. It can execute build scripts, run tests, and generate reports automatically. The build and test results are displayed on the Jenkins dashboard for easy monitoring.</p><p>5. Continuous Deployment: Jenkins allows organizations to implement continuous deployment by automating the process of deploying applications to various environments, such as staging and production. This reduces manual errors and ensures consistent deployments across different environments.</p><p>Conclusion</p><p>Jenkins has become a foundational tool in the software development landscape, empowering industries to embrace CI/CD practices and accelerate their delivery pipelines. Its versatility and extensive plugin ecosystem enable seamless integration with various technologies, making it the go-to automation server for organizations across diverse industries. As software development continues to evolve, Jenkins will continue to play a crucial role in ensuring efficiency, collaboration, and agility in the software development life cycle.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d93dbc7e680c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a menu-based Python program that integrates multiple technologies will allow users to…]]></title>
            <link>https://swaroop751.medium.com/creating-a-menu-based-python-program-that-integrates-multiple-technologies-will-allow-users-to-dfbf2be998b?source=rss-bc38df034f4a------2</link>
            <guid isPermaLink="false">https://medium.com/p/dfbf2be998b</guid>
            <dc:creator><![CDATA[Swaroop Shinde]]></dc:creator>
            <pubDate>Sat, 29 Jul 2023 04:59:22 GMT</pubDate>
            <atom:updated>2023-07-29T04:59:22.178Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python Menu-based program</h3><p>Creating a menu-based Python program that integrates multiple technologies will allow users to interact with various features and functionalities. In this example, we’ll create a simple menu-based program that incorporates file handling, web scraping, and API integration. The user will be able to choose from different options, and the program will execute the corresponding technology.</p><p>Let’s start with the implementation:</p><p>```python<br>import requests<br>from bs4 import BeautifulSoup</p><p>def display_menu():<br> print(“\nMenu:”)<br> print(“1. Read data from a file”)<br> print(“2. Write data to a file”)<br> print(“3. Web Scraping”)<br> print(“4. API Integration”)<br> print(“5. Exit”)</p><p>def read_data_from_file():<br> try:<br> filename = input(“Enter the name of the file to read: “)<br> with open(filename, ‘r’) as file:<br> data = file.read()<br> print(“\nData from the file:”)<br> print(data)<br> except FileNotFoundError:<br> print(“Error: File not found.”)</p><p>def write_data_to_file():<br> try:<br> filename = input(“Enter the name of the file to write: “)<br> data = input(“Enter the data to write to the file: “)<br> with open(filename, ‘w’) as file:<br> file.write(data)<br> print(“Data written to the file successfully.”)<br> except Exception as e:<br> print(f”Error: {e}”)</p><p>def web_scraping():<br> try:<br> url = input(“Enter the URL to scrape: “)<br> response = requests.get(url)<br> soup = BeautifulSoup(response.text, ‘html.parser’)<br> title = soup.title.text.strip()<br> print(f”\nTitle of the page: {title}”)<br> except Exception as e:<br> print(f”Error: {e}”)</p><p>def api_integration():<br> try:<br> api_key = input(“Enter your API key: “)<br> url = f”<a href="https://api.example.com/data?key={api_key">https://api.example.com/data?key={api_key</a>}&quot;<br> response = requests.get(url)<br> data = response.json()<br> print(“\nData from the API:”)<br> print(data)<br> except Exception as e:<br> print(f”Error: {e}”)</p><p>if __name__ == “__main__”:<br> while True:<br> display_menu()<br> choice = input(“Enter your choice (1–5): “)</p><p>if choice == “1”:<br> read_data_from_file()<br> elif choice == “2”:<br> write_data_to_file()<br> elif choice == “3”:<br> web_scraping()<br> elif choice == “4”:<br> api_integration()<br> elif choice == “5”:<br> print(“Exiting the program.”)<br> break<br> else:<br> print(“Invalid choice. Please try again.”)<br>```</p><p>In this example, the menu-based program provides options for reading data from a file, writing data to a file, web scraping a URL, and integrating with an API. The user can choose a specific option by entering the corresponding number. Depending on the choice, the program will execute the appropriate function. The program continues to display the menu until the user selects the “5” option to exit.</p><p>Note: Please make sure to replace the placeholder URL in the `api_integration()` function with the actual API URL you want to integrate with. Additionally, ensure that you have installed the necessary libraries `requests` and `beautifulsoup4` for web scraping.</p><p>This example demonstrates how you can integrate different technologies into a menu-based Python program, allowing users to interact with various functionalities conveniently. Feel free to extend the program with additional technologies or features based on your requirements and interests.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dfbf2be998b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a live streaming video chat app without voice using the `cv2` (OpenCV) module in Python…]]></title>
            <link>https://swaroop751.medium.com/creating-a-live-streaming-video-chat-app-without-voice-using-the-cv2-opencv-module-in-python-ea7559fc4c48?source=rss-bc38df034f4a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea7559fc4c48</guid>
            <dc:creator><![CDATA[Swaroop Shinde]]></dc:creator>
            <pubDate>Sat, 29 Jul 2023 04:58:13 GMT</pubDate>
            <atom:updated>2023-07-29T04:58:13.177Z</atom:updated>
            <content:encoded><![CDATA[<h3>Live Streaming Video Chat App without voice using cv2 module of Python.</h3><p>Creating a live streaming video chat app without voice using the `cv2` (OpenCV) module in Python involves capturing video frames from the camera, displaying them on the screen, and sending the frames to a remote client for viewing. For simplicity, we will use the `socket` module to establish a basic client-server connection for streaming video frames.</p><p>Please note that this is a basic example and does not include error handling or encryption, which should be considered for a production-level application.</p><p>Let’s create the server-side code first:</p><p>```python<br># server.py<br>import cv2<br>import socket<br>import pickle<br>import struct</p><p>def send_frame(conn, frame):<br> data = pickle.dumps(frame)<br> message_size = struct.pack(“L”, len(data))<br> conn.sendall(message_size + data)</p><p>def start_server():<br> server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<br> server_socket.bind((“0.0.0.0”, 5000))<br> server_socket.listen(5)<br> print(“Server started. Waiting for a connection…”)</p><p>conn, addr = server_socket.accept()<br> print(f”Connection established with {addr}”)</p><p>video_capture = cv2.VideoCapture(0)</p><p>while True:<br> ret, frame = video_capture.read()<br> if not ret:<br> break</p><p># Resize frame if needed<br> # frame = cv2.resize(frame, (640, 480))</p><p>send_frame(conn, frame)</p><p>cv2.imshow(“Server”, frame)<br> cv2.waitKey(1)</p><p>video_capture.release()<br> cv2.destroyAllWindows()</p><p>if __name__ == “__main__”:<br> start_server()<br>```</p><p>Now, let’s create the client-side code:</p><p>```python<br># client.py<br>import cv2<br>import socket<br>import pickle<br>import struct</p><p>def receive_frame(sock):<br> data = b””<br> payload_size = struct.calcsize(“L”)</p><p>while len(data) &lt; payload_size:<br> data += sock.recv(4096)</p><p>packed_msg_size = data[:payload_size]<br> data = data[payload_size:]<br> msg_size = struct.unpack(“L”, packed_msg_size)[0]</p><p>while len(data) &lt; msg_size:<br> data += sock.recv(4096)</p><p>frame_data = data[:msg_size]<br> data = data[msg_size:]<br> frame = pickle.loads(frame_data)<br> return frame</p><p>def start_client():<br> client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<br> client_socket.connect((“SERVER_IP_ADDRESS”, 5000)) # Replace with the server IP address</p><p>while True:<br> try:<br> frame = receive_frame(client_socket)<br> cv2.imshow(“Client”, frame)<br> cv2.waitKey(1)<br> except KeyboardInterrupt:<br> client_socket.close()<br> break</p><p>cv2.destroyAllWindows()</p><p>if __name__ == “__main__”:<br> start_client()<br>```</p><p>Replace `”SERVER_IP_ADDRESS”` in the client.py code with the actual IP address of the server where the server.py script is running.</p><p>To run the application, execute the server.py script on the server side and the client.py script on the client side. The server will start streaming video frames to the client, and the client will display them in a window using OpenCV.</p><p>Please note that this is just a basic example, and for a real-world application, you would need to consider additional features like handling multiple clients, adding audio support, optimizing the video stream for better performance, and implementing error handling and security measures.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea7559fc4c48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI/ML Advancements Propelling MNCs to the Pinnacle of Success]]></title>
            <link>https://swaroop751.medium.com/ai-ml-advancements-propelling-mncs-to-the-pinnacle-of-success-22759c520424?source=rss-bc38df034f4a------2</link>
            <guid isPermaLink="false">https://medium.com/p/22759c520424</guid>
            <dc:creator><![CDATA[Swaroop Shinde]]></dc:creator>
            <pubDate>Sat, 29 Jul 2023 04:57:22 GMT</pubDate>
            <atom:updated>2023-07-29T04:57:22.178Z</atom:updated>
            <content:encoded><![CDATA[<p>In the era of digital transformation, Artificial Intelligence (AI) and Machine Learning (ML) have emerged as game-changers for businesses worldwide. Multinational Corporations (MNCs) are leveraging the power of AI/ML to enhance their products, services, and overall operations, enabling them to solidify their positions as top-notch companies in this generation. In this blog, we will delve into the benefits that MNCs are gaining from AI/ML advancements, and how these technologies are propelling them to unprecedented heights of success.</p><p>1. Personalized Customer Experiences</p><p>AI/ML enables MNCs to analyze vast amounts of customer data to gain deep insights into individual preferences and behaviors. By understanding customer needs, companies can offer hyper-personalized experiences, tailoring products and services to meet specific requirements. From e-commerce recommendations to personalized marketing campaigns, AI/ML-powered MNCs create a customer-centric approach that fosters loyalty and satisfaction.</p><p>2. Enhanced Product Development</p><p>AI/ML revolutionizes product development by expediting the design and innovation process. With AI-powered data analysis and ML algorithms, MNCs can identify market trends, predict demand, and gather user feedback to inform their product roadmaps. This agility allows them to launch products that resonate with consumers, gaining a competitive edge in rapidly evolving industries.</p><p>3. Optimized Supply Chain Management</p><p>For MNCs with complex supply chains, AI/ML optimizes inventory management, demand forecasting, and logistics. Predictive analytics helps anticipate fluctuations in demand, ensuring efficient inventory levels and reducing carrying costs. ML algorithms fine-tune delivery routes, minimizing transportation time and costs, resulting in streamlined operations and improved customer satisfaction.</p><p>4. AI-Driven Decision Making</p><p>AI/ML empowers MNCs with data-driven decision-making capabilities. Advanced analytics and machine learning models process data from various sources, enabling executives to make informed choices based on real-time insights. This results in faster, more accurate decision-making, reducing risks and enhancing overall organizational efficiency.</p><p>5. Improved Customer Support</p><p>AI-powered chatbots and virtual assistants have transformed customer support for MNCs. With the ability to handle routine queries and even complex interactions, AI-driven customer support offers 24/7 availability and reduces response times significantly. This not only enhances customer satisfaction but also optimizes human resources for more strategic tasks.</p><p>6. Robust Cybersecurity</p><p>As cyber threats become increasingly sophisticated, MNCs employ AI/ML to fortify their cybersecurity defenses. AI-powered systems can analyze network traffic, detect anomalies, and proactively respond to potential security breaches. By identifying patterns indicative of malicious activities, AI/ML keeps sensitive data and operations secure, safeguarding MNCs’ reputation and customer trust.</p><p>7. AI-Enhanced Marketing</p><p>AI/ML has revolutionized marketing strategies, enabling MNCs to conduct targeted and data-driven campaigns. By analyzing customer behavior, preferences, and social media interactions, AI/ML-powered marketing identifies potential leads and optimizes advertising budgets for maximum ROI. This level of precision ensures that marketing efforts are highly effective, attracting and retaining customers efficiently.</p><p>Conclusion</p><p>As AI and ML technologies continue to evolve, MNCs are experiencing unprecedented benefits across various aspects of their operations. From personalized customer experiences to optimized supply chain management and cybersecurity, AI/ML advancements are propelling MNCs to the pinnacle of success in this generation. By embracing these transformative technologies, MNCs are staying ahead of the competition, innovating with agility, and delivering exceptional products and services to their customers. As we move further into the future, AI and ML will undoubtedly remain at the forefront of driving success for the world’s leading multinational corporations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22759c520424" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenShift: Industry Use Cases and How It Works]]></title>
            <link>https://swaroop751.medium.com/openshift-industry-use-cases-and-how-it-works-174d9665faa8?source=rss-bc38df034f4a------2</link>
            <guid isPermaLink="false">https://medium.com/p/174d9665faa8</guid>
            <dc:creator><![CDATA[Swaroop Shinde]]></dc:creator>
            <pubDate>Sat, 29 Jul 2023 04:56:13 GMT</pubDate>
            <atom:updated>2023-07-29T04:56:13.161Z</atom:updated>
            <content:encoded><![CDATA[<p>OpenShift, developed by Red Hat, is a powerful and versatile container platform that facilitates the deployment, management, and scaling of containerized applications. With the rising popularity of containerization, OpenShift has emerged as a leading solution, providing a feature-rich and robust environment for various industries. In this blog, we will explore some industry use cases of OpenShift and delve into how it works to revolutionize application development and deployment.</p><p>Use Case 1: Financial Services</p><p>The financial services sector is highly dynamic, demanding seamless and secure application delivery. OpenShift plays a critical role in this industry by enabling the rapid deployment of financial applications while maintaining strict security and compliance standards. The platform’s ability to automate application scaling ensures that financial institutions can handle spikes in user demand efficiently, offering clients a smooth user experience during peak times. Additionally, OpenShift’s built-in monitoring and analytics tools enable real-time performance tracking, aiding financial organizations in identifying and resolving issues promptly.</p><p>Use Case 2: Healthcare</p><p>In the healthcare industry, where patient data security and privacy are of utmost importance, OpenShift provides a reliable and scalable solution. Healthcare applications can be containerized, making them more portable and easier to manage across various environments. With OpenShift’s robust access control mechanisms, healthcare providers can ensure that sensitive patient data is accessible only to authorized personnel. Moreover, the platform’s ability to handle large volumes of data and support high-availability setups ensures that critical healthcare systems run smoothly, reducing downtime and improving patient care.</p><p>Use Case 3: E-commerce</p><p>E-commerce businesses often experience unpredictable spikes in traffic, especially during seasonal sales or promotional events. OpenShift’s auto-scaling capabilities enable e-commerce platforms to dynamically allocate resources based on demand, ensuring optimal performance during peak periods. The platform’s support for continuous integration and continuous deployment (CI/CD) pipelines streamlines the delivery of new features and updates, helping e-commerce businesses stay competitive in the fast-paced online market.</p><p>Use Case 4: Manufacturing</p><p>In the manufacturing industry, where IoT (Internet of Things) devices and sensors generate vast amounts of data, OpenShift offers a powerful solution for managing and processing this data. By containerizing data-driven applications, manufacturers can deploy them across edge devices, on-premises servers, or cloud environments seamlessly. OpenShift’s edge computing capabilities allow manufacturers to process data locally, reducing latency and ensuring real-time insights for critical decision-making processes.</p><p>How OpenShift Works:</p><p>1. Kubernetes Foundation: At its core, OpenShift is built on Kubernetes, an open-source container orchestration platform. Kubernetes automates the deployment, scaling, and management of containerized applications, ensuring they run consistently and efficiently across different environments.</p><p>2. Containerization: OpenShift utilizes containerization technology, allowing developers to package applications and their dependencies into portable containers. These containers ensure consistent performance, irrespective of the underlying infrastructure.</p><p>3. Developer-Friendly Interface: OpenShift provides an intuitive web-based interface and a command-line interface (CLI) that simplifies the process of creating, managing, and deploying applications. This developer-friendly approach enables faster application development and deployment cycles.</p><p>4. CI/CD Integration: OpenShift seamlessly integrates with various CI/CD tools, enabling developers to automate the software delivery pipeline. This integration facilitates continuous integration, continuous delivery, and continuous deployment, streamlining the process of releasing new features and updates.</p><p>5. Autoscaling and Load Balancing: OpenShift’s auto-scaling feature dynamically adjusts the number of application instances based on workload demand, ensuring optimal resource utilization and performance. Additionally, built-in load balancing capabilities evenly distribute traffic across application instances, preventing overloads on specific nodes.</p><p>6. Monitoring and Logging: OpenShift provides comprehensive monitoring and logging tools that enable administrators to track application performance, identify bottlenecks, and troubleshoot issues proactively.</p><p>Conclusion</p><p>OpenShift has emerged as a leading container platform, catering to diverse industry needs with its scalability, security, and developer-friendly features. Through real-world use cases in financial services, healthcare, e-commerce, and manufacturing, OpenShift has proven its ability to revolutionize application development and deployment, empowering businesses to deliver innovative solutions to their customers. With its Kubernetes foundation and extensive toolset, OpenShift remains at the forefront of modern application development, supporting organizations in their journey towards digital transformation and enhanced operational efficiency.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=174d9665faa8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS with Apache & WordPress]]></title>
            <link>https://swaroop751.medium.com/aws-with-apache-wordpress-cae1acdc3251?source=rss-bc38df034f4a------2</link>
            <guid isPermaLink="false">https://medium.com/p/cae1acdc3251</guid>
            <dc:creator><![CDATA[Swaroop Shinde]]></dc:creator>
            <pubDate>Sat, 29 Jul 2023 04:38:05 GMT</pubDate>
            <atom:updated>2023-07-29T04:38:05.296Z</atom:updated>
            <content:encoded><![CDATA[<p>To complete this task, we’ll go through the following steps:</p><p>1. Create an AWS EC2 Instance and configure Apache Web Server on it.<br>2. Download and Install WordPress on the EC2 Instance.<br>3. Set up an AWS RDS MySQL Database.<br>4. Configure WordPress to use the RDS MySQL Database.</p><p>Let’s get started:</p><p>Step 1: Create an AWS EC2 Instance and Configure Apache Web Server</p><p>1. Sign in to the AWS Management Console and navigate to the EC2 Dashboard.</p><p>2. Click on the “Launch Instance” button.</p><p>3. Choose an Amazon Machine Image (AMI) — Select an appropriate AMI, such as Ubuntu or Amazon Linux, for your EC2 Instance.</p><p>4. Choose an Instance Type — Choose the instance type based on your requirements. For this demonstration, you can choose a t2.micro instance, which is eligible for the Free Tier.</p><p>5. Configure Instance — Leave the default settings or customize them as needed.</p><p>6. Add Storage — Leave the default settings or customize them based on your requirements.</p><p>7. Add Tags — Add any relevant tags to the instance for better management.</p><p>8. Configure Security Group — Create a new security group or select an existing one to allow inbound traffic on port 80 (HTTP) and 22 (SSH) for remote access.</p><p>9. Review and Launch — Review your instance configuration and click “Launch” to create the instance.</p><p>10. Choose an existing key pair or create a new key pair to access your instance securely.</p><p>11. Once the instance is running, note down the Public IP address or Public DNS name. You will need this to access your EC2 instance.</p><p>Step 2: Download and Install WordPress on the EC2 Instance</p><p>1. Connect to your EC2 instance using SSH. You can use the following command (replace ‘your-instance-ip’ with your actual EC2 instance’s Public IP or DNS):</p><p>```<br>ssh -i /path/to/your-key.pem ec2-user@your-instance-ip<br>```</p><p>2. Update the package lists:</p><p>```<br>sudo apt update (for Ubuntu)<br>sudo yum update (for Amazon Linux)<br>```</p><p>3. Install Apache web server, PHP, and other required packages:</p><p>```<br>sudo apt install apache2 php libapache2-mod-php php-mysql (for Ubuntu)<br>sudo yum install httpd php php-mysqlnd (for Amazon Linux)<br>```</p><p>4. Download and Install WordPress:</p><p>```<br>cd /var/www/html<br>sudo wget <a href="https://wordpress.org/latest.tar.gz">https://wordpress.org/latest.tar.gz</a><br>sudo tar -xzvf latest.tar.gz<br>sudo mv wordpress/* .<br>sudo rm -r wordpress latest.tar.gz<br>```</p><p>5. Set appropriate permissions for WordPress:</p><p>```<br>sudo chown -R www-data:www-data /var/www/html<br>sudo chmod -R 755 /var/www/html<br>```</p><p>Step 3: Set up an AWS RDS MySQL Database</p><p>1. Go to the AWS RDS Dashboard and click on “Create Database.”</p><p>2. Choose the “Standard Create” option.</p><p>3. Select “MySQL” as the engine.</p><p>4. Configure the DB instance details. Choose appropriate options, and make sure to select the “Free Tier” eligible options wherever possible.</p><p>5. Set up the master username and password for the database.</p><p>6. Configure the connectivity settings and security group. Ensure that the security group allows inbound traffic from your EC2 instance on the MySQL port (default: 3306).</p><p>7. Complete the setup process and create the RDS MySQL Database.</p><p>Step 4: Configure WordPress to Use the RDS MySQL Database</p><p>1. Access your WordPress installation via a web browser using your EC2 instance’s Public IP or DNS.</p><p>2. Follow the WordPress setup wizard, entering the required information like site name, username, password, etc.</p><p>3. When prompted to set up the database, use the RDS MySQL endpoint/connection string as the database host. You can find this endpoint in the RDS Dashboard.</p><p>4. Enter the master username and password that you set up for the RDS MySQL database.</p><p>5. Complete the WordPress setup process.</p><p>Congratulations! You have now successfully set up an AWS EC2 instance with Apache Web Server, installed WordPress, and connected it to an AWS RDS MySQL Database. Your WordPress application is now up and running, utilizing the power of AWS services for efficient and scalable hosting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cae1acdc3251" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Start-up to Success : How Company X Leveraged AWS to Transform its Business]]></title>
            <link>https://swaroop751.medium.com/start-up-to-success-how-company-x-leveraged-aws-to-transform-its-business-43c9ca10bc90?source=rss-bc38df034f4a------2</link>
            <guid isPermaLink="false">https://medium.com/p/43c9ca10bc90</guid>
            <dc:creator><![CDATA[Swaroop Shinde]]></dc:creator>
            <pubDate>Sat, 29 Jul 2023 04:36:12 GMT</pubDate>
            <atom:updated>2023-07-29T04:36:12.335Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x0AfUg5WiimU8CaebFN_HQ.png" /></figure><h3>Start-up to Success : How Company X Leveraged AWS to Transform its Business</h3><p>In the rapidly evolving world of technology, cloud computing has emerged as a game-changer for businesses of all sizes. Amazon Web Services (AWS), one of the leading cloud service providers, has played a pivotal role in empowering companies to innovate, scale, and succeed. In this article, we will explore the success story of Company X, a start-up that harnessed the power of AWS to overcome challenges, drive growth, and transform into a thriving enterprise.</p><p>Company X: The Genesis</p><p>Company X, founded in 2015, began as a promising start-up with a vision to revolutionize the healthcare industry. Their flagship product, an AI-powered telemedicine platform, aimed to bridge the gap between patients and healthcare providers, delivering seamless remote healthcare services to patients worldwide. While their concept was groundbreaking, the company faced significant obstacles that threatened its growth and scalability.</p><p>Challenges Faced</p><p>1. Scalability and Performance: As the platform gained traction, Company X struggled to keep up with the increasing user demand. Their on-premises infrastructure lacked the scalability required to handle a growing number of concurrent users, resulting in performance bottlenecks and frustrating user experiences.</p><p>2. Cost Management: Traditional infrastructure costs were eating into Company X’s budget, hindering their ability to allocate resources to other critical areas like research and development.</p><p>3. Security and Compliance: Dealing with sensitive patient data, Company X had to comply with strict healthcare regulations, putting immense pressure on their IT team to ensure data security and meet compliance requirements.</p><p>The Turning Point: Embracing AWS</p><p>Recognizing the need for a robust, scalable, and cost-effective solution, Company X turned to AWS for answers. Leveraging AWS’s comprehensive suite of cloud services, they began their transformation journey.</p><p>1. Elasticity and Scalability: With AWS’s auto-scaling and load-balancing capabilities, Company X eliminated the scalability issues they once faced. The platform could now dynamically adjust resources based on demand, ensuring a seamless user experience even during peak times.</p><p>2. Cost Optimization: By moving to AWS’s pay-as-you-go model, Company X experienced significant cost savings. They no longer had to invest in expensive hardware and could focus on innovation without worrying about infrastructure management costs.</p><p>3. Security and Compliance: AWS’s robust security features, including data encryption, identity and access management, and compliance certifications, ensured that Company X could meet the stringent healthcare industry standards and protect patient data.</p><p>4. Global Reach: AWS’s global infrastructure allowed Company X to expand its telemedicine services to different regions without worrying about building data centers in each location. They could now deliver their services with low latency and high reliability to patients across the globe.</p><p>Results and Growth</p><p>The benefits of adopting AWS were evident almost immediately. Company X’s telemedicine platform experienced a surge in performance and stability, leading to increased user satisfaction and retention. With the newfound scalability, the platform could effortlessly handle thousands of concurrent users, accommodating exponential growth without any hiccups.</p><p>Financially, the switch to AWS resulted in a significant reduction in infrastructure costs. Company X could allocate resources to research and development, leading to the introduction of new features and improvements to their platform. The company’s ability to innovate at a rapid pace further solidified its position as a pioneer in the healthcare industry.</p><p>Furthermore, the enhanced security measures put in place by AWS instilled confidence in both patients and healthcare providers, attracting more users to the platform and fostering strategic partnerships with established healthcare organizations.</p><p>Conclusion</p><p>Company X’s success story exemplifies the transformative power of AWS for start-ups and enterprises alike. By embracing the cloud and harnessing the full potential of AWS services, they overcame scalability challenges, optimized costs, ensured regulatory compliance, and expanded their global reach. AWS played a pivotal role in Company X’s journey from a promising start-up to a successful, innovative leader in the healthcare industry. This inspiring tale serves as a testament to the countless possibilities that AWS offers to businesses looking to make a mark in their respective fields.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43c9ca10bc90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How industries are solving challenges using Ansible.]]></title>
            <link>https://swaroop751.medium.com/how-industries-are-solving-challenges-using-ansible-1de5d194cabc?source=rss-bc38df034f4a------2</link>
            <guid isPermaLink="false">https://medium.com/p/1de5d194cabc</guid>
            <dc:creator><![CDATA[Swaroop Shinde]]></dc:creator>
            <pubDate>Sat, 29 Jul 2023 04:31:55 GMT</pubDate>
            <atom:updated>2023-07-29T04:32:34.288Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/301/1*iw6HUoSr7LY_Y1irlnhBjw.png" /></figure><p>Ansible is an open-source automation tool that simplifies the process of IT infrastructure management, application deployment, configuration management, and task automation. It was created by Michael DeHaan and later acquired by Red Hat, Inc. It is designed to be easy to use, highly flexible, and powerful, making it a popular choice for IT professionals, developers, and organizations worldwide.</p><p>In today’s fast-paced and technology-driven world, industries face an array of challenges that require innovative solutions to thrive and succeed. One powerful tool that has emerged to tackle these obstacles is Ansible, an open-source automation platform that streamlines IT processes and empowers organizations across various sectors. In this article, we will explore how industries are leveraging Ansible to address their unique challenges and unlock unprecedented levels of efficiency, scalability, and productivity.</p><p>1. Automation in IT Operations</p><p>One of the primary areas where Ansible has made a substantial impact is in IT operations. Traditional IT infrastructure management is often labor-intensive, prone to errors, and time-consuming. Ansible revolutionizes this landscape by providing a simple yet robust framework for automating tasks such as configuration management, application deployment, and system provisioning. This automation drastically reduces manual interventions, accelerates service delivery, and enhances overall system reliability.</p><p>2. Accelerating DevOps Practices</p><p>DevOps, the collaborative approach to software development and IT operations, relies heavily on continuous integration and continuous delivery (CI/CD) pipelines. Ansible seamlessly integrates with these pipelines, enabling developers to efficiently manage code deployments and configurations across different environments. As a result, organizations can significantly reduce deployment times, enhance collaboration between teams, and foster a culture of agility and innovation.</p><p>3. Cloud Infrastructure Management</p><p>Cloud computing has become the backbone of modern business operations. However, managing complex cloud infrastructures can be daunting. Ansible simplifies this process by providing comprehensive modules to automate cloud provisioning, configuration, and resource scaling. Industries can dynamically adapt their cloud environments to changing demands, optimize resource utilization, and reduce operational costs through Ansible’s flexible automation capabilities.</p><p>4. Ensuring Security and Compliance</p><p>Security and compliance are paramount concerns for industries operating in an ever-evolving threat landscape. Ansible enables organizations to establish standardized security configurations across their entire IT infrastructure, ensuring adherence to best practices and regulatory requirements. Additionally, the platform’s “push-based” architecture allows for quick and uniform updates, reducing the window of vulnerability and enhancing overall security posture.</p><p>5. Network Automation and Orchestration</p><p>Networking is the backbone of every industry, and any inefficiencies can severely impact productivity. Ansible’s network automation capabilities help streamline configuration management, device provisioning, and troubleshooting. This drastically reduces the time required for manual network tasks, minimizes human errors, and enhances network stability, ultimately leading to improved overall network performance.</p><p>6. Scaling for High-Performance Environments</p><p>High-performance computing environments, like those found in scientific research, require robust automation solutions to handle complex computations and simulations. Ansible’s ability to manage large-scale deployments and repetitive tasks makes it a powerful ally in these scenarios. By automating resource provisioning and scaling, industries can optimize their computational capabilities, reduce time to results, and focus on pushing the boundaries of innovation.</p><p>Ansible has emerged as a game-changing automation platform that is transforming industries across the board. From IT operations to cloud management, security, and high-performance computing, Ansible empowers organizations to overcome their unique challenges and achieve new levels of efficiency and productivity. As technology continues to evolve, industries that embrace Ansible will be better equipped to adapt, innovate, and stay ahead of the competition in the dynamic and ever-changing business landscape.</p><p>Whether you’re an IT professional, a developer, or an industry leader, exploring Ansible’s capabilities can open up a world of opportunities to revolutionize your operations and create a more agile, secure, and prosperous future for your organization. Embrace Ansible, and unlock the true potential of automation in your industry!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1de5d194cabc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configure NGINX Container as Reverse Proxy for Dockerized Flask Application.]]></title>
            <link>https://swaroop751.medium.com/configure-nginx-container-as-reverse-proxy-for-dockerized-flask-application-bbfa89a8e911?source=rss-bc38df034f4a------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbfa89a8e911</guid>
            <dc:creator><![CDATA[Swaroop Shinde]]></dc:creator>
            <pubDate>Wed, 12 Oct 2022 12:47:29 GMT</pubDate>
            <atom:updated>2022-10-12T14:28:22.443Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B2HfvFVhOqtpkizINN4BRw.jpeg" /></figure><p>🔰 Hello ! I’m back here to integrate two most commonly used technologies in DevOps i.e. NGINX and Flask.</p><p>🔰 <a href="https://www.linkedin.com/posts/swaroop--shinde_%3F%3F%3F%3F%3F%3F%3F%3F%3F-%3F%3F%3F%3F%3F-%3F%3F%3F%3F%3F%3F%3F%3F%3F-activity-6985955817996890113-Ws4g?utm_source=share&amp;utm_medium=member_desktop">Click Here</a> to watch video Demonstration !</p><p>🔰 From the following article you will learn one of the easiest way to implement NGINX and Flask within Docker Container&#39;s. But before we get our hands dirty with the practical implementation. Let’s first understand few terminologies &amp; get easy tasks done first.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>🔹 Since I’ve implemented Docker several times in past few projects so will be skipping the part to explain the Docker, still if you wish to know more about it ! Then check out <a href="https://www.linkedin.com/posts/swaroop--shinde_vimaldaga-righteducation-educationredefine-activity-6862244416606801920-8x-r?utm_source=share&amp;utm_medium=member_desktop">This Article</a> where I’ve explained about docker Containers in Depth !</p><p>🔹 Let’s understand more about Flask Framework .</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h3>✅ Understanding Flask :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LP42t1o7xfXQtB7Ndz0YFQ.gif" /></figure><p><strong>✰</strong> Flask is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries. It has no database abstraction layer, form validation, or any other components where pre-existing third-party libraries provide common functions.</p><p><strong>✰</strong> In short <strong>Flask</strong> is a <strong>Python</strong> module that lets you develop web applications easily.</p><p><strong>✰ </strong>Since we’re more focused on Nginx so we won’t go in depth with respect to Flask, still as a small demonstration, Here’s a simple example to use flask hosting web app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-9AEK_PY3Q6N_pfqBGvNnQ.png" /></figure><p>🔰 Right now we’re in my local Red hat system within Virtual Box.</p><p>🔰 The above image is the syntax to write a Hello World flask application. As you can see :</p><ol><li>Imports the Flask class from the flask package. Flask is used to create instances of web applications.</li><li>Initializes the app as an instance of Flask.</li><li>Sets a function that responds to the index route, ‘/’, and displays ‘Welcome to the new world`</li><li>Runs the app if the current script being executed is app.py.</li></ol><p>Now if we save the file and come back to the prompt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c0WVXJy0udkzbpvg0QkJAg.png" /></figure><p>🔹 There are two Files, app.py and requirements.txt.</p><p>🔹 Flask always reads app.py as the default file which contains the code, but we can anyways change the file name and then mention it as an argument while running flask app.</p><p>🔹 The requirements.txt file simply contains the dependencies that might be require while running this flask app.</p><p>🔹 Now to Run i.e. to start our flask web server, use command<strong> flask run </strong>and it will host the web page on<strong> port 5000</strong> which is the default flask port number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZVL7GPuPwYY5UXbaIWRqHw.png" /></figure><p>As you can see, as soon as I use flask run, the application is hosted on localhost:5000</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ccara_V7kyzeqbA9tF2sQ.png" /></figure><p>◼ But there’s an issue, at this stage when you hit the IP, the logs can be seen in the command prompt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pEUFGtVLCY-EFYoeSgWVew.png" /></figure><p>◼ I hit the IP address 3 times so GET request was executed, but this app which is running in command prompt is dynamic i.e. you can’t do any other work using command prompt, obviously I can use one more different window over here but in case you’re using a CLI based OS like an EC2 instance from AWS, so we don’t have any GUI and practically this is not the way flask application are hosted.</p><p>◼ So for this let’s use Docker so we can launch the flask using detached feature of it.</p><p>◼ To understand more about Dockerfiles, I’ve created detailed blog on the same so <a href="https://www.linkedin.com/posts/swaroop--shinde_righteducation-educationredefine-arth2-activity-6862961394954895360--IFL?utm_source=share&amp;utm_medium=member_desktop">click here</a> to land on the article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tPXyoHg6BPKUy_PSIPDGqw.png" /></figure><p>➸ We’ll be using python as base image because it will be relevant to flask and pip3 will be pre-installed.</p><p>➸ Next we’re creating a directory within which all the activities will be performed .</p><p>➸ Now we’re copying all the file from current location where Dockerfile is present to the working directory i.e. flaskapp which is inside container.</p><p>➸ Next we’re installing the dependencies using pip3.</p><p>➸ Lastly when we’ll run this docker image, it will run the CMD internally and the flask app will start running within the container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JqqfF8zhyKy_1U_v0g-q6Q.png" /></figure><p>🔰 Use docker build command to build the image and the execution will start :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ygn1K3ls_Mm3RkL3j3LmEw.png" /></figure><p>🔰 As per the Dockerfile it is performing all the steps with respect to the sequence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CqsNjenfdZBLp5EZxlRsDw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gf-kyoR7ttB1JtkUxrs2FQ.png" /></figure><p>🔰 Initially it pulled python image and then later it was configured to be a Flask app ready container, Let’s run &amp; test it :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FeJiqnhMO5ZwbYudrlgeYQ.png" /></figure><p>🔰 We will run container in detached mode, the name is given for simplicity and port is intentionally binding to 4000 just to check if we’re getting response from the container at port 5000 . The process is started &amp; can be seen using docker ps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6GAgNqf2n0ZOqbnQg0l2fg.png" /></figure><p>🔰 At port number 4000, the flask app is running.</p><p>🔰 Now the Nginx will come into play. Let’s understand what is Nginx and why we need it here.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><h3>✅ Understanding Nginx :</h3><p>🔹 At a very high level <a href="https://www.nginx.com/"><strong>Nginx</strong></a>, pronounced like “engine-ex”, is an open-source web server that, since its initial success as a web server, is now also used as a reverse proxy, HTTP cache, and load balancer.</p><p>🔹 If you’re familiar with Apache HTTPD web server, you can relate but Nginx provides some more features and one of them which we will be using will be reverse proxy.</p><p><strong>— — — — — — — — — — — — — — — — — — — — — — — — — — — —</strong></p><h3>✅What is Reverse Proxy ?</h3><p>✰ In simple words reverse proxy <strong>directs client requests to the appropriate backend server. </strong>It is a server that sits in front of web servers and forwards client (e.g. web browser) requests to those web servers.</p><p>✰ Consider it as a Load balancer, when we hit the DNS name of load balancer, it forwards the request to instances configured with it. Similarly to enable this feature in Nginx, we’ll have to modify the configuration file a bit.</p><p>✰ Nginx by default runs on port 80. We will be using Nginx within docker container, so lets do it :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*viCsG22jdhjy2t367IjQYw.png" /></figure><p>✰ the Nginx process is started, Let’s see how the default web page looks like :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TP6r8Nviz-Swh99rAF4uiw.png" /></figure><p>✰ Now our next step is to change the config file according to our need since we want to display flask app which is running on port 5000 instead of this Nginx web page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bgn8lLnHYZyxCsRwW1O4FQ.png" /></figure><p>✰ Right now we’re inside the Nginx container so we can check the config file :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LmGtfgIQ1XeoUKyHFrwiZg.png" /></figure><p>◼ The Nginx acts as per the nginx.conf file which is at /etc/nginx directory and if you’ll open this file, it will contain all the default configurations with respect to the servers because of which it is displaying the Nginx web page.</p><p>◼ So since we have to change this file, if I’ll open &amp; show you this file, there are lots of constrains and directives mentioned, so it will be a bit confusing to configure it as per our requirement :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bA-Ta7uUe82JiMA7OvnPSw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ecYvUb-4ZGxniRxhRQBqaw.png" /></figure><p>◼ Knowing all lines is not required as far as this practical is concerned, we can use one docker facility over here which is volume mounting.</p><p>◼ We will create our own config file and then mount it with this location so the container can read the config file and respond as per the specification.</p><p>◼ So lets come out and delete this container for now :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T80unOOFNvczfG7sSMrVrw.png" /></figure><p>🔰 Since we’ll be writing our own config file, so make sure that the file name and extension is correctly being matched.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kyvx6jTFufOBTlgljJPmsw.png" /></figure><p>🔰 The “events” context is used to set global options that affect how Nginx handles connections at a general level. There can only be a single events context defined within the Nginx configuration.</p><p>🔰 worker_connections can be referred as how many request this Nginx server can handle simultaneously, for this docker container 1000 connection will led to crash but in this case Kubernetes can be used where horizontal pods scaling can be done so the CPU usage stays stable. I’ll be destroying the environment after the practical this won’t affect the performance as such.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ppMAEr-XzoWeLohYX2_Aw.png" /></figure><p>🔰 Next comes is the http block, now http protocol can have n number of servers and their own standards. So this block can have multiple number of child constraints of servers within it. Server is nothing but the IP address config and how the server will responsd based upon the directives which will be mentioned in this server block.</p><p>🔰 First we have listen 80, means the server will be working on port 80, Next is the server name which as the name suggest it can be a domain name or an IP address, in our case since I’m working on local VM so I’ve specified IP of my machine and then below that location “/” means by default if the URL path is not mentioned completely, then it will be proxy passed i.e. will be redirected to the port number where flask app is running on this local server i.e 192.168.1.5:4000</p><p>🔰 Let’s save the file and use docker volume mount feature to change the config file within the docker container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AgU7pI4C1zHCWUwG_YlHxA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aXZzPj3DMqAJTi4RpF8xvA.png" /></figure><p>🔰 we don’t have Nginx server running on port 80, now let’s use -v to bind the volume and start the container :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gtX0gXbp4NnsEVd6mFSQzA.png" /></figure><p>🔰 The container is launched successfully &amp; now if we hit the IP address :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kMQh7uBatIET4w5EYXxvUg.png" /></figure><p>🔰 Reverse proxy is now forwarding the request to the flask app which is running within the container.</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><p>🔰 So From the Above Article we saw how to Configure NGINX Container as Reverse Proxy for Dockerized Flask Application. If you Find This Interesting then Do Follow &amp; Connect on <a href="http://www.linkedin.com/in/swaroop--shinde">Linkedin</a> 😄.</p><p>THANK YOU !!</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbfa89a8e911" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure (SSL) Web Hosting on AWS using Terraform Automation.]]></title>
            <link>https://swaroop751.medium.com/secure-ssl-web-hosting-on-aws-using-terraform-automation-9981627a076e?source=rss-bc38df034f4a------2</link>
            <guid isPermaLink="false">https://medium.com/p/9981627a076e</guid>
            <dc:creator><![CDATA[Swaroop Shinde]]></dc:creator>
            <pubDate>Thu, 28 Jul 2022 14:26:25 GMT</pubDate>
            <atom:updated>2022-10-12T07:42:31.174Z</atom:updated>
            <content:encoded><![CDATA[<p>🔰 Welcome Back, Today Let’s Discuss about a powerful &amp; highly demanded DevOps tool known as <strong>Terraform </strong>😀.</p><p>Here’s the Demonstration for the Project, If you find it interesting, then do go through the blog below where every line is explained in detail, Thanks !</p><p><a href="https://www.linkedin.com/posts/swaroop--shinde_hello-everyone-heres-a-project-activity-6958432597546799104-nKNn?utm_source=linkedin_share&amp;utm_medium=member_desktop_web">Swaroop Shinde on LinkedIn: Hello Everyone... 🙂 🔰 Here&#39;s a Project which I&#39;ve created to &quot; | 26 comments</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*WzeexroDBsv611WRFIOZKw.jpeg" /></figure><p>🔰 In this Project we will Provision <strong>Infrastructure using terraform to Host a website with Secured SSL (HTTPS) connection Protocol on AWS Cloud</strong>. There will be number of AWS services which will be covered in this project such as :</p><p><strong>🔹 EC2 (Elastic Compute Cloud).</strong></p><p><strong>🔹 ELB (Elastic Load Balancer).</strong></p><p><strong>🔹 VPC (Virtual Private Cloud) with subtopics like Subnets, Internet Getway, Route tables, etc.</strong></p><p><strong>🔹 Route53.</strong></p><p><strong>🔹 Amazon Certificate Manager.</strong></p><p><strong>🔹 Security Group</strong></p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><p>✰ Let’s First Understand the Whole Architecture and How each Component will contribute to the Project 👍.</p><h3>✅ Understanding the Architecture :</h3><h3>A) VPC (Virtual Private Cloud)</h3><p><strong>🔹 </strong>A virtual private cloud (VPC) is <strong>a virtual network dedicated to your AWS account</strong>. It is logically isolated from other virtual networks in the AWS Cloud. You can specify an IP address range for the VPC, add subnets, add gateways, and associate security groups. A subnet is a range of IP addresses in your VPC.</p><p><strong>🔹 </strong>For now, assume VPC as a Huge Box, and inside that Box we will create our resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*QvnHiThgwr8NywAii-4dzQ.png" /></figure><p><strong>🔹 </strong>In the above Diagram you can see the VPC range is <strong>10.0.0.0/16 </strong>,means the first two octets i.e. <strong>10.0</strong>.0.0 will remain constant and rest two octets will differ from 0 to 254 i.e. 10.0.<strong>255.255 so will have </strong>65,536 total IP addresses within the VPC which we can later distribute according to our requirements.</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>B) Subnets :</h3><p>✰ A subnet, or subnetwork, is <strong>a segmented piece of a larger network</strong>. More specifically, subnets are a logical partition of an IP network into multiple, smaller network segments. The Internet Protocol (IP) is the method for sending data from one computer to another over the internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/290/1*nvxUl7OYkf6_8eDQcE7oFw.png" /></figure><p><strong>✰</strong> <strong>Means we have 65,536 IP’s, so using subnets we can differentiate these IP for example one Subnet_1 : 10.0.1.0/24 means first 3 octets (8 x 3)will remain constant and remain last 0 will differ between 0 -254. so out of 10.0.0.0/16 i.e 65,536 IP’s, we allocate 10.0.1.0/24 i.e 255 IP’s to the Subnet. Similarly if you want one more subnet i.e. 10.0.2.0/24, again 255 IPs will be separated from 65,536 IP’s and so on.</strong></p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>C) Security Group:</h3><p>A security group <strong>acts as a virtual firewall for your EC2 instances to control incoming and outgoing traffic</strong>. Inbound rules control the incoming traffic to your instance, and outbound rules control the outgoing traffic from your instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*WgcpRyJKykZtkzgnPeEFsA.jpeg" /></figure><p>We want to enable post 22 for SSH connectivity, post 80 which is by default http protocol and 443 which is used for secured SSL connection (https).</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>D) EC2 (Elastic Compute Cloud):</h3><p>◼ To put it simply, an EC2 is <strong>a virtual machine that represents a physical server for you to deploy your applications</strong>. Instead of purchasing your own hardware and connecting it to a network, Amazon gives you nearly unlimited virtual machines to run your applications while they take care of the hardware.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*3WI9L6RRzRnOYelWJdLe3w.png" /></figure><p>◼ we will Have 2 Instance with same Web Page in Each because we will be using Load balancer which will keep routing the traffic and balancing them on Both the Instance.</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>E) Elastic Load Balancer :</h3><p><strong>Elastic Load Balancing</strong> (ELB) automatically distributes incoming application traffic across multiple targets and virtual appliances in one or more Availability Zones (AZs). That’s It.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vt4ApsWQHlxXJ8A7a-QZuA.jpeg" /></figure><h3>E) Route Table :</h3><p><strong>🔹 </strong>A route table <strong>contains a set of rules, called routes, that determine where network traffic from your subnet or gateway is directed</strong>.</p><p><strong>🔹 </strong>A routing table is <strong>a set of rules, often viewed in table format, that is used to determine where data packets traveling over an Internet Protocol (IP) network will be directed</strong>. All IP-enabled devices, including routers and switches, use routing tables.;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ye381iMYhQwaobho2QqUrA.jpeg" /></figure><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>E) Internet gateway :</h3><p><strong>A computer that sits between different networks or applications</strong>. The gateway converts information, data or other communications from one protocol or format to another. A router may perform some of the functions of a gateway. An Internet gateway can transfer communications between an enterprise network and the Internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*y4Ap6bv88tdWTIMwti0rSQ.png" /></figure><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>E) Route 53 :</h3><p>✰ Route 53 <strong>sends automated requests over the internet to a resource, such as a web server, to verify that it’s reachable, available, and functional</strong>. You also can choose to receive notifications when a resource becomes unavailable and choose to route internet traffic away from unhealthy resources.</p><p>✰ when we will have a domain name for our web app, using route 53 we will associate the load balancer with the domain name so that whenever user will access the domain name, they will be able to view the web page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*RKVIH7LG1ec5JKnfeCRiPg.jpeg" /></figure><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>F) Amazon Certificate manager (ACM) :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XXjL4u1axnJjrUGLjPxN7g.png" /></figure><p>✰ AWS Certificate Manager is a service that lets you easily provision, manage, and deploy public and private Secure Sockets Layer/Transport Layer Security (SSL/TLS) certificates for use with AWS services and your internal connected resources.</p><p>✰ Also this certificate will be used by load balancer for the secure SSL connection with ec2 instances.</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><p>✰ Okay, so That’s all about the AWS services, now lets have a look at the Most important project plot i.e.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5vWDLp88VnmUVex7z0srtg.png" /></figure><h3>✅ Terraform :</h3><p>➣ HashiCorp Terraform is <strong>an infrastructure as code tool that lets you define both cloud and on-prem resources in human-readable configuration files that you can version, reuse, and share</strong>. You can then use a consistent workflow to provision and manage all of your infrastructure throughout its lifecycle.</p><p>➣ Terraform by HashiCorp, an AWS Partner Network (APN) Advanced Technology Partner and member of the AWS DevOps Competency, is <strong>an “infrastructure as code” tool similar to AWS Cloud Formation that allows you to create, update, and version your Amazon Web Services (AWS) infrastructure</strong>.</p><p>➣ In Other words, If you want to provision your Infrastructure on any Cloud Service, You don’t have to every time go on AWS/other cloud to create resources. Instead, we will give the access ID &amp; key to terraform &amp; then we will define our resources with certain Syntax.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h09wKhqy_DVSAT17cn4DPQ.jpeg" /></figure><p>➣ The Installation of Terraform is very simple :</p><p>➣ Go to the official Website and download based on your OS environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3AvuA-etXEPSFjLJwHrVJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GctxoqZnV8x2II9LNbZOTQ.png" /></figure><p>➣ A zip file will be downloaded which will contain terraform.exe file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qALuxR2Q_zP6Wg8l4QJCJg.png" /></figure><p>➣ simply extract it and then in the start menu, type env so we can add the path to environment variables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MDx-iUytxjjjkeNjEdDszw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qOLollym0j_0sfzQE11vXw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r0nHb7TptF4nwJzHcQ6gUQ.png" /></figure><p>➣ Click on path &amp; then edit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_YJKnqzspBWg24Dta-D5HQ.png" /></figure><p>➣ Copy the location where the terraform file is extracted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*deZqGM2cEujBLBMqkS_BuQ.png" /></figure><p>➣ Click on New and then add the location, make sure that you’ve mentioned /terraform at the end which specifies the program.</p><p>➣ Now to ensure that terraform has been successfully setup or not, open command prompt and type terraform</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FyNuvZ45OLw4r_fxpJSXeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tBsPoTynhXYD0IaxzyaoaQ.png" /></figure><p>➣ You can see variety of command/arguments that can be used with terraform came up here.</p><p>➣ next step is to tell terraform which cloud it should use for provisioning, whether it’s AWS, GCP, Azure, etc.</p><p>➣ since our Requirement is based on AWS. We will install AWS CLI to configure our access and secret key over here, we can specify the access key in the terraform provider.tf file too, but just to ensure that our credentials are not exposed publicly, we use AWS CLI.</p><p>➣ So install AWS CLI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YQEHgAtazlVYIF8lMRPxQA.png" /></figure><p>➤Simply download and Run the Installer for your OS and then use AWS command in CMD to ensure whether it’s correctly installed or not :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nk1pI6KEhRBB4Eie9s2PpA.png" /></figure><p>➤ Here we have it. now use AWS configure command where you will have to enter the Access key and Password:</p><p>➤ Go to your AWS account and <strong>create a user which we have already seen how to do in the Previous </strong><a href="https://swaroop751.medium.com/jenkins-ci-cd-using-kubernetes-git-github-ansible-docker-in-depth-ae12d6e07104"><strong>Jenkins</strong></a><strong> &amp; </strong><a href="https://blog.devgenius.io/configure-web-server-docker-container-on-ec2-instance-using-ansible-dynamic-inventory-82b659bed494"><strong>Ansible</strong></a><strong> Project.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7_RXlMoLeh1_UbJuNMWeSA.png" /></figure><p>➤ Hit enter if default configuration is correct &amp; We’re Done with Our setup of configuring AWS &amp; terraform. Let’s Start writing Code and see how it will provision the resources in backend.</p><p>➤I’ll be using Git bash instead of Windows CMD because <strong>git bash enables using Linux command like ls, cd, mkdir inside windows.</strong></p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>These are the files which we have in all and will be used to provision the infrastructure :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*xr8wpyjuTwhcNG_xYkBDlw.png" /></figure><p>➤Let’s Start with the <strong>provider.tf which will specify that terraform should use which Cloud for provisioning</strong> :</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TG4lVzmO7R1qxujTIHo6IA.png" /></figure><p>➤ Use the Amazon Web Services (AWS) provider to interact with the many resources supported by AWS. You must configure the provider with the proper credentials before you can use it.</p><p>➤ <strong>Basically, Provider is responsible to enable terraform to set up communication with AWS cloud Resources.</strong></p><p>➤ Now we have, our get way for AWS, let’s start with the very 1st resource/service which will be the Base for Our whole web app i.e. VPC.</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>✅ Create VPC using Terraform :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VNUYkZEQ0TxiS_1kzMqKqw.png" /></figure><p>➸What this syntax means is, the resource which we wish to provision is VPC, so to make it understandable for the terraform, the right keyword i.e.<strong> aws_vpc.</strong> the next<strong> “main” is the name given for the terraform to create an identity for the vpc, </strong>which means whenever we want to use this part of terraform i.e. aws_vpc, we will use the “main” word which will refer to this VPC and the syntax will go something like this :<strong> aws_vpc.main.&lt;data you wish to retrieve&gt;.</strong></p><p>➸ Next we have to give curly braces to specify the attributes which comes under VPC. So it’s mainly a CIDR block which we already saw in above VPC section. And tags will give name to the VPC on AWS.</p><blockquote><strong>Note : main is the name for the terraform reference, and tags will give name for the resource on AWS cloud. Also its not necessary to memorize this at all, you simply need to search for the resource on internet, For example if I want to get syntax for VPC :</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vMSoCXBlvLYRFmKaC495Gg.png" /></figure><p>➸Click on the link which gives you the appropriate answer :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IkB1dpcyuxNaKzJpnZlgOw.png" /></figure><p>➸And here you go, you will see ample of examples which will help you to create your own terraform file :</p><p>➸ Now since we have created our VPC, let’s distribute the IP address using Subnets, so here we have the subnet file :</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>✅ Create Subnets using Terraform :</h3><p>➸If you want to create AWS subnet, you can use the below Terraform registry to look for the syntax of subnet :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kr6uiH8IqvBvQXtlCxH1Vg.png" /></figure><p>➸ On the left side, click on filter &amp; search with proper syntax what you’re looking for, so we got the aws_subnet resource block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tJXjQDhhHLyZauZF025sCg.png" /></figure><p>➸And we landed on subnet page, let’s see how our terraform file for subnet looks like :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZTEPmSXE2oUQLL9kpYeUdw.png" /></figure><p>➸ As you can see, the name for the terraform reference is public since we already used main in aws_vpc.tf file. <strong>Now for subnets it first asks for the VPC which is to be used while creating subnets, so here we want to used the VPC which will be created by terraform, hence we use the syntax aws_vpc.main.id</strong> as discussed earlier, the id will be fetched once the VPC will be created.</p><p>➸Next we have the cidr_block, here a new word is introduced which is var, <strong>this var is nothing but variable. This var will refer to the variable file which will contain the following info :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9GjafM7bd9t5rm3Wm4_CyQ.png" /></figure><p>➸You can see the name given for the variable is cidr, hence we use var.cidr in the subnet file and now to specify the count, you can see I&#39;ve mentioned <strong>count = 2, which means it will iterate the resource block the number of times specified in count,</strong> so since we store the cidr range in variable file in form of list, so to retrieve these blocks, <strong>count.index wich means the index position of this cidr blocks will get retrieved and hence 2 subnets will be created, same goes with the availability zones, two subnets we need in 2 different availability zones so we have specified the same.</strong> Don’t scroll down, let’s bring the subnet file right back :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZTEPmSXE2oUQLL9kpYeUdw.png" /></figure><p>➸<strong><em>The data keyword is used to fetch the resources which are already present in the AWS, so it will filter out the the VPC created by terraform.</em></strong></p><p>➸Now since we’ve created the VPC and subnets, I think we’re good to go with the provisioning of EC2 Instance. So let’s dive into the terraform file for the :</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>✅ Create EC2 Instances using Terraform :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E51OIuw_wFzeSbKE9xtvoQ.png" /></figure><p>➸Let’s Break down this file into small components:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j9h26UOm8aqfrGicxfXiuA.png" /></figure><p>➸If you’ve seen my previous article on Ansible project where we <a href="https://blog.devgenius.io/configure-web-server-docker-container-on-ec2-instance-using-ansible-dynamic-inventory-82b659bed494"><strong>provisioned EC2 Instance using Ansible</strong></a>, the process is exactly the same, the only difference is in the the Syntax, The Resource block used is aws_instance and the reference name is given as web. Rest entries are standard but <strong>the subnet ID’s, we’ve created two subnets, &amp; we have to create 2 Instances both in different zones, so here count keyword will help.</strong></p><p>➸ The count is <strong>a meta-argument defined by the Terraform language</strong>. It can be used with modules and with every resource type. The count meta-argument accepts a whole number, and creates that many instances of the resource or module.</p><p>➸<strong>So count.index will iterate 2 times and ever time when the resource block will be repeated, this index number will keep on shifting and hence 2 instances will be created with 2 different subnets.</strong></p><p>➸The next argument is for the security Group :</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>✅ Create Security Group using Terraform :</h3><p>➸ Let’s have a look at the security group terraform file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UPDrpIFDVReCRhASFIu7dQ.png" /></figure><p>➸aws_security_group resource will be used, you can refer terraform registry for the same. give the name and description as per your choice.<strong> the VPC we have to use is the one which will be created by terraform and since we’ve given name as main so we’re using aws_vpc.main.id.</strong> below that the Rules/Ports which should be allowed for the Traffic are given as arguments, so <strong><em>port 80 for http, 433 for secured https and 22 for SSH connectivity protocol.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j9h26UOm8aqfrGicxfXiuA.png" /></figure><p>➸<strong>We need public IP since users will connect to access the web page so give value as true,</strong> and the name for the instances on web will be given as Web server.</p><p>➸Now, why are we provisioning EC2 instances ? because we want to host a web page on it right !!, So to install httpd package, then adding an index.html page, we need some thing that will do the work as ansible does which is configuration. So the next Block which will come under ec2 is the provisioners :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kIUu-zPnn39vybCYes9u9Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qcn9btIZfzV5_mJzue0GOw.png" /></figure><p>♐ Provisioners are <strong>used to execute scripts on a local or remote machine as part of resource creation or destruction</strong>. Provisioners can be used to bootstrap a resource, cleanup before destroy, run configuration management, etc.</p><p>♐ The local-exec provisioner invokes a local executable after a resource is created. This invokes a process on the machine running Terraform, not on the resource. See the remote-exec <a href="https://www.terraform.io/language/resources/provisioners/remote-exec">provisioner</a> to run commands on the resource.</p><p>♐ We are using remote-exec beause The remote-exec provisioner invokes a script on a remote resource after it is created. This can be used to run a configuration management tool, bootstrap into a cluster, etc. To invoke a local process, see the local-exec <a href="https://www.terraform.io/language/resources/provisioners/local-exec">provisioner</a> instead. The remote-exec provisioner requires a <a href="https://www.terraform.io/language/resources/provisioners/connection">connection</a> and supports both ssh and winrm.</p><p>♐ We will use SSH connection and to connect EC2 Instance, the connection block which is below provisioner block is used to connect to instance, so the <strong>type is SSH, host is the IP address which will be retrieved while creating instances, the user is ec2-user since we cant access using root and now, <em>to specify the .pem file which contains the private key to connect to the instance, it is not at all secure to directly Copy paste the passcode over here so the syntax used is : ${file(“./terraform_key.pem”)}</em></strong></p><p>♐ <strong>This means the private key belongs to the files which is present in . i.e. current location with the file name as terraform_key.pem</strong></p><blockquote><strong><em>Note : make sure to change the file permission using chmod 400 command.</em></strong></blockquote><p>♐The Lines of code written within the inline are purely Linux Based Commands, There are just installing HTTP server, starting the service and downloading the pre-created web page from free-css website.</p><p>♐ Next resource which will be needed is the <strong>internet getway because, we created VPC, subnets, Instances but there’s still no internet access to the Instances.</strong></p><p>♐ So Lets look at the internet getway file :</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>✅ Create Internet Getway using Terraform :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*G_k_7N6YzrrVysN8B8dkyg.png" /></figure><p>♐ This Simply Means that we want to create internet getway for the VPC which will be created by AWS and the tag : Name is given as main.</p><p>♐Now we’ve created internet getway, but how will instances come to know that which getway to use for internet connection, In other words which rout to use for Internet Getway, So here the next terraform file will come to play i.e. for the route table.</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>✅ Create Route Table using Terraform :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bRAGOXoP2ckfaArpUaDYJg.png" /></figure><p>➡ aws_route_table resource will be used for this, again it will be created under the same VPC. And now inside the route block you specify the internet getway ID which is created in the above terraform file and cidr_block is giving public assess.</p><p>➡ The route table for internet getaway will be created, <strong>now since our Instance is created under two subnets, so here we will have to route the internet to two subnets and hence one more time we will use the count parameter in the aws_route_table_accociation block</strong> &amp; the route table ID will be fetched from the the above aws_route_table resource while it will get created.</p><p>➡ Next Resource we have is Load Balancer.</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>✅ Create Load Balancer using Terraform :</h3><h3>Why Load balancer ?</h3><p>➡ Load balancers <strong>improve application availability and responsiveness and prevent server overload</strong>. Each load balancer sits between client devices and backend servers, receiving and then distributing incoming requests to any available server capable of fulfilling them.</p><p>➡ <strong>We have 2 Instances, so every time user will hit port number 80, so they will be directed to any one of the instances which also means, it will split the traffic and balance it.</strong></p><p>➡ Let’s look at the terraform File for the same :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OXUj7IJKjil--aPsbIA_OQ.png" /></figure><p>➡Don’t be Overwhelmed Mate, It’s as simple as huge it looks, Let’s break it down into small components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EW4K72h_ZzZpFNYAyX4ecw.png" /></figure><p>➡ Starting with the resource i.e. aws_lb, the reference name given as alb. The Load Balancer Type is application Load Balancer.</p><p>➡ <strong>An Application Load Balancer makes routing decisions at the application layer (HTTP/HTTPS), supports path-based routing, and can route requests to one or more ports on each container instance in your cluster. Application Load Balancers support dynamic host port mapping.</strong> For example, if your task’s container definition specifies port 80 for an NGINX container port, and port 0 for the host port, then the host port is dynamically chosen from the ephemeral port range of the container instance (such as 32768 to 61000 on the latest Amazon ECS-optimized AMI).</p><p>➡ <strong>we need an Application Load Balancer Because we will be using HTTPS protocol for secured connection. </strong>The Security groups used over here is same as it is used while creating EC2 Instance.</p><p>➡ Now in the subnets Syntax, a<strong>s we have Count attribute, Similarly there is one more method to iterate i.e. for loop, the syntax for subnet in aws_subnet.public : subnet.id means for subnet (variable) in aws_subnet(resource).public(reference name) : subnet.id will be fetched.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pdd8LWloxYpuatIThiUKgA.png" /></figure><p>➡ Next block is of Target Group.</p><p>➡ Means we created Load balancer. now we need to specify for which port number it should refer so that when traffic will come, which port number it should re direct the IP to, so for this aws_lb_target_group is used. the arguments are straight forward, <strong>port = 80, protocal =HTTP and target_type is instance cause we want to use our web servers for this. The VPC should be correctly specified, </strong>then the health check is takes by default as was mentioned in official terraform documentation,</p><p>➡Lastly we have to assign the Instances to this lb target group so aws_lb_target_group_attachment is used, again count to add 2 ip addresses of 2 different instances &amp; the arn of the load balancer which will be created by terraform should be specified.</p><p>➡ Amazon Resource Names (ARNs) <strong>uniquely identify AWS resources</strong>. We require an ARN when you need to specify a resource unambiguously across all of AWS, such as in IAM policies, Amazon Relational Database Service (Amazon RDS) tags, and API calls.</p><p>➡So far we discussed about VPC, Subnets, EC2, route table, internet getway and load balancer, This much is enough to host a web page, Let’s move to git bash and start messing around terraform command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HNHtjAX4Csu-y-3eWbGNhg.png" /></figure><p>➡Don’t worry about the terraform. files, those are created automatically while running terraform commands which we will see :</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>✅ Terraform Commands :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gLOOSzpytI5-WTcPX4O6bg.png" /></figure><p>☞ The terraform validate command <strong>validates the configuration files in a directory</strong>, referring only to the configuration and not accessing any remote services such as remote state, provider APIs, etc.</p><p>☞ Basically this will check if the syntax, resource blocks, reference attributes are correct or not. Here we Got success means nothing to Discuss !!</p><p>☞ Next Command is Terraform init.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wfs1BqY0Zp1WQn-LhwjQWg.png" /></figure><p>☞ The terraform init command is <strong>used to initialize a working directory containing Terraform configuration files</strong>. This is the first command that should be run after writing a new Terraform configuration or cloning an existing one from version control. It is safe to run this command multiple times.</p><p>☞This command will download all the necessary files, plugins required to provision the Resources. &amp; this is what the terraform. files belong.</p><p>☞Next Command is terraform plan</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QYaNMqRZbpPnD8gkY_RmHQ.png" /></figure><p>☞ The terraform plan command <strong>creates an execution plan, which lets you preview the changes that Terraform plans to make to your infrastructure</strong>. By default, when Terraform creates a plan it: Reads the current state of any already-existing remote objects to make sure that the Terraform state is up-to-date.</p><blockquote><strong>Note : You don’t have to take care about whether terraform will create resource in proper order or not, For example; Creating VPC before Subnets, Creating Instances before assigning them to Load Balancers, Creating Route table before Internet Getway, etc. Terraform will handle all by its Own.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RKsM32ZXX0hNMNUjTGRhZQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z2K53Az3o3gX7xnxWU72hw.png" /></figure><p>You can see the arguments which we specified are appended Here, and rest will be know after apply means retrieved after it will be created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rn7xjpv4xzPHJE7qejSZDQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y-ByB-5M0tobSipR9RojVg.png" /></figure><p>‣ Lastly it says 15 Resources to Plan and at the end we will get the DNS name which will be retrieved after the load balancer will be created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ga-N80tp1WWeSU8Cd9qt2A.png" /></figure><p>‣ The terraform apply command <strong>performs a plan just like terraform plan does, but then actually carries out the planned changes to each resource using the relevant infrastructure provider’s API</strong>. It asks for confirmation from the user before making any changes, unless it was explicitly told to skip approval.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wCUX7D2etDBCLPaydDeW0g.png" /></figure><p>‣Enter yes as confirmation to provision the resources :</p><p>‣ Enjoy the View for few minutes &amp; it will say 15 added means 15 resources are provisioned &amp; we got the DNS name as the output of Load balancer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qa77tPYMk_VVx7vXmsq6bQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YVDOGJYVroGjBYMCFs6PbQ.png" /></figure><p>‣Now Copy this DNS name and Paste it in the web browser to check if the load balancer is working &amp; redirecting correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h18AeFPB0u2ek-S2SoqFQQ.png" /></figure><p>‣ Boom !! we have the Web page loaded on port number 80. Let’s have a look at the resources which it provisioned just now.</p><p>‣ 2 EC2 Instances with public IP assigned and running :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xS_PovmNG9bBXXjoLp6l4w.png" /></figure><p>‣ Security group with port numbers Exposed Correctly :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*30WQ0uGwwGVp41XZtjfcig.png" /></figure><p>‣ Load Balancer with two Instances connect and in healthy state :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jtxWVjQs7cGxFWL8_JgN0A.png" /></figure><p>‣ VPC which is created at the very beginning of execution :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M4uftrIHhSEQ7BgqM3U-JQ.png" /></figure><p>‣ 2 Public Subnets :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*67wLoTP_sY0uqih9RNXo-A.png" /></figure><p>‣Route Table :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nme2-t_Ctzj2VS2L-qChWg.png" /></figure><p>‣ &amp; Internet Getway which is associated with the VPC</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AvEvDCIog4YafOc9atkxAw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NusgkCx2Oki3wBcb4yubSw.png" /></figure><p>‣ Now Let’s make it user friendly, Suppose you plan to Give This DNS name to your Friends or Other crew mates, obviosoukly they will be able to access the web page, but they will have no clue about what this link contains. For example when you search google.com, you know that search engine is gonna appear, similarly in our case to make others aware about wtat the we bapge contains, we will have to give a Domain Name.</p><p>‣So Let’s get a Domain Name for free from website called freenom :</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>✅ Get Domain Name for Free :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U8ppZ4PaNj9p5JSwxdGIGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dGj-tOKw34YFk_jI94lDEw.png" /></figure><p>‣ The User Interface is very simple, you have to just search for the domain name you’re looking for, obviously you wont get .com, .in or other extension for free but there are still some other random extensions available, like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QQ2jSo1FY_9FAuRNSEO03A.png" /></figure><p>‣ I searched for traveler and since It is most commonly used key word so mostly all are taken away, but there’s still one more left because someone kept it reserved specially for our Project. So click on get it now on the right of the domain name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8nznGfeqXkuJwJpSMqsdpg.png" /></figure><p>‣ Click on checkout:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2-r1s78z6qmztVaZgbwBCw.png" /></figure><p>‣The period is 3 because we haven&#39;t yet created account on free nom, so click on continue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jcvL0IUSrL4FeUL5XVPHKg.png" /></figure><p>‣You can verify Email If you haven’t created account. I already have one so i will sign in :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F_27DFHdbsRGSY7QChMYsw.png" /></figure><p>‣ Now when you sign in, you can see a long list of time line came up,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RP02sRB0vemSay1xl0J_Kg.png" /></figure><p>‣ Select according to your preference and Complete the Order :</p><p>‣ Now We have a Domain Name, In Order to attach our Load balancer DNS name to Our Domain Name, the service which will be used is Route 53 :</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>✅ Route53 :</h3><p>‣ Amazon Route 53 is a highly available and scalable Domain Name System (DNS) web service. Route 53 <strong>connects user requests to internet applications running on AWS or on-premises</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OMTudgGi66VwL1KLUchm2Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3-_6Of2Hz6_-KCp9tQsg3g.png" /></figure><p>☞You need to Create a Hosted Zone :</p><p>☞ A hosted zone is an Amazon Route 53 concept. A hosted zone is <strong>analogous to a traditional DNS zone file; it represents a collection of records that can be managed together, belonging to a single parent domain name</strong>. All resource record sets within a hosted zone must have the hosted zone’s domain name as a suffix.</p><p>☞Make sure that you enter the Hosted zone name same as the purchased Domain name :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hcb3vGl85njGq_xUsR6kNw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*odxxILLnOXPueOMSvhNPqg.png" /></figure><p>☞ Leave the rest Configuration As it is and create the Hosted Zone :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8a6hq5uwypo6hY_a2b-U1Q.png" /></figure><p>☞ Amazon Route 53 <strong>automatically creates a name server (NS) record that has the same name as your hosted zone</strong>. It lists the four name servers that are the authoritative name servers for your hosted zone. Except in rare circumstances, we recommend that you don’t add, change, or delete name servers in this record.</p><p>☞Now go to the freenom website cause we have to update the Name Servers Over there :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kMkuxDqNL0ad3G83VyUBxw.png" /></figure><p>☞Click on Manage Domain on the right of domain name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RoqRVzgFXDY9HWdt_yJZ8w.png" /></figure><p>☞ Click on Nameservers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rbJ9vS3AkH7k1nczwT_dXw.png" /></figure><p>☞Select use Custom Nameservers Option and Copy paste the same from the Route 53 Hosted Zone :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I_AH7z6ZWnS71x87iwRGkw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BQWXraAxpB6-lDe2F8YIfg.png" /></figure><p>☞Now Click on Change Nameservers:</p><p>☞ Next is we have to create a Record Set in Hosted Zone. This Record Set will specify the Load balancer DNS name to the domain name so whenever the user will search using the domain name, the web page will reflect, So click on Create Record Set :</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>✅ Create Record :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E2QpAbvzPsNcDoHavfm1vg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cy-Lawyz-b2MuP4yj5ExIg.png" /></figure><p>☞ Give the Record Name i.e the sub Domain name you wish, this means we can write any sub domain name before .traveler.ga like dw.traveler.ga or ig.traveler.ga, etc. we are using <a href="http://www.traveler.ga/">www.traveler.ga</a></p><p>☞ the record Type is A because An A record <strong>maps a domain name to the IP address (Version 4) of the computer hosting the domain</strong>. An A record uses a domain name to find the IP address of a computer connected to the internet. The A in A record stands for Address.</p><p>☞Since we have a Load Balancer, so Click on the Alias option below the sub Domain Name :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rPdB3FOmhkfC2QtGKsD3Eg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zf2g2_8C7CieCuzamXJC1Q.png" /></figure><p>☞ Now Select the End Point as where you want to route the domain name. Our’s is application Load balancer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fzCr58lv7eH1P7N0PjebUQ.png" /></figure><p>☞Select the Region where you’re created the Load Balancer. &amp; Lastlty choose the Load balancer Available in that region :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MVm09XyPbuXV_wx6hgFcLg.png" /></figure><p>☞Click on Save :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7T3QngFC241iROaMrYT0sg.png" /></figure><p>☞A record is Created, now if you search <a href="http://www.traveler.ga/">www.traveler.ga</a> on web browser :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qZclJ9cncVeiULD5QI9MGA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OZ8jxjyQPtYMq-3q8KbFZw.png" /></figure><p>☞ &amp; the Web Page Came Up. Now There’s One More way of Doing This using Terraform, so Let’s go back to the Git bash :</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>✅ Create Record using Terraform :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*poagz53ayZz2jqGQGOQpxg.png" /></figure><p>☞ we have one directory called route53, Let’s cd and check what it contains :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oLgKkamFvwSvxmRATCwgYw.png" /></figure><p>☞This terraform file Contains :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d1qBrxCW1f9ZBOZ-hLO5qQ.png" /></figure><p>➡As Simple as we saw in above terraform files. The resource used is aws_route53_zone and reference name is route53_zone. But there’s one difference over here, instead of resource we have data keyword over here</p><p>➡<em>Data sources</em> allow Terraform to use information defined outside of Terraform, defined by another separate Terraform configuration, or modified by functions.</p><p>➡Means when we want to fetch the Info about resource what were not created by terraform and are already created on Cloud, OS here you can use data keyword.</p><p>➡Make sure you give the Route 53 Zone name correctly otherwise it will give error.</p><p>➡Now it will fetch the data from AWS and we can create a Record Set Now :</p><p>➡So we use aws_route53_record recourse. The Zone ID is fetched from Above resource block, the subdomain name is lb so it will become lb.traveler.ga after it will get created</p><p>➡A Canonical Name or CNAME record is <strong>a type of DNS record that maps an alias name to a true or canonical domain name</strong>. CNAME records are typically used to map a subdomain such as www or mail to the domain hosting that subdomain’s content.</p><p>➡&amp; Now give the DNS name correctly correctly in the records. go back to Git bash and run the terraform Commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V42PYKU0-_ky3KHku6rnvg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JbS9gTLlhEPWJ9K4ZU9-jQ.png" /></figure><p>➡Let’s check if its working fine on Web Browser :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oPQ2X3mLYrdFM2P8QC6Nxw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*edrLcSJN8bW6Rz6CaReHgQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dTQVmV5Z50ZxjztnAlSfEw.png" /></figure><p>➡Damn ! Now Let’s make this Website Secure using SSL connection. for this we will use ACM.</p><p>➡ <strong>AWS Certificate Manager is a service that lets you easily provision, manage, and deploy public and private Secure Sockets Layer/Transport Layer Security (SSL/TLS) certificates for use with AWS services and your internal connected resources.</strong></p><p>➡We will use Terraform to request the SSL Certificate :</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>✅ Request &amp; Validate SSL Certificate using Terraform :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aNHglxxzeET4uAC6eVRhLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s6wS5jaKo1hcDFhYonSisg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7c96nYo6ylnBaEMf2pAiGQ.png" /></figure><p>🟩Let’s Break it Down into Small Parts :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E-fs8Vm0nKoLpk0XqtruwQ.png" /></figure><p>🔰 The resource is aws _acm_certificate, s<strong>pecify the Domain name for which you want to request the Certificate. the subject_alternative_names means for all the sub domain names this certificate will be applicable, The validation method is DNS.</strong></p><p>🔰 We are using DNS method for validation, &amp; we have our Domain name in Route53 service. so again we will have to fetch the data from AWS :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ZEb9joJPALW9ntDwuunbA.png" /></figure><p>🔰 Now we’ll have the Hosted Zone Info.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kwNcm7ZCIUPzqRqhpA5qww.png" /></figure><p>🔰 Next we create a Record, <strong>this record will Contain the necessary Information that ACM service will use to validate and approve the Certificate. </strong>the syntax below that is taken from the Official Terraform Documentation. Just make sure that the aws_acm_certificate name in for loop and the zone_id at the very last are specified correctly and there’re relevant to the resources present on AWS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2KmRD5dl_7Yeya5v6eUp4A.png" /></figure><p>🔰 Lastly when the record will be created, use the validation resource to validate the info, again the syntax is taken from official Documentation and give the ARN name correctly. Get Back to Git Bash and Run the Commands :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DBtDWG_tIlGjfkV0jbwn3g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l40QN8pwfgWC5zI3_YSGhg.png" /></figure><p>🔰Now 4 resources are added, go to the route 53 server and check if you get a new record set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wWzPqD88BZTKPZXW2NWI2Q.png" /></figure><p>🔰 There we have it, Now we need to associate this with the Load balancer, so go to the EC2 dashboard and select load balancer on the left side menu.</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><h3>✅ Associate the SSL Certificate with the Load Balancer :</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*brNto_oefLVsIffGZLB4uA.png" /></figure><p><strong>🔹 </strong>Edit the Listener.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EDNILrxeVgUvXYMPLxxPQA.png" /></figure><p><strong>🔹 </strong>Change the port 80 to 443 i.e. HTTP to HTTPS and we’ve already exposed port 443 in the Security Group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vq1B-mMqN3h2-0sQ0E36KQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kkF-gQxhmGQqDsK1Q6gs6A.png" /></figure><p><strong>🔹</strong>Scroll all the way up and below you’ll see From ACM option, there select the certificate which we just created. and click on save changes :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ScSE8O9P9p0AJUBh_c5NXA.png" /></figure><p><strong>🔹 </strong>Now on the browser, use https:// protocol before the domain name and hit enter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xk8Jfqzv7i-Qpkn1hgknyA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lIuy86P_9heKpXD9c4xhog.png" /></figure><p><strong>🔹 </strong>And we have a Secured Website, As you can see the certificate is issued by Amazon &amp; issued to our Domain Name.</p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><p><strong><em>🔰 So From the Above Article we learnt how to use terraform Automation to Host a Secured Website on AWS cloud. If you Find This Interesting then Do Follow &amp; Connect 😄.</em></strong></p><p><strong><em>THANK YOU !!</em></strong></p><h3>— — — — — — — — — — — — — — — — — — — — — — — —</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9981627a076e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>