<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Quang Nam Nguyen</title>
    <description>The latest articles on DEV Community by Quang Nam Nguyen (@tsukpa).</description>
    <link>https://dev.to/tsukpa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1057635%2Ff78eb740-70e9-4e30-af25-41f8dfcabdbf.png</url>
      <title>DEV Community: Quang Nam Nguyen</title>
      <link>https://dev.to/tsukpa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tsukpa"/>
    <language>en</language>
    <item>
      <title>AWS workshop #2: Leveraging Amazon Bedrock to enhance customer service with AI-powered Automated Email Response</title>
      <dc:creator>Quang Nam Nguyen</dc:creator>
      <pubDate>Sat, 21 Dec 2024 17:32:48 +0000</pubDate>
      <link>https://dev.to/tsukpa/leveraging-amazon-bedrock-to-enhance-customer-service-with-ai-powered-automated-email-response-1lm8</link>
      <guid>https://dev.to/tsukpa/leveraging-amazon-bedrock-to-enhance-customer-service-with-ai-powered-automated-email-response-1lm8</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffnn7rgcja33t7yr5an5m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffnn7rgcja33t7yr5an5m.png" alt="Image description" width="800" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Leveraging Amazon Bedrock to enhance customer service with AI-powered Automated Email Response: Using serverless infrastructure to create an auto-reply email system.&lt;/p&gt;

&lt;p&gt;Benefits:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Improved Customer Experience&lt;/li&gt;
&lt;li&gt;24/7 Support⏰: Immediate assistance, even outside business hours.&lt;/li&gt;
&lt;li&gt;Personalized Responses🎯 Tailored responses to individual needs.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Faster Response Times🚀 Instant delivery, reducing customer wait times.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Increased Efficiency &amp;amp; Cost-Effectiveness&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Scalability &amp;amp; Cost-Efficiency&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📈 Automatic scaling, optimizing costs.&lt;/li&gt;
&lt;li&gt;💲 Pay-as-you-go pricing.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reduced Manual Workload🤖 : Automates responses, freeing staff for strategic tasks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Increased Productivity📈: Efficiently handles high volumes of inquiries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enhanced Operational Excellence&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Consistent Response Quality✅ : Ensures consistent and accurate responses.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Data-Driven Insights📊: Gathers valuable data on customer behavior.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Optimized Responses📈: Continuously improves response quality.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By utilizing Amazon Bedrock's powerful AI capabilities within a serverless architecture, businesses can create efficient, cost-effective, and efficient customer service solutions and deliver exceptional customer experiences.&lt;/p&gt;

&lt;p&gt;Techstack:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon Bedrock&lt;/li&gt;
&lt;li&gt;SES&lt;/li&gt;
&lt;li&gt;Lambda function (NodeJS - Typescript SAM)&lt;/li&gt;
&lt;li&gt;SQS&lt;/li&gt;
&lt;li&gt;S3&lt;/li&gt;
&lt;li&gt;DynamoDB&lt;/li&gt;
&lt;li&gt;IaC (Terraform)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Visit my workshop at:&lt;br&gt;
&lt;a href="https://002.tsukpa.blog/" rel="noopener noreferrer"&gt;https://002.tsukpa.blog/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>bedrock</category>
      <category>lambda</category>
      <category>ses</category>
    </item>
    <item>
      <title>AWS workshop #1: Deploy static website to S3 using Github Action</title>
      <dc:creator>Quang Nam Nguyen</dc:creator>
      <pubDate>Tue, 17 Sep 2024 08:06:17 +0000</pubDate>
      <link>https://dev.to/tsukpa/aws-workshop-1-deploy-static-website-to-s3-using-github-action-561a</link>
      <guid>https://dev.to/tsukpa/aws-workshop-1-deploy-static-website-to-s3-using-github-action-561a</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd9akteslg4v3w.cloudfront.net%2F001-deploy-static-site-to-s3%2Fimages%2Finfrastructure.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fd9akteslg4v3w.cloudfront.net%2F001-deploy-static-site-to-s3%2Fimages%2Finfrastructure.png" alt="alt" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this workshop, you’ll learn the basics and practice of Amazon S3, Cloudfront, using IAM OIDC STS with Github Action. Perform creating NextJs App with low latency.&lt;/p&gt;

&lt;p&gt;Check out my first workshop at:&lt;br&gt;
&lt;a href="https://d9akteslg4v3w.cloudfront.net/001-deploy-static-site-to-s3/" rel="noopener noreferrer"&gt;https://d9akteslg4v3w.cloudfront.net/001-deploy-static-site-to-s3/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you like this workshop, please comment for more content &amp;lt;3&lt;/p&gt;

</description>
      <category>aws</category>
      <category>s3</category>
      <category>nextjs</category>
      <category>githubactions</category>
    </item>
    <item>
      <title>How to Revoke STS Credentials for Leaked EC2 Instances</title>
      <dc:creator>Quang Nam Nguyen</dc:creator>
      <pubDate>Sat, 03 Aug 2024 07:07:59 +0000</pubDate>
      <link>https://dev.to/tsukpa/how-to-revoke-sts-credentials-for-leaked-ec2-instances-15e7</link>
      <guid>https://dev.to/tsukpa/how-to-revoke-sts-credentials-for-leaked-ec2-instances-15e7</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbuafcjhkfl66zrvsch03.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbuafcjhkfl66zrvsch03.png" alt="https://tsukpa-docs.s3.ap-southeast-1.amazonaws.com/blog/images/aws_sts_ec2.png" width="800" height="513"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This section will delve into the critical steps to take when an EC2 instance is compromised and its STS credentials are at risk. I'll cover methods to identify compromised instances, extract potential STS credentials, and most importantly, revoke those credentials to mitigate further damage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 1: Understanding STS
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is STS?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F76acr9jg6tuosw2djj5h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F76acr9jg6tuosw2djj5h.png" alt="https://www.bitslovers.com/wp-content/uploads/sites/5/2022/10/20221026_054349_0000.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security Token Service (STS)&lt;/strong&gt; is a component of AWS that provides &lt;strong&gt;temporary&lt;/strong&gt; security credentials. These credentials can be used to access AWS resources without exposing &lt;strong&gt;long-term&lt;/strong&gt; credentials. STS is crucial for enhancing security and flexibility in managing access to your AWS environment.&lt;/p&gt;

&lt;p&gt;Unlike IAM, which manages long-term credentials and permissions, STS focuses on generating &lt;strong&gt;short-lived&lt;/strong&gt; credentials for specific use cases.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use Cases for STS
&lt;/h3&gt;

&lt;p&gt;STS offers a wide range of applications within the AWS ecosystem:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Similar to access keys&lt;/li&gt;
&lt;li&gt;Generates temporary credentials &lt;strong&gt;(sts:AssumeRole)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Limited access&lt;/li&gt;
&lt;li&gt;Used to access AWS resources&lt;/li&gt;
&lt;li&gt;Requested by an identity &lt;em&gt;(AWS or External)&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Part 2: What happens if an EC2 instance is taken control by someone else?
&lt;/h2&gt;

&lt;p&gt;The best practice for running AWS Resource is using &lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html" rel="noopener noreferrer"&gt;IAM Roles&lt;/a&gt;. This function attaches an IAM Role for a resource and provides them permission to access other AWS resources instead of using &lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html" rel="noopener noreferrer"&gt;IAM Credentials&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this blog, I will show you how to get credentials from an EC2 instance and use them with the &lt;a href="https://aws.amazon.com/vi/cli/" rel="noopener noreferrer"&gt;cli&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to get credentials from EC2 instance
&lt;/h3&gt;

&lt;p&gt;In this example, for simple i created a EC2 instance in a public subnet and allow anything in the security group.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8btpbf2azqytzzt9eorb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8btpbf2azqytzzt9eorb.png" alt="https://tsukpa-docs.s3.ap-southeast-1.amazonaws.com/blog/images/aws-sts-ec2-sg.png" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Please specified needed policy with limited permissions in real world.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And from the session console i use &lt;a href="https://curl.se/" rel="noopener noreferrer"&gt;curl&lt;/a&gt; to get information about &lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html" rel="noopener noreferrer"&gt;EC2 metadata&lt;/a&gt;. After created an EC2, i access to EC2 by that local IP address &lt;code&gt;169.254.169.254&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Get role name from metadata&lt;/span&gt;
curl http://169.254.169.254/latest/meta-data/iam/security-credentials

&lt;span class="c"&gt;# Get the credentials with role name&lt;/span&gt;
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/REPLACE_ME
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The credentials is something like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Code"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Success"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"LastUpdated"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2024-08-03T06:06:45Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Type"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"AWS-HMAC"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"AccessKeyId"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ASIAWDEGI6ESSSXVEBFW"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"SecretAccessKey"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"KwN5anzRvzoxtqzW6k6poMSc0T8zVIk1lnAmr"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Token"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"IQoJb3JpZ2luX2VjELf//////////Wgh/dD4mbF4wRNTeW/qWkOWil0FuI6t5pcnBy/kUO7eOCQ=="&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Expiration"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2024-08-03T12:40:56Z"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After get credentials, you can passing it into the local credentials of the AWS CLI using command &lt;code&gt;aws configure&lt;/code&gt;. Then you can use &lt;a href="https://www.terraform.io/" rel="noopener noreferrer"&gt;Terraform&lt;/a&gt; to create a maximum instance type for mining bitcoin 👿.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solutions
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;Remember, you can not manually invalidate temporary credentials&lt;/code&gt;. They only expire when they expire. But because changing the permissions policy affects everyone, you can add a condition element to it denying anyone access to AWS who assumed the role before a certain date and time.&lt;/p&gt;

&lt;p&gt;And then you can go to the IAM Role then choose the last tab &lt;code&gt;Revoke sessions&lt;/code&gt; and revoke them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Deny"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"*"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Condition"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="nl"&gt;"DateLessThan"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
                    &lt;/span&gt;&lt;span class="nl"&gt;"aws:TokenIssueTime"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"[policy creation time]"&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzdkx1su0cktmk31otldy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzdkx1su0cktmk31otldy.png" alt="https://tsukpa-docs.s3.ap-southeast-1.amazonaws.com/blog/images/aws-sts-ec2-revoke.png" width="800" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, all temporary credentials will be invalid, you can go back to EC2, and now you can not access to the EC2 instance. To resolve this, we can stop and start the ec2 instance again to get the new temporary credentials.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>sts</category>
      <category>ec2</category>
    </item>
    <item>
      <title>Deploy Laravel project to Amazon EC2</title>
      <dc:creator>Quang Nam Nguyen</dc:creator>
      <pubDate>Sun, 04 Jun 2023 03:11:23 +0000</pubDate>
      <link>https://dev.to/tsukpa/deploy-laravel-project-to-amazon-ec2-1dk0</link>
      <guid>https://dev.to/tsukpa/deploy-laravel-project-to-amazon-ec2-1dk0</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgbengaoni.com%2Fimages%2F1__cHw6zbAivDFI__aZkeN1mjg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgbengaoni.com%2Fimages%2F1__cHw6zbAivDFI__aZkeN1mjg.png" title="DEPLOY LARAVEL PROJECT TO AMAZON EC2" alt="DEPLOY LARAVEL PROJECT TO AMAZON EC2" width="800" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploy Laravel project to Amazon EC2
&lt;/h2&gt;

&lt;p&gt;Hello guys, today i'll show you how to deploy Laravel project to Amazon EC2&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Prerequisite
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;EC2 instance (installed Ubuntu, Nginx)&lt;/li&gt;
&lt;li&gt;VPC setup for EC2 instance can access ssh&lt;/li&gt;
&lt;li&gt;RDS for mysql (check to the option "Connect to exist EC2 instance")&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Install environment for Laravel
&lt;/h2&gt;

&lt;h3&gt;
  
  
  2.1. Connect to EC2 instance via &lt;strong&gt;ssh&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;examplekey.pem&amp;gt;"&lt;/span&gt; &amp;lt;username&amp;gt;@&amp;lt;EC2 Address&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.2. Copy source code to EC2 instance
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Clone from github repository
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  git clone &amp;lt;&lt;span class="nb"&gt;link &lt;/span&gt;github repository&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;(Optional) Copy source from local using &lt;strong&gt;scp&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install &lt;strong&gt;zip, unzip&lt;/strong&gt; from local machine
&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;zip
&lt;/code&gt;&lt;/pre&gt;



&lt;ul&gt;
&lt;li&gt;Compress source files using zip command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;zip &lt;span class="nt"&gt;-r&lt;/span&gt; &amp;lt;zipfilename.zip&amp;gt; &amp;lt;folderpath&amp;gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;ul&gt;
&lt;li&gt;Copy source from local to EC2 instance using &lt;strong&gt;scp&lt;/strong&gt; command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;scp &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;examplekey.pem&amp;gt;"&lt;/span&gt; &amp;lt;zipfilename.zip&amp;gt; &amp;lt;username&amp;gt;@&amp;lt;EC2 Address&amp;gt;:&amp;lt;pathtosave&amp;gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;ul&gt;
&lt;li&gt;Extract source files using &lt;strong&gt;unzip&lt;/strong&gt; command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;unzip &amp;lt;zipfilename.zip&amp;gt;
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.3. Install PHP dependencies based on your project. For example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;add-apt-repository ppa:ondrej/php
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; php7.3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.4. Install &lt;em&gt;mysql&lt;/em&gt; client to connect RDS instance
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;mysql-client-core-8.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Connect to RDS instance from EC2 via &lt;strong&gt;mysql&lt;/strong&gt; client by following command and type your password
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  mysql &lt;span class="nt"&gt;-h&lt;/span&gt; &amp;lt;RDS Address Instance&amp;gt; &lt;span class="nt"&gt;-P&lt;/span&gt; &amp;lt;port | 3306&amp;gt; &lt;span class="nt"&gt;-u&lt;/span&gt; &amp;lt;masteruser&amp;gt; &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create your database name based on the project
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;  &lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;databasename&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;EXIT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.5. Config your environment file to match your RDS server
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;...
APP_URL=&amp;lt;URL of your EC2 instance&amp;gt;
APP_DEBUG=false

DB_CONNECTION=mysql
DB_HOST=&amp;lt;RDS Address link&amp;gt;
DB_PORT=3306
DB_DATABASE=&amp;lt;databasename&amp;gt;
DB_USERNAME=&amp;lt;master username&amp;gt;
DB_PASSWORD=&amp;lt;password&amp;gt;
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.6. Install &lt;strong&gt;Composer&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; composer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.7. Go to project directory and install dependencies
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer update 
composer &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.8. Generate application key
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan key:generate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.9. Copy directory to &lt;em&gt;/var/www/&lt;/em&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cp&lt;/span&gt; &amp;lt;foldername&amp;gt; /var/www/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.10. Update permissions
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; www-data:www-data /var/www/&amp;lt;foldername&amp;gt;
&lt;span class="nb"&gt;sudo chmod&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; 755 &amp;lt;foldername&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  3. Setting up Nginx
&lt;/h2&gt;

&lt;h3&gt;
  
  
  3.1. Configure Nginx to serve the content
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;vi /etc/nginx/sites-available/&amp;lt;foldername&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Then you can enter the following setting:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kn"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;server_name&lt;/span&gt; &lt;span class="s"&gt;&amp;lt;server_domain_or_IP&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;root&lt;/span&gt; &lt;span class="n"&gt;/var/www/&amp;lt;foldername&amp;gt;/public&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;//&lt;/span&gt; &lt;span class="s"&gt;Focus&lt;/span&gt; &lt;span class="s"&gt;this&lt;/span&gt; &lt;span class="s"&gt;log&lt;/span&gt; &lt;span class="s"&gt;if&lt;/span&gt; &lt;span class="s"&gt;you&lt;/span&gt; &lt;span class="s"&gt;see&lt;/span&gt; &lt;span class="s"&gt;error&lt;/span&gt;
    &lt;span class="s"&gt;access_log&lt;/span&gt; &lt;span class="n"&gt;/var/log/nginx/laravel-access.log&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;error_log&lt;/span&gt; &lt;span class="n"&gt;/var/log/nginx/laravel-error.log&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


    &lt;span class="kn"&gt;add_header&lt;/span&gt; &lt;span class="s"&gt;X-Frame-Options&lt;/span&gt; &lt;span class="s"&gt;"SAMEORIGIN"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;add_header&lt;/span&gt; &lt;span class="s"&gt;X-XSS-Protection&lt;/span&gt; &lt;span class="s"&gt;"1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="kn"&gt;mode=block"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;add_header&lt;/span&gt; &lt;span class="s"&gt;X-Content-Type-Options&lt;/span&gt; &lt;span class="s"&gt;"nosniff"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;index&lt;/span&gt; &lt;span class="s"&gt;index.html&lt;/span&gt; &lt;span class="s"&gt;index.htm&lt;/span&gt; &lt;span class="s"&gt;index.php&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;charset&lt;/span&gt; &lt;span class="s"&gt;utf-8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kn"&gt;try_files&lt;/span&gt; &lt;span class="nv"&gt;$uri&lt;/span&gt; &lt;span class="nv"&gt;$uri&lt;/span&gt;&lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="n"&gt;/index.php?&lt;/span&gt;&lt;span class="nv"&gt;$query_string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;/favicon.ico&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kn"&gt;access_log&lt;/span&gt; &lt;span class="no"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="kn"&gt;log_not_found&lt;/span&gt; &lt;span class="no"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;/robots.txt&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kn"&gt;access_log&lt;/span&gt; &lt;span class="no"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="kn"&gt;log_not_found&lt;/span&gt; &lt;span class="no"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kn"&gt;error_page&lt;/span&gt; &lt;span class="mi"&gt;404&lt;/span&gt; &lt;span class="n"&gt;/index.php&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="p"&gt;~&lt;/span&gt; &lt;span class="sr"&gt;\.php$&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kn"&gt;fastcgi_pass&lt;/span&gt; &lt;span class="s"&gt;unix:/var/run/php/php7.4-fpm.sock&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;fastcgi_index&lt;/span&gt; &lt;span class="s"&gt;index.php&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;fastcgi_param&lt;/span&gt; &lt;span class="s"&gt;SCRIPT_FILENAME&lt;/span&gt; &lt;span class="nv"&gt;$realpath_root$fastcgi_script_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;include&lt;/span&gt; &lt;span class="s"&gt;fastcgi_params&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="p"&gt;~&lt;/span&gt; &lt;span class="sr"&gt;/\.(?!well-known).*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kn"&gt;deny&lt;/span&gt; &lt;span class="s"&gt;all&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3.2. To activate the new virtual host configuration file, create a symbolic link to &lt;em&gt;foldername&lt;/em&gt; in sites-enabled
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; /etc/nginx/sites-available/&amp;lt;foldername&amp;gt; /etc/nginx/sites-enabled/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3.3. To confirm that the configuration doesn’t contain any syntax errors, you can use
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nginx &lt;span class="nt"&gt;-t&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3.4. To apply the changes, reload Nginx with
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl reload nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  4. (Optional) Fix some error when configuring
&lt;/h2&gt;

&lt;h3&gt;
  
  
  4.1. By default, EC2 ubuntu not enabled php-fpm, run following command to enable
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;a2enmod proxy_fcgi setenvif
&lt;span class="nb"&gt;sudo &lt;/span&gt;service nginx restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check that package PHP-FPM is exist&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;vi /etc/php/&amp;lt;version&amp;gt;/fpm/pool.d/www.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you find this line and check that path is correct (file .sock must exists in the folder &lt;em&gt;/var/run/php/&lt;/em&gt;)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;listen &lt;span class="o"&gt;=&lt;/span&gt; /var/run/php/php&amp;lt;version&amp;gt;-fpm.sock
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart the service&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;service php&amp;lt;version&amp;gt;-fpm restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Setting EC2, RDS
&lt;/h2&gt;

&lt;h2&gt;
  
  
  1. Create EC2
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;AMI: Ubuntu&lt;/li&gt;
&lt;li&gt;Instance type: t2.micro (free tier)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fks4rfodwry724mbf5oyh.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fks4rfodwry724mbf5oyh.PNG" alt="Create EC2" width="800" height="577"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select existing security group or you can change later&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fivek8cypjsktui7ypy9n.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fivek8cypjsktui7ypy9n.PNG" alt="Select SG" width="800" height="578"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Create Security Group
&lt;/h2&gt;

&lt;p&gt;We allow SSH, ICMP and TCP from anywhere and in Outbound we allow anything&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8ezy82pphwxxsz6l5h1.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8ezy82pphwxxsz6l5h1.PNG" alt="Create Security Group" width="800" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Create Route table
&lt;/h2&gt;

&lt;p&gt;Route the traffic to the internet gateway (igw)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fprav76fsswa3xlzrzuyn.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fprav76fsswa3xlzrzuyn.PNG" alt="Create Route table" width="800" height="316"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Create RDS
&lt;/h2&gt;

&lt;p&gt;Create database for our application&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzq8qv55oq5m58nagf3ed.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzq8qv55oq5m58nagf3ed.PNG" alt="Create database for our application" width="800" height="557"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose your DB instance type&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6o09rp66ald2euugx8fx.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6o09rp66ald2euugx8fx.PNG" alt="Choose your DB instance type" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check the option connection to the EC2 instance&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr92u1p01gxe3z0uq4snx.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr92u1p01gxe3z0uq4snx.PNG" alt="Check the option connection to the EC2 instance" width="800" height="585"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  After all you can access your application by enter your public IP EC2 address in the browser. Enjoy it 😉
&lt;/h3&gt;

</description>
      <category>aws</category>
      <category>php</category>
      <category>ec2</category>
      <category>laravel</category>
    </item>
  </channel>
</rss>
