<?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: Bach Huynh V. VN.Danang</title>
    <description>The latest articles on DEV Community by Bach Huynh V. VN.Danang (@bachhuynh).</description>
    <link>https://dev.to/bachhuynh</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%2F1006013%2Fea583cf5-123b-4087-bf1b-c9ae0761b036.jpeg</url>
      <title>DEV Community: Bach Huynh V. VN.Danang</title>
      <link>https://dev.to/bachhuynh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bachhuynh"/>
    <language>en</language>
    <item>
      <title>Resetting a User’s Password in Prowler via Admin API Access</title>
      <dc:creator>Bach Huynh V. VN.Danang</dc:creator>
      <pubDate>Tue, 22 Jul 2025 09:42:52 +0000</pubDate>
      <link>https://dev.to/bachhuynh/a-2ae5</link>
      <guid>https://dev.to/bachhuynh/a-2ae5</guid>
      <description>&lt;p&gt;In this guide, you’ll learn how to reset a user’s password in the Prowler App using the REST API and an admin account. This is useful when a user forgets their password and the GUI does not provide a reset option.&lt;/p&gt;

&lt;p&gt;📌 Overview&lt;/p&gt;

&lt;p&gt;Prowler’s API allows password updates through the /users/{id} endpoint. However, in most cases, changing a password requires authentication with the user’s current credentials. This guide demonstrates how an admin account can bypass that requirement and reset passwords for any user.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;⚠️ Prerequisites&lt;/p&gt;

&lt;p&gt;Before using the script:&lt;br&gt;
    • You must have an admin account with a valid email and password.&lt;br&gt;
    • You must know the email address of the user whose password needs to be reset.&lt;br&gt;
    • The Prowler API must be accessible via HTTP or HTTPS (adjust the base URL accordingly).&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;🧩 How the Script Works&lt;br&gt;
    1.  Authenticate as an admin using your email and password to retrieve an access token.&lt;br&gt;
    2.  Fetch all users from the system.&lt;br&gt;
    3.  Match the user email to find the target user’s ID.&lt;br&gt;
    4.  Send a PATCH request to update the user’s password using the admin’s access token.&lt;/p&gt;

&lt;p&gt;⸻&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests
import json
import urllib3

# Disable SSL verification warnings (for dev/test environments)
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

# === Configuration ===
apiBaseUrl = "http://localhost:8080/api/v1"      # Replace with your actual API endpoint
adminEmail = "admin@example.com"                 # Admin account email
adminPassword = "ADMIN_PASSWORD"                 # Admin account password

targetUserEmail = "user-to-reset@example.com"    # Target user's email
newUserPassword = "NEW_PASSWORD"                 # New password to set

# === Step 1: Get Token as Admin ===
apiTokenEndpoint = f"{apiBaseUrl}/tokens"
tokenPayload = json.dumps({
  "data": {
    "type": "tokens",
    "attributes": {
      "email": adminEmail,
      "password": adminPassword
    }
  }
})

headers = {
  'Content-Type': 'application/vnd.api+json',
  'Accept': 'application/vnd.api+json'
}

response = requests.post(apiTokenEndpoint, headers=headers, data=tokenPayload, verify=False)
response.raise_for_status()
token = response.json()['data']['attributes']['access']

# === Step 2: Get All Users and Locate Target User ===
apiUsersEndpoint = f"{apiBaseUrl}/users?fields[users]=email"
headers['Authorization'] = f"Bearer {token}"
response = requests.get(apiUsersEndpoint, headers=headers, verify=False)
response.raise_for_status()

users = response.json()['data']
targetUserId = None
for user in users:
    if user['attributes']['email'].lower() == targetUserEmail.lower():
        targetUserId = user['id']
        break

if not targetUserId:
    print(f"❌ User with email {targetUserEmail} not found.")
    exit(1)

# === Step 3: Reset the User's Password ===
apiTargetUserEndpoint = f"{apiBaseUrl}/users/{targetUserId}"
userPayload = json.dumps({
  "data": {
    "type": "users",
    "id": targetUserId,
    "attributes": {
      "password": newUserPassword
    }
  }
})

response = requests.patch(apiTargetUserEndpoint, headers=headers, data=userPayload, verify=False)

# === Output Result ===
if response.status_code == 200:
    print(f"✅ Password reset for {targetUserEmail} successfully.")
else:
    print(f"❌ Failed to reset password. Status: {response.status_code}")
    print(response.text)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🛡️ Security Notes&lt;br&gt;
    • Do not use verify=False in production environments. Always validate SSL certificates.&lt;br&gt;
    • Make sure the adminPassword and newUserPassword are stored securely (consider using environment variables or secrets management).&lt;br&gt;
    • Always log access to sensitive operations like password resets.&lt;/p&gt;

&lt;p&gt;✅ Final Output&lt;/p&gt;

&lt;p&gt;If successful, the script will return:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;✅ Password reset for user-to-reset@example.com successfully.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the user is not found or another error occurs, a detailed error message will be printed.&lt;/p&gt;

</description>
      <category>prowler</category>
      <category>resetpassword</category>
    </item>
    <item>
      <title>Vibe Coding with Amazon Q CLI: Creating a New Terraform Environment in Minutes</title>
      <dc:creator>Bach Huynh V. VN.Danang</dc:creator>
      <pubDate>Tue, 17 Jun 2025 07:25:05 +0000</pubDate>
      <link>https://dev.to/aws-builders/vibe-coding-with-amazon-q-cli-creating-a-new-terraform-environment-in-minutes-33i9</link>
      <guid>https://dev.to/aws-builders/vibe-coding-with-amazon-q-cli-creating-a-new-terraform-environment-in-minutes-33i9</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%2F1y4p50pv38pal7joxloi.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%2F1y4p50pv38pal7joxloi.png" alt="Image description" width="792" height="663"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;How AI-powered development transforms infrastructure provisioning from hours to minutes&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Traditional infrastructure setup often involves hours of research, documentation reading, and trial-and-error. But what if you could simply chat with an AI assistant to create an entire AWS environment? &lt;/p&gt;

&lt;p&gt;In this article, I'll walk you through my real experience using Amazon Q CLI to set up a complete staging environment for our production infrastructure. We'll see how natural language prompts can replace tedious manual work and dramatically speed up the development process.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Challenge
&lt;/h2&gt;

&lt;p&gt;Our team needed to create a new staging environment for our ABC (AbcHQ) project. This involved:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Setting up AWS profiles and authentication&lt;/li&gt;
&lt;li&gt;Creating Terraform configuration files&lt;/li&gt;
&lt;li&gt;Configuring networking (VPC, subnets, security groups)&lt;/li&gt;
&lt;li&gt;Setting up infrastructure components (bastion hosts, load balancers, databases)&lt;/li&gt;
&lt;li&gt;Managing state files and deployment scripts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Traditionally, this would take several hours of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reading documentation&lt;/li&gt;
&lt;li&gt;Copying and modifying existing configurations&lt;/li&gt;
&lt;li&gt;Debugging configuration errors&lt;/li&gt;
&lt;li&gt;Testing and validation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's see how Amazon Q CLI changed this experience entirely.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: AWS Profile Configuration
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;My Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Add abc-stg environment to aws config with account ID 730335299999, same role as dev and prod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What Amazon Q CLI Did:&lt;/strong&gt;&lt;br&gt;
Amazon Q immediately understood I needed to add a new AWS profile and provided the exact configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[profile abc-stg]&lt;/span&gt;
&lt;span class="py"&gt;sso_session&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;abc&lt;/span&gt;
&lt;span class="py"&gt;sso_account_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;730335299999&lt;/span&gt;
&lt;span class="py"&gt;sso_role_name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;global_admin&lt;/span&gt;
&lt;span class="py"&gt;region&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;ap-southeast-2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 The Magic:&lt;/strong&gt; Instead of looking up AWS CLI documentation or copying from existing profiles, Q understood the context and provided the exact configuration format. This saved me 5-10 minutes of documentation browsing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Authentication
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;My Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws login sso abc-stg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What Amazon Q CLI Did:&lt;/strong&gt;&lt;br&gt;
Q corrected my command syntax and provided the proper AWS SSO login command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws sso login &lt;span class="nt"&gt;--profile&lt;/span&gt; abc-stg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 The Magic:&lt;/strong&gt; Q caught my syntax error and provided the correct command format. No need to check AWS CLI documentation or remember the exact parameter syntax.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Environment Verification
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;My Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Check if I have any s3 buckets
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What Amazon Q CLI Did:&lt;/strong&gt;&lt;br&gt;
Q provided the AWS CLI command and executed it, showing me the existing buckets in the staging account:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws s3api list-buckets &lt;span class="nt"&gt;--profile&lt;/span&gt; abc-stg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt; Found 4 existing buckets, confirming the account was accessible and had some existing resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;💡 The Magic:&lt;/strong&gt; Q understood I wanted to verify account access and chose the most appropriate verification method. This quick check saved potential debugging time later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: The Big One - Terraform Configuration
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;My Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I need to work on tf-basestack repo, I need to deploy new environment to this `abc-stg` profile, Please prepare necessary files for me.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What Amazon Q CLI Did:&lt;/strong&gt;&lt;br&gt;
This is where Q really shined. It analyzed our existing repository structure and created multiple files:&lt;/p&gt;
&lt;h3&gt;
  
  
  4.1 Configuration Directory
&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;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ./tf-basestack/config/stg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  4.2 Terraform Variables File (&lt;code&gt;config/stg/au.tfvars&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;Q created a complete configuration file with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Account-specific settings&lt;/li&gt;
&lt;li&gt;Network configuration (VPC CIDR: 10.110.0.0/16)&lt;/li&gt;
&lt;li&gt;Subnet configurations for public, private, and database tiers&lt;/li&gt;
&lt;li&gt;Security group configurations&lt;/li&gt;
&lt;li&gt;Instance configurations&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  4.3 Environment Variables Script (&lt;code&gt;scripts/stg_init_env_vars.sh&lt;/code&gt;)
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="nv"&gt;BUCKETNAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"730335299999-abchq-tfstate-bucket"&lt;/span&gt;
&lt;span class="nv"&gt;REGION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"ap-southeast-2"&lt;/span&gt;
&lt;span class="nv"&gt;DDBTABLENAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"tfstate-table"&lt;/span&gt;
&lt;span class="nv"&gt;PROFILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"abc-stg"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  4.4 Terraform Initialization Script (&lt;code&gt;terraform_init_stg_au.sh&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;A complete script for Terraform backend initialization with proper workspace management.&lt;/p&gt;
&lt;h3&gt;
  
  
  4.5 First Run Script (&lt;code&gt;firstrun_stg.sh&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;Script to create S3 bucket and DynamoDB table for Terraform state management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;💡 The Magic:&lt;/strong&gt; This single prompt replaced what would typically be 2-3 hours of work:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Analyzing existing configurations&lt;/li&gt;
&lt;li&gt;Adapting them for the new environment&lt;/li&gt;
&lt;li&gt;Creating multiple script files&lt;/li&gt;
&lt;li&gt;Ensuring consistency across all files&lt;/li&gt;
&lt;li&gt;Setting up proper naming conventions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Q understood our project structure, naming patterns, and requirements without any additional context.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 5: Code Management
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;My Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Please commit and push the code for me!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What Amazon Q CLI Did:&lt;/strong&gt;&lt;br&gt;
Q created a proper Git workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout &lt;span class="nt"&gt;-b&lt;/span&gt; feat/add-stg-environment
git add config/stg/ scripts/stg_init_env_vars.sh terraform_init_stg_au.sh firstrun_stg.sh
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Add staging environment configuration for tf-basestack"&lt;/span&gt;
git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin feat/add-stg-environment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 The Magic:&lt;/strong&gt; Q understood Git best practices, created a feature branch, and wrote a descriptive commit message. No need to think about proper Git workflow or commit message conventions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Infrastructure Initialization
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;My Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;run file firstrun_stg.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What Amazon Q CLI Did:&lt;/strong&gt;&lt;br&gt;
Q executed the first-run script, creating:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;S3 bucket for Terraform state storage with versioning enabled&lt;/li&gt;
&lt;li&gt;DynamoDB table for state locking&lt;/li&gt;
&lt;li&gt;Proper error handling and verification&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;💡 The Magic:&lt;/strong&gt; Q handled the execution and provided clear feedback about what was being created and why.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 7: Terraform Initialization
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;My Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;run file terraform_init_stg_au.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What Amazon Q CLI Did:&lt;/strong&gt;&lt;br&gt;
Q executed the Terraform initialization:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configured the S3 backend&lt;/li&gt;
&lt;li&gt;Created the staging workspace&lt;/li&gt;
&lt;li&gt;Downloaded required providers&lt;/li&gt;
&lt;li&gt;Set up the working directory&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;💡 The Magic:&lt;/strong&gt; Q managed the complex Terraform backend configuration automatically, something that often requires multiple attempts to get right.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 8: Handling Real-World Issues
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;My Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Please commit and push, also run plan again for me on stg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What Happened:&lt;/strong&gt;&lt;br&gt;
The Terraform plan failed because the Route53 hosted zone didn't exist yet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Amazon Q CLI Did:&lt;/strong&gt;&lt;br&gt;
Q identified the issue and explained that we needed to create the Route53 zone first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;💡 The Magic:&lt;/strong&gt; Instead of leaving me to debug cryptic Terraform errors, Q immediately identified the root cause and suggested the solution.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 9: Problem Resolution
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;My Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create hosted zone "au.stg.abchq.com" on route53 for me!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What Amazon Q CLI Did:&lt;/strong&gt;&lt;br&gt;
Q provided the exact AWS CLI command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws route53 create-hosted-zone &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--name&lt;/span&gt; &lt;span class="s2"&gt;"au.stg.abchq.com"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--caller-reference&lt;/span&gt; &lt;span class="s2"&gt;"stg-au-zone-&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; +%Y-%m-%d-%H-%M&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--profile&lt;/span&gt; abc-stg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 The Magic:&lt;/strong&gt; Q understood the DNS requirements, provided proper caller-reference generation, and used the correct profile. This saved me from looking up Route53 CLI documentation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 10: Final Success
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;My Prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;update README for me? Remember to use English prompts!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What Amazon Q CLI Did:&lt;/strong&gt;&lt;br&gt;
After successful Terraform plan execution (43 resources to be created), Q updated our documentation with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Complete step-by-step instructions&lt;/li&gt;
&lt;li&gt;All the prompts used during the process&lt;/li&gt;
&lt;li&gt;Expected outputs and results&lt;/li&gt;
&lt;li&gt;Troubleshooting information&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Final Result:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Plan: 43 to add, 0 to change, 0 to destroy.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A complete staging environment ready for deployment!&lt;/p&gt;

&lt;h2&gt;
  
  
  The Transformation: Before vs After
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Traditional Approach (3-4 hours):
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Research&lt;/strong&gt; (30 mins): Reading Terraform docs, AWS CLI references&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configuration&lt;/strong&gt; (90 mins): Manually creating and adapting config files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scripting&lt;/strong&gt; (45 mins): Writing initialization and deployment scripts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Debugging&lt;/strong&gt; (60 mins): Fixing configuration errors, syntax issues&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Testing&lt;/strong&gt; (30 mins): Validating the setup&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Documentation&lt;/strong&gt; (45 mins): Writing setup instructions&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  With Amazon Q CLI (45 minutes):
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Natural conversation&lt;/strong&gt; (30 mins): Describing what I needed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validation&lt;/strong&gt; (10 mins): Reviewing Q's suggestions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Execution&lt;/strong&gt; (5 mins): Running the generated scripts&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Key Insights
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Context Understanding
&lt;/h3&gt;

&lt;p&gt;Amazon Q CLI understood our project structure, naming conventions, and requirements without explicit explanation. It analyzed existing files and maintained consistency across the new environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Best Practices Built-In
&lt;/h3&gt;

&lt;p&gt;Q automatically applied infrastructure best practices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Proper Git workflow with feature branches&lt;/li&gt;
&lt;li&gt;Terraform state management with locking&lt;/li&gt;
&lt;li&gt;Security configurations&lt;/li&gt;
&lt;li&gt;Resource naming conventions&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Error Prevention
&lt;/h3&gt;

&lt;p&gt;Q caught potential issues before they became problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Syntax corrections in commands&lt;/li&gt;
&lt;li&gt;Missing dependencies (like Route53 zones)&lt;/li&gt;
&lt;li&gt;Configuration inconsistencies&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Documentation Generation
&lt;/h3&gt;

&lt;p&gt;Q automatically generated comprehensive documentation, including all the prompts used - creating a reproducible process for future environments.&lt;/p&gt;

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

&lt;p&gt;Amazon Q CLI transformed what used to be a complex, time-consuming task into a natural conversation. The 80% time reduction isn't just about speed - it's about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reduced cognitive load&lt;/strong&gt;: No need to remember syntax or search documentation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fewer errors&lt;/strong&gt;: AI catches mistakes before they cause problems
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Better practices&lt;/strong&gt;: Built-in best practices and conventions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instant documentation&lt;/strong&gt;: Automatic generation of setup guides&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This experience shows how AI-powered development tools are changing the game. We're moving from "knowing how to code" to "knowing what to build" - and that's a powerful shift.&lt;/p&gt;

&lt;p&gt;The future of infrastructure development isn't about memorizing Terraform syntax or AWS CLI commands. It's about clearly communicating your intent and letting AI handle the implementation details.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try it yourself&lt;/strong&gt;: Next time you need to set up infrastructure, try describing what you want in natural language first. You might be surprised by how much time you save.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;What's your experience with AI-powered development tools? Have you tried Amazon Q CLI or similar tools? Share your thoughts in the comments below!&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  AWS #Terraform #AmazonQ #DevOps #Infrastructure #AI #CloudComputing #IaC
&lt;/h1&gt;

</description>
      <category>amazonqcli</category>
      <category>terraform</category>
      <category>iac</category>
      <category>vibecoding</category>
    </item>
    <item>
      <title>Amazon Q CLI - Dễ sử dụng như thế mà tới giờ mình mới dùng!</title>
      <dc:creator>Bach Huynh V. VN.Danang</dc:creator>
      <pubDate>Tue, 27 May 2025 08:56:53 +0000</pubDate>
      <link>https://dev.to/aws-builders/amazon-q-cli-de-su-dung-nhu-the-ma-toi-gio-minh-moi-dung-229b</link>
      <guid>https://dev.to/aws-builders/amazon-q-cli-de-su-dung-nhu-the-ma-toi-gio-minh-moi-dung-229b</guid>
      <description>&lt;h2&gt;
  
  
  🚀 Amazon Q CLI - Trợ lý AI Siêu Đẳng Trong Terminal Của Bạn!
&lt;/h2&gt;

&lt;p&gt;Nhờ chương trình: &lt;a href="https://community.aws/content/2xIoduO0xhkhUApQpVUIqBFGmAc/build-games-with-amazon-q-cli-and-score-a-t-shirt?trk=b085178b-f0cb-447b-b32d-bd0641720467&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Build Games with Amazon Q CLI and score a T shirt 🏆👕&lt;/a&gt; mà mình mới thực sự tiếp xúc, thực hành với Amazon Q CLI. Và nó tuyệt vời hơn cả sự mong đợi của mình.&lt;br&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%2Fktuljonkd57kks3spuhj.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%2Fktuljonkd57kks3spuhj.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  🤯 Những điều Amazon Q CLI làm được sẽ khiến bạn ngỡ ngàng
&lt;/h3&gt;
&lt;h3&gt;
  
  
  Bất ngờ #1: Nó hiểu hệ thống của bạn!
&lt;/h3&gt;

&lt;p&gt;Amazon Q không chỉ là một AI thông minh, nó còn &lt;strong&gt;hiểu rõ&lt;/strong&gt; môi trường làm việc của bạn. Hệ điều hành? Thư mục hiện tại? Cấu trúc dự án? Q nắm rõ tất cả! Không cần phải giải thích dài dòng về context nữa.&lt;/p&gt;
&lt;h3&gt;
  
  
  Bất ngờ #2: Nó viết code như một senior dev!
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Bạn: "Viết cho tôi một hàm tính giai thừa"
# Amazon Q: "Đây là hàm tính giai thừa với cả đệ quy và vòng lặp:"
&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;factorial_recursive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;factorial_recursive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;factorial_iterative&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Chỉ vài dòng promt, mà mình đã build ra được cái game rắn săn mồi với tính năng cơ bản nhất: &lt;/p&gt;

&lt;p&gt;Mọi người có thể tham khảo tại: &lt;a href="https://github.com/mvn-bachhuynh-dn/snake-amazonq" rel="noopener noreferrer"&gt;https://github.com/mvn-bachhuynh-dn/snake-amazonq&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Vậy là có thể nhận áo rồi của chương trình trên rồi :-)&lt;/p&gt;
&lt;h3&gt;
  
  
  Bất ngờ #3: Nó thực thi lệnh bash giúp bạn!
&lt;/h3&gt;

&lt;p&gt;Quên đi những lần Google "làm sao để tìm file trong Linux" - Amazon Q sẽ làm điều đó cho bạn!&lt;/p&gt;

&lt;p&gt;Từ giờ chẳng cần bạn phải nhớ bất kì câu lệnh nào cả...chỉ cần prompt thôi, ngay cả ngôn ngữ tiếng Việt thì Amazon Q CLI cũng hiểu rất tốt.&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%2Fosfrgn7kpk5elupexghd.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%2Fosfrgn7kpk5elupexghd.png" alt=" " width="713" height="350"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Bất ngờ #4: Nó tương tác với AWS như một chuyên gia!
&lt;/h3&gt;

&lt;p&gt;Bạn không nhớ cú pháp của AWS CLI? Không sao! Amazon Q sẽ giúp bạn tạo, quản lý và truy vấn tài nguyên AWS một cách dễ dàng.&lt;/p&gt;

&lt;p&gt;Đúng như vậy, với đặc điểm đặc biệt là Amazon Q CLI của AWS phát triển, thì mình tin chắc nó nắm vững AWS CLI và kiến trúc AWS rõ hơn tất cả các AI khác hiện nay.&lt;/p&gt;

&lt;p&gt;Bạn có thể làm mọi điều bằng Amazon Q CLI:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Thông qua promt - Thông qua promt - Thông qua promt&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Đăng nhập aws sso với 1 profile nhất định: Q tự tìm và đăng nhập cho bạn luôn, nếu failed, Q tự retry lại với những option khác nhau.&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%2Fmqxvsyw6qavv9xorhknw.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%2Fmqxvsyw6qavv9xorhknw.png" alt=" " width="800" height="295"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Liệt kê chi phí. Nhờ Q tìm hiểu cách giảm chi phí&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ví dụ một response của Q khi mình muốn giảm chi phí Cloudwatch Logs&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2. Custom Metrics:
   • Mỗi custom metric có chi phí $0.30/tháng
   • Với nhiều services, số lượng metrics có thể lên đến hàng nghìn

3. Tần suất thu thập metrics cao:
   • Hiện tại đang cấu hình 60 giây/lần (standard resolution)
   • Mỗi datapoint có chi phí riêng

4. Enhanced Monitoring cho RDS:
   • Đang bật Enhanced Monitoring với tần suất 60 giây cho cả hai instance RDS
   • Tạo ra nhiều metrics chi tiết với chi phí cao

5. Dashboards và Alarms:
   • Mỗi dashboard có chi phí $3/tháng
   • Mỗi alarm metric có chi phí $0.10/tháng

## Giải pháp tối ưu hóa chi phí CloudWatch:

### 1. Tối ưu hóa Log Groups:

• **Giảm thời gian lưu trữ logs**:

bash
  aws logs put-retention-policy --log-group-name "/ecs/us-prod-receptionhq-taskdef-service-*" --retention-in-days 14


  • Giảm từ mặc định (vĩnh viễn) xuống 14-30 ngày có thể tiết kiệm 50-70% chi phí lưu trữ

• **Lọc logs không cần thiết**:

bash
  aws logs put-subscription-filter --log-group-name "/ecs/us-prod-receptionhq-taskdef-service-*" --filter-name "exclude-debug" --filter-pattern "?DEBUG ?TRACE" --destination-arn "arn:aws:logs:region:account:destination"


  • Loại bỏ logs debug và trace có thể giảm 30-40% khối lượng logs

• **Nén logs**:
  • Bật tính năng nén logs để giảm kích thước lưu trữ
  • Tiết kiệm 40-60% chi phí lưu trữ

### 2. Tối ưu hóa Metrics:

• **Giảm tần suất thu thập metrics**:

bash
  aws cloudwatch put-metric-alarm --alarm-name "CPU-Utilization" --metric-name "CPUUtilization" --namespace "AWS/EC2" --period 300 --evaluation-periods 1 --threshold 80 --comparison-operator "GreaterThanThreshold" --statistic "Average"


  • Thay đổi từ 60 giây lên 300 giây (5 phút) có thể giảm 80% chi phí metrics

• **Loại bỏ metrics không cần thiết**:
  • Xác định và loại bỏ các custom metrics ít sử dụng
  • Tập trung vào metrics quan trọng cho monitoring và alerting

• **Sử dụng Metric Math thay vì tạo metrics mới**:
  • Sử dụng Metric Math để tính toán metrics phái sinh thay vì lưu trữ chúng

### 3. Tối ưu hóa RDS Enhanced Monitoring:

• **Giảm tần suất Enhanced Monitoring**:

bash
  aws rds modify-db-instance --db-instance-identifier us-prod-receptionhq-mariadb --monitoring-interval 300
  aws rds modify-db-instance --db-instance-identifier us-prod-receptionhq-mssqldb --monitoring-interval 300


  • Thay đổi từ 60 giây lên 300 giây có thể giảm 80% chi phí

• **Chỉ bật Enhanced Monitoring cho instance quan trọng**:
  • Có thể tắt Enhanced Monitoring cho môi trường không quan trọng

### 4. Tối ưu hóa Dashboards và Alarms:

• **Hợp nhất dashboards**:
  • Kết hợp nhiều dashboards thành một dashboard tổng hợp
  • Giảm số lượng dashboards không cần thiết

• **Xem xét lại các alarms**:
  • Loại bỏ các alarms trùng lặp hoặc không cần thiết
  • Sử dụng composite alarms để giảm số lượng alarms

### 5. Sử dụng CloudWatch Logs Insights hiệu quả:

• **Tối ưu hóa queries**:
  • Sử dụng queries hiệu quả để giảm khối lượng dữ liệu quét
  • Giới hạn thời gian quét logs

• **Lên lịch cho các báo cáo**:
  • Thay vì truy vấn liên tục, lên lịch cho các báo cáo định kỳ

### 6. Sử dụng CloudWatch Container Insights có chọn lọc:

• **Chỉ bật cho các services quan trọng**:
  • Container Insights tạo ra nhiều metrics chi tiết với chi phí cao
  • Chỉ bật cho các services quan trọng cần giám sát chi tiết

### 7. Sử dụng CloudWatch Contributor Insights có chọn lọc:

• **Giới hạn việc sử dụng**:
  • Chỉ sử dụng cho việc phân tích ngắn hạn, không bật liên tục

### Ước tính tiết kiệm:

| Giải pháp | Tiết kiệm ước tính |
|-----------|-------------------|
| Giảm thời gian lưu trữ logs | $100-150/tháng |
| Lọc logs không cần thiết | $50-80/tháng |
| Giảm tần suất thu thập metrics | $80-120/tháng |
| Tối ưu RDS Enhanced Monitoring | $30-50/tháng |
| Hợp nhất dashboards và alarms | $10-20/tháng |
| Tổng tiết kiệm tiềm năng | $270-420/tháng |

### Kế hoạch triển khai:

1. Ngay lập tức (1-2 ngày):
   • Giảm thời gian lưu trữ logs xuống 14-30 ngày
   • Giảm tần suất Enhanced Monitoring cho RDS

2. Ngắn hạn (1 tuần):
   • Lọc logs debug và trace không cần thiết
   • Giảm tần suất thu thập metrics từ 60s lên 300s

3. Trung hạn (2-4 tuần):
   • Xem xét và loại bỏ các custom metrics không cần thiết
   • Hợp nhất dashboards và alarms

4. Dài hạn (1-2 tháng):
   • Triển khai chiến lược logs và metrics toàn diện
   • Thiết lập quy trình đánh giá chi phí CloudWatch định kỳ

Bạn có muốn tôi đi sâu vào bất kỳ giải pháp cụ thể nào trong số này không?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Thực hiện start/stop instance, db&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%2Feyw2ov2thltz2yqdjwtl.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%2Feyw2ov2thltz2yqdjwtl.png" alt=" " width="800" height="738"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Thực hiện chạy ECS task...&lt;/li&gt;
&lt;li&gt;v.v...&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Bất ngờ #5: Chế độ ngắn gọn
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;q &lt;span class="nt"&gt;--brief&lt;/span&gt; &lt;span class="s2"&gt;"Giải thích về Docker"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Khi bạn cần câu trả lời ngắn gọn, súc tích, không lan man!&lt;/p&gt;

&lt;h4&gt;
  
  
  Bất ngờ #6: Lưu cuộc trò chuyện
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;q &lt;span class="nt"&gt;--save-chat&lt;/span&gt; my_awesome_chat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Để sau này nhìn lại và tự hỏi: "Wow, AI đã giúp mình giải quyết vấn đề này á?"&lt;/p&gt;

&lt;h4&gt;
  
  
  Bất ngờ #7: Chế độ code
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;q &lt;span class="nt"&gt;--code&lt;/span&gt; &lt;span class="s2"&gt;"Viết một API REST với FastAPI"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tập trung vào code, bỏ qua những giải thích dài dòng!&lt;/p&gt;

&lt;h2&gt;
  
  
  🎮 Hướng dẫn sử dụng cơ bản
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Cài đặt siêu đơn giản
&lt;/h3&gt;

&lt;p&gt;Theo document này: &lt;a href="https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Đặc biệt, nếu sử dụng trên nền tảng Linux thông qua SSH (Không có GUI)&lt;br&gt;
sử dụng document này:&lt;br&gt;
&lt;a href="https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing-ssh-setup-autocomplete.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing-ssh-setup-autocomplete.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lưu ý:&lt;/strong&gt;&lt;br&gt;
Trong hướng dẫn có ghi rõ với cách cài đặt Standard version (glibc 2.34+) thì yêu cầu glibc &amp;gt;= 2.34. &lt;br&gt;
Mình sử dụng Ubuntu khi kiểm tra glibc version hiện tại là 2.35. &lt;br&gt;
Tới khi cài đặt bản này thì báo lỗi:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./q/install.sh
/home/steve/.local/bin/q: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.32&lt;span class="s1"&gt;' not found (required by /home/steve/.local/bin/q)
/home/steve/.local/bin/q: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.34'&lt;/span&gt; not found &lt;span class="o"&gt;(&lt;/span&gt;required by /home/steve/.local/bin/q&lt;span class="o"&gt;)&lt;/span&gt;
/home/steve/.local/bin/q: /lib/x86_64-linux-gnu/libc.so.6: version &lt;span class="sb"&gt;`&lt;/span&gt;GLIBC_2.33&lt;span class="s1"&gt;' not found (required by /home/steve/.local/bin/q)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nếu gặp lỗi như vậy thì bạn hãy cài đặt bản: &lt;code&gt;Musl version (for glibc &amp;lt; 2.34)&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Bắt đầu cuộc trò chuyện thần kỳ
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Khởi động Amazon Q&lt;/span&gt;
q

&lt;span class="c"&gt;# Hoặc với một câu hỏi cụ thể&lt;/span&gt;
q &lt;span class="s2"&gt;"Làm thế nào để tạo một Lambda function với Python?"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Các option hữu ích
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/editor&lt;/code&gt; Giúp bạn nhập promt nhiều dòng hoặc paste đoạn code nào đó bạn muốn Q xử lý.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/quit&lt;/code&gt; thoát Q.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/help&lt;/code&gt; Xem các option của Q.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/save&lt;/code&gt; Lưu lại toàn bộ conversation với Q.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/load&lt;/code&gt; Load lại conversation được lưu.
....&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Setting cực kỳ quan trọng:
&lt;/h3&gt;

&lt;p&gt;Để AmazonQ CLI không học từ dữ liệu của bạn. Hãy setting như sau (ở Terminal chính), gõ lệnh:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;q settings telemetry.enabled false&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;q settings codeWhisperer.shareCodeWhispererContentWithAWS false&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Để AmazonQ CLI luôn hỏi bạn nếu muốn xóa file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/context hooks add prevent-file-deletion --global --trigger conversation_start --command "echo \"Confirm before deleting any files\""&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🎭 Những tình huống Amazon Q CLI tỏa sáng
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Khi bạn quên cú pháp&lt;/strong&gt;: "làm sao để grep chỉ tên file thôi?"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Khi deadline cận kề&lt;/strong&gt;: "giúp tôi debug đoạn code này gấp!"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Khi bạn lười đọc docs&lt;/strong&gt;: "S3 bucket policy cần những gì?"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Khi 3 giờ sáng và không ai online&lt;/strong&gt;: "tại sao code của tôi lại crash?"&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  🚫 Những điều Amazon Q không làm được (ít thôi!)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Không pha được cà phê (nhưng có thể giúp bạn viết script điều khiển máy pha cà phê thông minh!)&lt;/li&gt;
&lt;li&gt;Không thể thay thế hoàn toàn Stack Overflow (nhưng gần như thế!)&lt;/li&gt;
&lt;li&gt;Không thể đọc được suy nghĩ của sếp (nhưng có thể giúp bạn viết email chuyên nghiệp cho sếp!)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🌟 Kết luận: Cuộc sống developer/devops chưa bao giờ dễ dàng đến thế! Cuộc sống của một AWS engineer chưa bao giờ dễ dàng đến thế!
&lt;/h2&gt;

&lt;p&gt;Hãy thử ngay hôm nay và cảm nhận sự khác biệt. Bạn sẽ tự hỏi làm thế nào mà trước đây bạn có thể sống mà không có nó! 😉&lt;/p&gt;

</description>
      <category>amazonqcli</category>
      <category>awschallenge</category>
      <category>ai</category>
      <category>cli</category>
    </item>
    <item>
      <title>Sử dụng Google Workspace làm IdP để đăng nhập AWS</title>
      <dc:creator>Bach Huynh V. VN.Danang</dc:creator>
      <pubDate>Mon, 14 Apr 2025 10:01:59 +0000</pubDate>
      <link>https://dev.to/aws-builders/google-workspace-as-idp-for-aws-login-1jnk</link>
      <guid>https://dev.to/aws-builders/google-workspace-as-idp-for-aws-login-1jnk</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%2Fcboaakzy2dc680f8tr4a.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%2Fcboaakzy2dc680f8tr4a.png" alt="Image description" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Các tiêu đề liên quan:&lt;br&gt;
Sử dụng Google Workspace làm IdP để đăng nhập AWS&lt;br&gt;
Đăng nhập AWS bằng Google Workspace (SSO với SAML)&lt;br&gt;
Tích hợp Google Workspace làm Identity Provider cho AWS&lt;br&gt;
Google Workspace làm IdP: Giải pháp đăng nhập AWS đơn giản&lt;br&gt;
Cấu hình SSO AWS với Google Workspace&lt;/p&gt;
&lt;h2&gt;
  
  
  Với Google Workspace,
&lt;/h2&gt;

&lt;p&gt;Chúng ta có thể tạo SSO cho AWS theo 2 cách:&lt;br&gt;
&lt;a href="https://support.google.com/a/table/9217027" rel="noopener noreferrer"&gt;Pre-integrated SAML&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Định nghĩa&lt;/strong&gt;: Là những ứng dụng đã được Google cấu hình sẵn.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ưu điểm&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Cài đặt nhanh chóng, đơn giản.&lt;/li&gt;
&lt;li&gt;Hỗ trợ Automatic Provisioning (SCIM).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nhược điểm&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Mỗi app chỉ tạo được một lần duy nhất.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://support.google.com/a/answer/6087519" rel="noopener noreferrer"&gt;Custom SAML Application&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Định nghĩa&lt;/strong&gt;: Dùng cho các ứng dụng không có sẵn trong danh mục của Google.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ưu điểm&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Tạo được nhiều Custom Application, phù hợp cho doanh nghiệp lớn, có nhiều phòng ban, sử dụng nhiều AWS account, AWS Organizations...&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nhược điểm&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Không hỗ trợ Automatic Provisioning&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cả 2 cách đều vào URL này &lt;a href="https://admin.google.com/ac/apps/unified?hl=en" rel="noopener noreferrer"&gt;https://admin.google.com/ac/apps/unified?hl=en&lt;/a&gt;&lt;br&gt;
Hoặc App -&amp;gt; Web and mobile apps -&amp;gt; Add app:&lt;br&gt;
Để chọn Pre-integrated SAML Apps, chọn: Search for apps.&lt;br&gt;
Để chọn Custom, chọn: Add custom SAML app&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%2F16lplwlxs637jhbd19il.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%2F16lplwlxs637jhbd19il.png" alt="Image description" width="800" height="316"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Khác biệt lớn của 2 cái trên chính là Pre-integrated SAML Apps thì có Autoprovisioning còn Custom SAML Apps thì không.&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%2Faefav1ra3gyqyed3o0v0.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%2Faefav1ra3gyqyed3o0v0.png" alt="Image description" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  ✨ So sánh chi tiết
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Pre-integrated SAML Apps&lt;/th&gt;
&lt;th&gt;Custom SAML Apps&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Definition&lt;/td&gt;
&lt;td&gt;Pre-configured apps available in Google Workspace's catalog for easy integration.&lt;/td&gt;
&lt;td&gt;Manually configured apps for services not listed in the catalog.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Setup Complexity&lt;/td&gt;
&lt;td&gt;Simplified setup with pre-defined parameters (e.g., ACS URL, Entity ID).&lt;/td&gt;
&lt;td&gt;Requires manual entry of service provider details (e.g., ACS URL, Entity ID, certificate).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Supported Applications&lt;/td&gt;
&lt;td&gt;Over 200 popular cloud apps (e.g., Salesforce, Slack, Dropbox).&lt;/td&gt;
&lt;td&gt;Any app that supports SAML 2.0 but is not pre-listed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User Provisioning&lt;/td&gt;
&lt;td&gt;Supports automated user provisioning via SCIM for certain apps.&lt;/td&gt;
&lt;td&gt;Requires manual user provisioning or separate SCIM configuration.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Attribute Mapping&lt;/td&gt;
&lt;td&gt;Pre-defined attribute mappings for supported apps.&lt;/td&gt;
&lt;td&gt;Customizable attribute mappings based on the app's requirements.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Use Case&lt;/td&gt;
&lt;td&gt;Ideal for widely-used enterprise applications with standard configurations.&lt;/td&gt;
&lt;td&gt;Suitable for custom-built or niche applications requiring tailored SSO settings.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Maintenance&lt;/td&gt;
&lt;td&gt;Minimal; updates are managed by Google Workspace.&lt;/td&gt;
&lt;td&gt;Requires ongoing maintenance to ensure compatibility with the app.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Number of App Instances Allowed&lt;/td&gt;
&lt;td&gt;Only Once per Application: Each app from the catalog can only be created once.&lt;/td&gt;
&lt;td&gt;Unlimited: You can create multiple custom apps for different groups or use cases.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h2&gt;
  
  
  Về phía AWS,
&lt;/h2&gt;

&lt;p&gt;Hiện tại chúng ta sử dụng SSO với IdP là Google Workspace có 2 cách: Identity Providers trong IAM và IAM Identity Center&lt;/p&gt;

&lt;p&gt;Cùng so sánh:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Criteria&lt;/th&gt;
&lt;th&gt;IAM Identity Providers (SAML in IAM)&lt;/th&gt;
&lt;th&gt;IAM Identity Center + External IdP (SSO)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Configured in&lt;/td&gt;
&lt;td&gt;IAM &amp;gt; Identity Providers + Roles&lt;/td&gt;
&lt;td&gt;IAM Identity Center &amp;gt; Settings &amp;gt; External Identity Provider&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SSO Protocol&lt;/td&gt;
&lt;td&gt;SAML 2.0&lt;/td&gt;
&lt;td&gt;SAML 2.0 (OIDC support is coming)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User Experience&lt;/td&gt;
&lt;td&gt;❌ Manual login via &lt;code&gt;/saml&lt;/code&gt; URL, no user portal&lt;/td&gt;
&lt;td&gt;✅ Has AWS SSO Portal (e.g., &lt;code&gt;https://d-xxxx.awsapps.com/start&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User Provisioning&lt;/td&gt;
&lt;td&gt;❌ Not supported&lt;/td&gt;
&lt;td&gt;✅ Supports SCIM or Just-in-time (JIT) provisioning&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Access Control (Roles)&lt;/td&gt;
&lt;td&gt;Roles manually mapped via SAML attributes&lt;/td&gt;
&lt;td&gt;✅ Assign permission sets based on users/groups from IdP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Admin UX / UI&lt;/td&gt;
&lt;td&gt;Basic and limited&lt;/td&gt;
&lt;td&gt;✅ Intuitive, full-featured management interface&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Multi-account Support (Organizations)&lt;/td&gt;
&lt;td&gt;❌ No built-in support&lt;/td&gt;
&lt;td&gt;✅ Native support for multi-account via AWS Organizations&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Third-party IdP Integration&lt;/td&gt;
&lt;td&gt;Supported but manual&lt;/td&gt;
&lt;td&gt;✅ Simple metadata-based setup&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CLI / SDK / AWS Console Access&lt;/td&gt;
&lt;td&gt;✅ Supported but requires scripts&lt;/td&gt;
&lt;td&gt;✅ Seamless via &lt;code&gt;aws configure sso&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scalability&lt;/td&gt;
&lt;td&gt;Limited for large orgs&lt;/td&gt;
&lt;td&gt;✅ Highly scalable, enterprise-ready&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AWS Recommendation&lt;/td&gt;
&lt;td&gt;❌ Legacy, no new feature development&lt;/td&gt;
&lt;td&gt;✅ Officially recommended by AWS&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


&lt;h3&gt;
  
  
  🔍 Summary Recommendation
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Use Case&lt;/th&gt;
&lt;th&gt;Recommended Method&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Legacy systems, few users&lt;/td&gt;
&lt;td&gt;IAM Identity Providers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Enterprise environments, multi-account&lt;/td&gt;
&lt;td&gt;✅ IAM Identity Center + External IdP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Need user portal and better UX&lt;/td&gt;
&lt;td&gt;✅ IAM Identity Center&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SSO for CLI / SDK / GUI&lt;/td&gt;
&lt;td&gt;✅ IAM Identity Center&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Google Workspace / Azure AD integration&lt;/td&gt;
&lt;td&gt;✅ IAM Identity Center&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;p&gt;Bắt đầu phần hướng dẫn cho cả 2 cách trên AWS&lt;/p&gt;
&lt;h2&gt;
  
  
  A. IAM Identity Center + External IdP (SSO)
&lt;/h2&gt;

&lt;p&gt;Ở Google Workspace: &lt;br&gt;
Pre-integrated SAML Apps&lt;br&gt;
App -&amp;gt; Web and mobile apps -&amp;gt; Add app -&amp;gt; Search for apps&lt;br&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%2Fsno0mdus1ef1cq6df60p.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%2Fsno0mdus1ef1cq6df60p.png" alt="Image description" width="670" height="383"&gt;&lt;/a&gt;&lt;br&gt;
Type: Amazon&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%2Fim98u1i2lgd96p8g51pf.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%2Fim98u1i2lgd96p8g51pf.png" alt="Image description" width="800" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Download metadata and click Continue&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%2Fa89pxwlwng40ysbmv5zj.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%2Fa89pxwlwng40ysbmv5zj.png" alt="Image description" width="800" height="754"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tại bước này thì chờ sau khi import trên AWS:&lt;br&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%2Fi91lefa0lojlemx6fd6f.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%2Fi91lefa0lojlemx6fd6f.png" alt="Image description" width="800" height="649"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SAML attribute mapping&lt;br&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%2Frgl34n5e0pw94ekoy4w2.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%2Frgl34n5e0pw94ekoy4w2.png" alt="Image description" width="800" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tại AWS Console:&lt;br&gt;
Chọn đúng region cần tạo, &lt;br&gt;
Vào IAM Identity Center và nhấn &lt;code&gt;Enable&lt;/code&gt;&lt;br&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%2Fvmgpy1qh603bduogual8.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%2Fvmgpy1qh603bduogual8.png" alt="Image description" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Reconfirm: Enable&lt;br&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%2Fnsxuxq8iy1zw8lex86aa.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%2Fnsxuxq8iy1zw8lex86aa.png" alt="Image description" width="800" height="193"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Settings -&amp;gt; edit Instance name&lt;br&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%2Fhcmks4m3lgnwccnei2kf.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%2Fhcmks4m3lgnwccnei2kf.png" alt="Image description" width="800" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select Identity Source, click Action and choose &lt;code&gt;Change identity source&lt;/code&gt;&lt;br&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%2Fwhm6eepni5jv1g90dlnt.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%2Fwhm6eepni5jv1g90dlnt.png" alt="Image description" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose &lt;code&gt;External identity provider&lt;/code&gt;&lt;br&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%2Fbji777l6notqtsavqdsa.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%2Fbji777l6notqtsavqdsa.png" alt="Image description" width="800" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Upload IdP SAML metadata&lt;br&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%2Figgwrh5rskcma2lxfat2.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%2Figgwrh5rskcma2lxfat2.png" alt="Image description" width="800" height="549"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy các mục sau để copy vào Google Workspace:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;AWS&lt;/th&gt;
&lt;th&gt;Google Workspace&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;AWS access portal sign-in URL&lt;/td&gt;
&lt;td&gt;Để trống&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IAM Identity Center Assertion Consumer Service (ACS) URL&lt;/td&gt;
&lt;td&gt;ACS URL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IAM Identity Center issuer URL&lt;/td&gt;
&lt;td&gt;Entity ID&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Như vậy ở trang Google Workspace:&lt;br&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%2F19ysl301zz3zhxvcnsg6.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%2F19ysl301zz3zhxvcnsg6.png" alt="Image description" width="800" height="645"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Nếu gặp lỗi đăng nhập không được khi click biểu tượng SSO Application từ Google, thì hãy để trống phần &lt;code&gt;Start URL&lt;/code&gt; ở Google &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Chú ý phần Name ID chọn Name ID format là EMAIL, sau đó chọn Continue&lt;/p&gt;

&lt;p&gt;Phần Attribute, chọn như hình, sau đó nhấn FINISH:&lt;br&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%2Fpe73znpsgfmzmq5fp9tp.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%2Fpe73znpsgfmzmq5fp9tp.png" alt="Image description" width="800" height="605"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Chú ý Attribute Amazon thì tạo theo hướng dẫn: &lt;a href="https://support.google.com/a/answer/6194963?sjid=10980572457906110988-NC#zippy=%2Cbefore-you-begin" rel="noopener noreferrer"&gt;https://support.google.com/a/answer/6194963?sjid=10980572457906110988-NC#zippy=%2Cbefore-you-begin&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Sign in with a super administrator account to the Google Admin console.
If you aren’t using a super administrator account, you can’t complete these steps.

Go to Menu and then Directory &amp;gt; Users.
At the top of Users list, click More options and thenManage custom attributes.
Requires the Schema Management privilege.
At the top right, click Add Custom Attribute.
Configure the custom attribute as follows:
Category: Amazon
Description: Amazon Custom Attributes
For Custom fields, enter the following:

Name: Role
Info type: Text
Visibility: Visible to user and admin
No. of values: Multi-value
Click Add.
The new category appears in the Manage user attributes page.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Back to AWS console:&lt;br&gt;
Nhấn Next và Gõ ACCEPT và click &lt;code&gt;Change identity source&lt;/code&gt; để hoàn thành&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%2Fy99en0esnn2zf4k72jlx.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%2Fy99en0esnn2zf4k72jlx.png" alt="Image description" width="800" height="593"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tạo permission set&lt;br&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%2Fsaxaq96z61rtiriinqwl.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%2Fsaxaq96z61rtiriinqwl.png" alt="Image description" width="800" height="579"&gt;&lt;/a&gt;&lt;br&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%2F7bxgha1yqz87rzeujzob.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%2F7bxgha1yqz87rzeujzob.png" alt="Image description" width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tạo group&lt;br&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%2Fxxv27io0o0qt9wf72tb7.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%2Fxxv27io0o0qt9wf72tb7.png" alt="Image description" width="800" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Assign group cho AWS accounts&lt;br&gt;
Lưu ý: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Thường nên sử dụng một tài khoản AWS khác chỉ để sử dụng IAM Identity Center.&lt;/li&gt;
&lt;li&gt;Kích hoạt AWS Organization để sử dụng hiệu quả hơn khi có thể dùng 1 IAM Identity Center để đăng nhập nhiều AWS accounts cùng Organization.
&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%2F88nfv2kllt6r5b3wlcb2.png" alt="Image description" width="800" height="279"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Chọn 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%2Fyrp3i2q5a0tuq69pqi6e.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%2Fyrp3i2q5a0tuq69pqi6e.png" alt="Image description" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Chọn Permission set cho Group trên&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%2F4rctnrzdoxaoqaj5xxbg.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%2F4rctnrzdoxaoqaj5xxbg.png" alt="Image description" width="800" height="374"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sau đó nhấn Next -&amp;gt; Submit&lt;/p&gt;

&lt;p&gt;Tạo User:&lt;br&gt;
Tạo một user với email tồn tại thực trên Google Workspace&lt;br&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%2Fs11ewtccq75rxjqj1dji.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%2Fs11ewtccq75rxjqj1dji.png" alt="Image description" width="800" height="570"&gt;&lt;/a&gt;&lt;br&gt;
Gán Group cho user:&lt;br&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%2F4aij7univ3a2rshypsxo.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%2F4aij7univ3a2rshypsxo.png" alt="Image description" width="800" height="268"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On Google Console:&lt;br&gt;
Click User Access, and &lt;code&gt;ON for everyone&lt;/code&gt; or bạn có thể chọn một Group nhỏ, hoặc chỉ một OU để bật SAML App cho nó.&lt;br&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%2Foi4z5g2wnvixzs0r2kj0.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%2Foi4z5g2wnvixzs0r2kj0.png" alt="Image description" width="800" height="438"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Giờ thử test đăng nhập,&lt;br&gt;
Có 2 cách&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Đăng nhập từ AWS access portal sign-in URL : &lt;a href="https://d-xxxxx.awsapps.com/start" rel="noopener noreferrer"&gt;https://d-xxxxx.awsapps.com/start&lt;/a&gt; (Sẽ bắt đăng nhập tài khoản Google workspace nếu sử dụng google chrome profile không đúng)&lt;/li&gt;
&lt;li&gt;Đăng nhập từ tài khoản Google Workspace: Vào URL &lt;a href="https://workspace.google.com/dashboard" rel="noopener noreferrer"&gt;https://workspace.google.com/dashboard&lt;/a&gt;
&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%2F1nxz3ouq4u07lj50lnz3.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%2F1nxz3ouq4u07lj50lnz3.png" alt="Image description" width="800" height="407"&gt;&lt;/a&gt;&lt;br&gt;
Hoặc từ bất kì Google service nào, ví dụ như mail, google search:&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%2Feff1qopohk0xdyxqp1fu.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%2Feff1qopohk0xdyxqp1fu.png" alt="Image description" width="381" height="521"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nếu như hình dưới là đã đăng nhập thành công bằng SSO&lt;br&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%2Fshtwij9fga2d9x0wju8w.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%2Fshtwij9fga2d9x0wju8w.png" alt="Image description" width="800" height="120"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nếu Gặp lỗi:&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%2F8upn5uxjwayif5973243.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%2F8upn5uxjwayif5973243.png" alt="Image description" width="428" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thì cấu hình lại:&lt;br&gt;
Để trống Start URL&lt;br&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%2Fvf8oz41t6562ltitaie5.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%2Fvf8oz41t6562ltitaie5.png" alt="Image description" width="800" height="202"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Chú ý 1:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Nếu bật tính năng Automatic provisioning&lt;br&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%2Fyksg6yh7s7xtt33ru2j9.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%2Fyksg6yh7s7xtt33ru2j9.png" alt="Image description" width="800" height="84"&gt;&lt;/a&gt;&lt;br&gt;
Thì sẽ ko tạo user, group bằng tay được. Lúc này, user tự động sync từ Google Workspace qua.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Automatic provisioning không tự động sync group qua:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;SCIM automatic synchronization from Google Workspace is currently limited to user provisioning. Automatic group provisioning is not supported at this time. Groups can be manually created with AWS CLI Identity Store create-group command or AWS Identity and Access Management (IAM) API CreateGroup. Alternatively, you can use ssosync to synchronize Google Workspace users and groups into IAM Identity Center.&lt;br&gt;
Theo hướng dẫn này &lt;a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/gs-gwp.html" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/singlesignon/latest/userguide/gs-gwp.html&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Chúng ta cần tạo group bằng CLI, và assign user vào group cũng bằng CLI (Hoặc có thể tích hợp lambda function cho việc sync-up, đọc tài liệu thêm)&lt;/p&gt;

&lt;p&gt;Tóm tắt cách này:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Trên Google console: &lt;/li&gt;
&lt;li&gt;Tạo custom attribute cho user.&lt;/li&gt;
&lt;li&gt;Tạo saml app.&lt;/li&gt;
&lt;li&gt;Lấy metadata import vào AWS console khi tạo Identity provider. &lt;/li&gt;
&lt;li&gt;Cấu hình đúng các URL cần thiết.&lt;/li&gt;
&lt;li&gt;Cấu hình đúng attribute mapping.&lt;/li&gt;
&lt;li&gt;Enable saml app cho đối tượng group, ou, org cần thiết.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;(Optional) Cấu hình Autoprovisioning để tự động sync-up user.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Trên AWS console:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enable IAM Identity Center trên region cần thiết.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tạo instance name&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Thay đổi identity source thành external Identity Provider.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Import file metadata được tạo từ Google console&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tạo user/group manual (hoặc bật tính năng SCIM cho Autoprovisioning)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tạo Permission sets.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Gán user/roup và permission sets cần thiết cho AWS account ID&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  B. IAM Identity Providers (SAML in IAM)
&lt;/h2&gt;

&lt;p&gt;Trên Google:&lt;br&gt;
App -&amp;gt; Web and mobile apps -&amp;gt; Add app -&amp;gt; Add custom SAML app&lt;br&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%2F2cnj73fd06eqjswi6uvd.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%2F2cnj73fd06eqjswi6uvd.png" alt="Image description" width="800" height="965"&gt;&lt;/a&gt;&lt;br&gt;
Nhấn Next. Chờ lấy thông từ AWS console&lt;/p&gt;

&lt;p&gt;Trên AWS console:&lt;br&gt;
IAM-&amp;gt; Identity providers -&amp;gt; Add provider:&lt;br&gt;
Upload file xml vừa download ở Google dashboard&lt;br&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%2Fwu4xgroh7tvn95g2dcpu.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%2Fwu4xgroh7tvn95g2dcpu.png" alt="Image description" width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select IdP vừa tạo,&lt;br&gt;
Lấy các thông tin sau để nhập ngược lại trên Google console&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%2F9ml2ccbfa9dou03e3rtg.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%2F9ml2ccbfa9dou03e3rtg.png" alt="Image description" width="800" height="618"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Trên Google console:&lt;br&gt;
ACS URL:    &lt;a href="https://signin.aws.amazon.com/saml/acs/xxxxxx" rel="noopener noreferrer"&gt;https://signin.aws.amazon.com/saml/acs/xxxxxx&lt;/a&gt;&lt;br&gt;
Entity ID:  &lt;a href="https://signin.aws.amazon.com/saml/acs/xxxxxx" rel="noopener noreferrer"&gt;https://signin.aws.amazon.com/saml/acs/xxxxxx&lt;/a&gt;&lt;br&gt;
Name ID format: EMAIL&lt;br&gt;
Name ID:    Basic Information &amp;gt; Primary email&lt;/p&gt;

&lt;p&gt;Sau đó chọn Continue&lt;br&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%2F24rl09zib1doctodpf48.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%2F24rl09zib1doctodpf48.png" alt="Image description" width="800" height="842"&gt;&lt;/a&gt;&lt;br&gt;
Chú ý: Thông tin trên hình chưa thay đổi theo đúng yêu cầu&lt;/p&gt;

&lt;p&gt;Nhập như hình minh họa:&lt;br&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%2Fcz2uk9qkzfwmboi1uex0.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%2Fcz2uk9qkzfwmboi1uex0.png" alt="Image description" width="800" height="815"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Google Directory attributes&lt;/th&gt;
&lt;th&gt;App attributes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;AWS &amp;gt; Role*&lt;/td&gt;
&lt;td&gt;&lt;a href="https://aws.amazon.com/SAML/Attributes/Role" rel="noopener noreferrer"&gt;https://aws.amazon.com/SAML/Attributes/Role&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Basic Information &amp;gt; Primary email&lt;/td&gt;
&lt;td&gt;&lt;a href="https://aws.amazon.com/SAML/Attributes/RoleSessionName" rel="noopener noreferrer"&gt;https://aws.amazon.com/SAML/Attributes/RoleSessionName&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Đây là custom attribute. Ở bài hướng dẫn này là Role, có một số bài hướng dẫn sẽ đặt tên là "AssumeRoleWithSaml"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Trên AWS console:&lt;br&gt;
Tạo Role cho IdP:&lt;br&gt;
IAM -&amp;gt; Roles -&amp;gt; Create role&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;To create an IAM role, go to the AWS IAM console. Select Roles &amp;gt; Create role.&lt;/li&gt;
&lt;li&gt;Choose the SAML 2.0 federation role type.&lt;/li&gt;
&lt;li&gt;For SAML Provider, select the provider which you created in Step &lt;/li&gt;
&lt;li&gt;Choose Allow programmatic and AWS Management Console access to create a role that can be assumed programmatically and from the AWS Management Console.&lt;/li&gt;
&lt;li&gt;Review your SAML 2.0 trust information and then choose Next: Permissions.&lt;/li&gt;
&lt;/ol&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%2F9asg6vqgl7ydxw79zwwz.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%2F9asg6vqgl7ydxw79zwwz.png" alt="Image description" width="800" height="655"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select Permission, Next, Naming it "GoogleWorkspaceRole_old" and click Create Role&lt;/p&gt;

&lt;p&gt;Giờ là lúc gán role cho user.&lt;br&gt;
User &amp;gt; User Information &amp;gt; Category AWS&lt;br&gt;
ở Role, nhập:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;arn:aws:iam::891377004109:role/GoogleWorkspaceRole_old,arn:aws:iam::891377004109:saml-provider/GoogleWorkspace_Old
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Chú ý: gồm arn của role và arn saml-provider, ngăn cách bởi dấu phẩy&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%2Fd2xl3cqzaaikyqfm615w.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%2Fd2xl3cqzaaikyqfm615w.png" alt="Image description" width="800" height="568"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Đảm bảo&lt;br&gt;
SAML app đã được Enbale cho 1 group nhỏ, hoặc ou, hoặc toàn bộ unit, để đảm bảo user đó sử dụng được SAML app&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%2Fpsye8a4z8rw929dxvx1o.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%2Fpsye8a4z8rw929dxvx1o.png" alt="Image description" width="800" height="182"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Kiểm tra user đã login được chưa:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cách 1: vào &lt;a href="https://workspace.google.com/dashboard" rel="noopener noreferrer"&gt;https://workspace.google.com/dashboard&lt;/a&gt; chọn SAML app mới được tạo.&lt;/li&gt;
&lt;li&gt;Cách 2: Vào bất kỳ trang của google nào, ở góc trên bên phải, click vào biểu tượng 9 chấm, kéo xuống dưới cùng và tìm SAML app đó
&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%2Ffkkear0seq62k8lh6jm7.png" alt="Image description" width="345" height="485"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tóm tắt cách này:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Trên Google console: &lt;/li&gt;
&lt;li&gt;Tạo custom attribute cho user.&lt;/li&gt;
&lt;li&gt;Tạo saml app.&lt;/li&gt;
&lt;li&gt;Lấy metadata import vào AWS console khi tạo Identity provider. &lt;/li&gt;
&lt;li&gt;Cấu hình đúng các URL cần thiết.&lt;/li&gt;
&lt;li&gt;Cấu hình đúng attribute mapping.&lt;/li&gt;
&lt;li&gt;Enable saml app cho đối tượng group, ou, org cần thiết.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Nhập "role_arn,saml-provider_arn" cho user đã được enable saml app.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Trên AWS console:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tạo Identity Provider.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Import file metadata được tạo từ Google.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tạo Role cho Identity provider vừa mới tạo. Gán quyền cần thiết. Có thể tạo nhiều role với các permission khác nhau dành cho những user khác nhau.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Tổng kết
&lt;/h2&gt;

&lt;p&gt;Chúng ta đã tìm hiểu &lt;strong&gt;2 cách tích hợp Google Workspace làm IdP trên AWS&lt;/strong&gt;:&lt;/p&gt;

&lt;h3&gt;
  
  
  Cách 1: Identity Providers trong IAM
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Lấy IAM Role làm trọng tâm để phân quyền. Nhiều group với các quyền khác nhau thì phải tạo nhiều IAM Role.&lt;/li&gt;
&lt;li&gt;Đơn giản, dễ triển khai cho hệ thống cũ hoặc quy mô nhỏ&lt;/li&gt;
&lt;li&gt;Tuy nhiên, phải gán Role thủ công cho từng user&lt;/li&gt;
&lt;li&gt;Trước đây, mình dùng JumpCloud hỗ trợ gán Role theo Group rất tiện, nhưng chi phí cao&lt;/li&gt;
&lt;li&gt;Chuyển sang Google thì... phải cấu hình từng user một cách thủ công → bất tiện&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Cách 2: IAM Identity Center + Google Workspace
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Việc gán quyền (Permission Set) cho user/group giờ làm trực tiếp trong IAM Identity Center&lt;/li&gt;
&lt;li&gt;Tạo SAML App trong Google (dùng pre-integrated SAML app)&lt;/li&gt;
&lt;li&gt;Bật Autoprovisioning → tự động sync user từ Google Workspace sang AWS Identity Center&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Ưu điểm:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Tự động sync toàn bộ user từ Google Workspace → không cần tạo user thủ công&lt;/li&gt;
&lt;li&gt;Có thể gán quyền theo Group → phù hợp tổ chức lớn&lt;/li&gt;
&lt;li&gt;Trải nghiệm người dùng tốt hơn (SSO Portal, CLI, GUI, SDK...)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Nhược điểm:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Group chưa được tự động sync → phải:

&lt;ul&gt;
&lt;li&gt;Tạo group thủ công bằng CLI&lt;/li&gt;
&lt;li&gt;Hoặc dùng Lambda function để sync-up&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Chỉ tạo được MỘT pre-integrated SAML app trên Google Workspace

&lt;ul&gt;
&lt;li&gt;→ Không phù hợp nếu bạn cần tạo nhiều app cho nhiều AWS Org khác nhau&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




</description>
      <category>sso</category>
      <category>googleworkspace</category>
      <category>awslogin</category>
      <category>iam</category>
    </item>
    <item>
      <title>Accessing Remote Databases Without VPN Using SSH Tunnels</title>
      <dc:creator>Bach Huynh V. VN.Danang</dc:creator>
      <pubDate>Thu, 21 Nov 2024 08:54:09 +0000</pubDate>
      <link>https://dev.to/aws-builders/accessing-remote-databases-without-vpn-using-ssh-tunnels-42jh</link>
      <guid>https://dev.to/aws-builders/accessing-remote-databases-without-vpn-using-ssh-tunnels-42jh</guid>
      <description>&lt;h2&gt;
  
  
  Accessing Remote Databases Without VPN Using SSH Tunnels
&lt;/h2&gt;

&lt;p&gt;In this guide, we'll walk through setting up SSH tunnels to access remote databases (MariaDB and MSSQL) located in a separate network without the need for a VPN. We'll achieve this by configuring bastion servers in both networks and establishing secure SSH tunnels between them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Network Architecture&lt;/li&gt;
&lt;li&gt;Configuring SSH Servers&lt;/li&gt;
&lt;li&gt;Setting Up SSH Key Authentication&lt;/li&gt;
&lt;li&gt;Configuring SSH Client Settings&lt;/li&gt;
&lt;li&gt;Creating SSH Tunnel Services with systemd&lt;/li&gt;
&lt;li&gt;Starting and Enabling Services&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Accessing servers across different networks often requires a VPN setup, which can be cumbersome and resource-intensive. By using SSH tunnels and bastion servers, we can securely access remote databases without the overhead of a VPN.&lt;/p&gt;

&lt;h2&gt;
  
  
  Network Architecture
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Network X&lt;/strong&gt;: Contains &lt;em&gt;Server A&lt;/em&gt;, &lt;em&gt;Server B&lt;/em&gt;, and &lt;em&gt;Bastion X&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network Y&lt;/strong&gt;: Contains &lt;em&gt;MariaDB Server&lt;/em&gt;, &lt;em&gt;MSSQL Server&lt;/em&gt;, and &lt;em&gt;Bastion Y&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Goal&lt;/strong&gt;: Allow servers in Network X to access the databases in Network Y via SSH tunnels between the bastion servers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuring SSH Servers
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Update SSH Server Settings
&lt;/h3&gt;

&lt;p&gt;On both bastion servers, update the SSH daemon configuration to ensure the connection remains alive.&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/ssh/sshd_config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add or update the following lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;ClientAliveInterval&lt;/span&gt; &lt;span class="m"&gt;60&lt;/span&gt;
&lt;span class="n"&gt;ClientAliveCountMax&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
&lt;span class="n"&gt;TCPKeepAlive&lt;/span&gt; &lt;span class="n"&gt;yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Restart the SSH 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;systemctl restart sshd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Setting Up SSH Key Authentication
&lt;/h2&gt;

&lt;p&gt;To enable password-less SSH authentication, we'll generate SSH key pairs and distribute them accordingly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Generate SSH Key Pair on Bastion X
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; rsa &lt;span class="nt"&gt;-b&lt;/span&gt; 4096 &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"your_email@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Press &lt;code&gt;Enter&lt;/code&gt; to accept the default file location and set a passphrase if desired.&lt;/p&gt;

&lt;h3&gt;
  
  
  Copy Public Key to Bastion Y
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-copy-id bastion_user@&amp;lt;BastionY_IP&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alternatively, manually copy the public key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh bastion_user@&amp;lt;BastionY_IP&amp;gt; &lt;span class="s1"&gt;'mkdir -p ~/.ssh &amp;amp;&amp;amp; chmod 700 ~/.ssh'&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; ~/.ssh/id_rsa.pub | ssh bastion_user@&amp;lt;BastionY_IP&amp;gt; &lt;span class="s1"&gt;'cat &amp;gt;&amp;gt; ~/.ssh/authorized_keys'&lt;/span&gt;
ssh bastion_user@&amp;lt;BastionY_IP&amp;gt; &lt;span class="s1"&gt;'chmod 600 ~/.ssh/authorized_keys'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configuring SSH Client Settings
&lt;/h2&gt;

&lt;p&gt;To simplify SSH commands and manage connection settings, we'll create an SSH configuration file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create or Update SSH Config File
&lt;/h3&gt;

&lt;p&gt;Open or create the SSH config file in your home directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vim ~/.ssh/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;Host&lt;/span&gt; &lt;span class="n"&gt;bastionY&lt;/span&gt;
    &lt;span class="n"&gt;HostName&lt;/span&gt; &amp;lt;&lt;span class="n"&gt;BastionY_IP&lt;/span&gt;&amp;gt;
    &lt;span class="n"&gt;User&lt;/span&gt; &lt;span class="n"&gt;bastion_user&lt;/span&gt;
    &lt;span class="n"&gt;IdentityFile&lt;/span&gt; ~/.&lt;span class="n"&gt;ssh&lt;/span&gt;/&lt;span class="n"&gt;id_rsa&lt;/span&gt;
    &lt;span class="n"&gt;Port&lt;/span&gt; &lt;span class="m"&gt;22&lt;/span&gt;
    &lt;span class="n"&gt;ServerAliveInterval&lt;/span&gt; &lt;span class="m"&gt;60&lt;/span&gt;
    &lt;span class="n"&gt;ServerAliveCountMax&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Host&lt;/strong&gt;: An alias (&lt;code&gt;bastionY&lt;/code&gt;) for the SSH connection to Bastion Y.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HostName&lt;/strong&gt;: The IP address of Bastion Y (&lt;code&gt;&amp;lt;BastionY_IP&amp;gt;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User&lt;/strong&gt;: The username on Bastion Y (&lt;code&gt;bastion_user&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IdentityFile&lt;/strong&gt;: Path to your SSH private key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Port&lt;/strong&gt;: SSH port (default is &lt;code&gt;22&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ServerAliveInterval&lt;/strong&gt; and &lt;strong&gt;ServerAliveCountMax&lt;/strong&gt;: Settings to keep the SSH connection alive.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This configuration allows you to SSH into Bastion Y using the alias &lt;code&gt;bastionY&lt;/code&gt;, simplifying your SSH commands.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating SSH Tunnel Services with systemd on Bastion X
&lt;/h2&gt;

&lt;p&gt;We'll create &lt;code&gt;systemd&lt;/code&gt; service files to manage our SSH tunnels for the required ports.&lt;/p&gt;

&lt;h3&gt;
  
  
  SSH Tunnel for MariaDB (Port 3306)
&lt;/h3&gt;

&lt;p&gt;Create the service file:&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;vim /etc/systemd/system/ssh_tunnel_3306.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[Unit]&lt;/span&gt;
&lt;span class="py"&gt;Description&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;SSH Tunnel for Port 3306&lt;/span&gt;
&lt;span class="py"&gt;After&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;network.target&lt;/span&gt;

&lt;span class="nn"&gt;[Service]&lt;/span&gt;
&lt;span class="py"&gt;User&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;ec2-user&lt;/span&gt;
&lt;span class="py"&gt;ExecStart&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/usr/bin/ssh -L 3306:&amp;lt;mariadb_local_ip&amp;gt;:3306 -g bastionY -N -o TCPKeepAlive=yes -o ServerAliveInterval=60&lt;/span&gt;
&lt;span class="py"&gt;Restart&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;always&lt;/span&gt;

&lt;span class="nn"&gt;[Install]&lt;/span&gt;
&lt;span class="py"&gt;WantedBy&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;multi-user.target&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  SSH Tunnel for MSSQL (Port 1433)
&lt;/h3&gt;

&lt;p&gt;Create the service file:&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;vim /etc/systemd/system/ssh_tunnel_1433.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[Unit]&lt;/span&gt;
&lt;span class="py"&gt;Description&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;SSH Tunnel for Port 1433&lt;/span&gt;
&lt;span class="py"&gt;After&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;network.target&lt;/span&gt;

&lt;span class="nn"&gt;[Service]&lt;/span&gt;
&lt;span class="py"&gt;User&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;ec2-user&lt;/span&gt;
&lt;span class="py"&gt;ExecStart&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/usr/bin/ssh -L 1433:&amp;lt;mssql_local_ip&amp;gt;:&amp;lt;mssql port&amp;gt; -g bastionY -N -o TCPKeepAlive=yes -o ServerAliveInterval=60&lt;/span&gt;
&lt;span class="py"&gt;Restart&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;always&lt;/span&gt;

&lt;span class="nn"&gt;[Install]&lt;/span&gt;
&lt;span class="py"&gt;WantedBy&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;multi-user.target&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;User&lt;/strong&gt;: Replace &lt;code&gt;ec2-user&lt;/code&gt; with the appropriate username on your server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ExecStart&lt;/strong&gt;: The SSH command to establish the tunnel:

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-L&lt;/code&gt;: Specifies port forwarding.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;3306:&amp;lt;mariadb_local_ip&amp;gt;:3306&lt;/code&gt;: Forwards local port &lt;code&gt;3306&lt;/code&gt; to &lt;code&gt;&amp;lt;mariadb_local_ip&amp;gt;:3306&lt;/code&gt; on the remote network.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-g&lt;/code&gt;: Allows remote hosts to connect to local forwarded ports.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bastionY&lt;/code&gt;: The SSH alias we configured earlier.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-N&lt;/code&gt;: Do not execute a remote command (useful for port forwarding).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-o TCPKeepAlive=yes -o ServerAliveInterval=60&lt;/code&gt;: Keeps the SSH connection alive.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Starting and Enabling Services
&lt;/h2&gt;

&lt;p&gt;Reload the &lt;code&gt;systemd&lt;/code&gt; daemon to recognize the new service files:&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;systemctl daemon-reload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable the services to start on boot:&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;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;ssh_tunnel_3306.service
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;ssh_tunnel_1433.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start the services:&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;systemctl start ssh_tunnel_3306.service
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start ssh_tunnel_1433.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the status to ensure they're running:&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;systemctl status ssh_tunnel_3306.service
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status ssh_tunnel_1433.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;By setting up SSH tunnels and configuring them as &lt;code&gt;systemd&lt;/code&gt; services, we've established a secure and persistent connection between Network X and Network Y. Servers in Network X can now access the MariaDB and MSSQL servers in Network Y without the need for a VPN.&lt;/p&gt;




&lt;p&gt;Feel free to leave comments or ask questions if you need further assistance with this setup.&lt;/p&gt;

</description>
      <category>ssh</category>
      <category>tunnels</category>
      <category>linux</category>
    </item>
    <item>
      <title>ECS Task can not find a secret manager even if exist</title>
      <dc:creator>Bach Huynh V. VN.Danang</dc:creator>
      <pubDate>Wed, 02 Oct 2024 10:14:41 +0000</pubDate>
      <link>https://dev.to/bachhuynh/ecs-task-can-not-find-a-secret-manager-even-if-exist-50cl</link>
      <guid>https://dev.to/bachhuynh/ecs-task-can-not-find-a-secret-manager-even-if-exist-50cl</guid>
      <description>&lt;p&gt;Có khi nào bạn gặp phải trường hợp là chạy một ECS Task nhưng báo lỗi là không tìm thấy Secret trong SecretManager được khai báo trong taskdefinition?&lt;br&gt;
Mặc dù khi kiểm tra là có tồn tại Secret đó.&lt;/p&gt;

&lt;p&gt;Một nguyên nhân mà mình gặp phải đó là tên của Secret đó có kết thúc là &lt;code&gt;-xxxxxx&lt;/code&gt; (Gạch ngang và 6 ký tự).&lt;/p&gt;

&lt;p&gt;Lý giải:&lt;/p&gt;

&lt;p&gt;Khi các bạn tạo ra một Secret có dạng ví dụ như sau &lt;code&gt;dev-au/shared-config/mysql-vars&lt;/code&gt;. Thì nó có một Secret ARN là &lt;code&gt;arn:aws:secretsmanager:ap-southeast-2:058264301000:secret:dev-au/shared-config/mysql-vars-ZptsLA&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;-ZptsLA&lt;/code&gt; là ký tự được SecretManager tự thêm vào để đảm bảo tính duy nhất.&lt;/p&gt;

&lt;p&gt;Vậy nếu bạn đặt tên &lt;code&gt;dev-au/shared-config/mysql-server&lt;/code&gt;, thì SecretManager tự động hiểu &lt;code&gt;-server&lt;/code&gt; là ký tự mà nó đã thêm vào (vì có gạch ngang và 6 ký tự), và tìm chính xác hoàn toàn tuyệt đối ARN &lt;code&gt;arn:aws:secretsmanager:ap-southeast-2:058264301000:secret:dev-au/shared-config/mysql-vars-server&lt;/code&gt; dẫn tới hệ thống báo không có Secret này.&lt;/p&gt;

&lt;p&gt;Vì thế: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hạn chế sử dụng sử dụng &lt;code&gt;-xxxxxx&lt;/code&gt; ở cuối tên Secret.&lt;/li&gt;
&lt;li&gt;Nếu lỡ đặt rồi, thì cần phải đưa chính xác ARN của Secret tức là bao gồm các ký tự ngẫu nhiên được sinh ra.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>secretmanager</category>
      <category>aws</category>
      <category>ecs</category>
      <category>taskdefinition</category>
    </item>
    <item>
      <title>Các lệnh hay trên CMD của Windows</title>
      <dc:creator>Bach Huynh V. VN.Danang</dc:creator>
      <pubDate>Thu, 19 Sep 2024 09:22:13 +0000</pubDate>
      <link>https://dev.to/bachhuynh/cac-lenh-hay-tren-cmd-cua-windows-5fpf</link>
      <guid>https://dev.to/bachhuynh/cac-lenh-hay-tren-cmd-cua-windows-5fpf</guid>
      <description>&lt;p&gt;Cài đặt choco (chạy được trên container Windows Server 2022 Core)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" &amp;amp;&amp;amp; SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install nano (Vim khá tệ nên ko cài vim)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;choco install nano
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>WSL in AWS Windows Server 2022 Core instance</title>
      <dc:creator>Bach Huynh V. VN.Danang</dc:creator>
      <pubDate>Fri, 13 Sep 2024 11:40:42 +0000</pubDate>
      <link>https://dev.to/bachhuynh/wsl-in-aws-windows-server-2022-core-instance-58pb</link>
      <guid>https://dev.to/bachhuynh/wsl-in-aws-windows-server-2022-core-instance-58pb</guid>
      <description>&lt;p&gt;Hiện nay, nhu cầu chạy Linux trong Windows cũng bắt đầu nở rộ.&lt;br&gt;
Nhân một việc là tìm hiểu khả năng đặt linux-container lên 1 con EC2 Windows Server 2022 Core của dự án hiện tại dùng ECS thì mình có take note như sau:&lt;/p&gt;

&lt;p&gt;Có thể cài đặt WSL trên EC2 Windows Server 2022 Core Instance được không?&lt;/p&gt;

&lt;p&gt;Câu trả lời là có!&lt;/p&gt;

&lt;p&gt;Hiện tại một số hướng dẫn chỉ hướng dẫn trên EC2 Windows Server 2022 Full là bản có GUI. Ko áp dụng cho bản Core được.&lt;/p&gt;

&lt;p&gt;Vì thế hãy thực hiện các bước sau để cài đặt WSL nhé!&lt;/p&gt;

&lt;p&gt;Trước tiên cần chú ý:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;WSL có 2 phiên bản wsl ver 1 và wsl ver 2.&lt;/li&gt;
&lt;li&gt;WSL ver 2 chỉ chạy được với EC2 .mental instance type.&lt;/li&gt;
&lt;li&gt;WSL ver 1 thì chạy được trên virtualized EC2 instances. Và hỗ trợ 

&lt;ul&gt;
&lt;li&gt;Windows Server 2019&lt;/li&gt;
&lt;li&gt;Windows Server 2022.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1. Pre Setup steps:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

curl -o wsl_update_x64.cab https://catalog.s.download.windowsupdate.com/d/msdownload/update/software/updt/2022/03/wsl_update_x64_8b248da7042adb19e7c5100712ecb5e509b3ab5f.cab
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Vào sconfig để restart Windows (Bắt buộc)&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff49pkg7jo7jj8ub6shc5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff49pkg7jo7jj8ub6shc5.png" alt="Sconfig" width="800" height="439"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install wsl manual (Cho chắc chắn, có thể ko cần)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;expand.exe wsl_update_x64.cab wsl_update_x64.msi
msiexec.exe /package wsl_update_x86.msi /passive /promptrestart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Tải Ubuntu 2204:&lt;/strong&gt;&lt;br&gt;
Đoạn dưới tham khảo tại: &lt;br&gt;
&lt;a href="https://lucyllewy.com/wsl2-on-server-2022/" rel="noopener noreferrer"&gt;https://lucyllewy.com/wsl2-on-server-2022/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Có chỉnh sửa cho phù hợp thực tế&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl.exe -L -o wsl-distro.zip https://aka.ms/wslubuntu2204
Expand-Archive wsl-distro.zip .\extracted-distro-step1
Rename-Item .\extracted-distro-step1\Ubuntu_2204.1.7.0_x64.appx distro.zip
Expand-Archive .\extracted-distro-step1\distro.zip .\extracted-distro-step2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Setting version WSL và import Ubuntu đã tải vào.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wsl --set-default-version 1
wsl --import Ubuntu2204 C:\Users\Administrator\WSL-disks\Ubuntu2204 .\extracted-distro-step2\install.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Xem các linux subsystem&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyatpurasum4236soij8d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyatpurasum4236soij8d.png" alt="linux subsystem" width="390" height="55"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Vào wsl:&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgl5wf99aungnnkrrif4r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgl5wf99aungnnkrrif4r.png" alt="Access WSL" width="800" height="255"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Như vậy, bạn đã thành công cài đặt WSL trên Windows Server 2022 Core EC2 instance.&lt;/p&gt;

&lt;p&gt;Quay trở vấn đề dùng ECS EC2 Windows platform, thì việc cài WSL không giúp ECS đặt linux-container lên Windows EC2 instance được. Vì docker của Windows và docker của WSL hoạt động độc lập.&lt;/p&gt;

</description>
      <category>wsl</category>
      <category>linuxcontaineronwindows</category>
      <category>ecs</category>
      <category>ecslinuxcontaineronwindows</category>
    </item>
    <item>
      <title>Forward AWS Config Folder to Container</title>
      <dc:creator>Bach Huynh V. VN.Danang</dc:creator>
      <pubDate>Thu, 29 Aug 2024 09:27:39 +0000</pubDate>
      <link>https://dev.to/bachhuynh/forward-aws-config-folder-to-container-1b5f</link>
      <guid>https://dev.to/bachhuynh/forward-aws-config-folder-to-container-1b5f</guid>
      <description>&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt;&lt;br&gt;
The purpose of this guideline is to enable the seamless use of AWS CLI commands within a Docker container by forwarding your existing AWS configuration and credentials from your host machine into the container. This allows the container to authenticate and interact with AWS services without the need to reconfigure credentials inside the container.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are two primary methods to forward the AWS config folder to a Docker container:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Mount the AWS config folder to the container - This is ideal for environments where the Docker context is running on the same OS as the host machine (e.g., both are Linux or both are Windows).&lt;/li&gt;
&lt;li&gt;Copy the AWS config folder into the container - This method is useful when the Docker context is running on a different OS than the host machine (e.g., Ubuntu or MacOS host with a Windows container).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;1. Mount AWS Config Folder to Container&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This method allows you to directly mount the AWS configuration folder from the host machine to the container. This solution works well when the Docker context is running on the same operating system as the host machine.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;On Windows:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For a Windows host and Windows container:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker run -v &amp;lt;Path to .aws folder&amp;gt;:C:/Users/ContainerAdministrator/.aws -it &amp;lt;your-windows-container-image&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;On Linux:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For a Linux host and Linux container:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker run -v ~/.aws:/root/.aws -it &amp;lt;your-linux-container-image&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;em&gt;On MacOS:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For a MacOS host and Linux container:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker run -v ~/.aws:/root/.aws -it &amp;lt;your-linux-container-image&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Copy AWS Config Folder to Container&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This method involves copying the AWS configuration files from the host machine into the container. This is particularly useful when the host and the Docker context are running on different operating systems, such as using a MacOS or Ubuntu host with a Windows container.&lt;/p&gt;

&lt;p&gt;On Ubuntu/MacOS with Docker context pointing to a Windows instance:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker cp ~/.aws &amp;lt;your-container-name&amp;gt;:C:/Users/ContainerAdministrator/.aws&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Start your container:&lt;br&gt;
&lt;code&gt;docker run -d --name &amp;lt;your-container-name&amp;gt; &amp;lt;your-windows-container-image&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Copy the AWS config folder to the container:&lt;br&gt;
&lt;code&gt;docker cp ~/.aws &amp;lt;your-container-name&amp;gt;:C:/Users/ContainerAdministrator/.aws&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Verify that the AWS config has been copied correctly by accessing the container:&lt;br&gt;
&lt;code&gt;docker exec -it &amp;lt;your-container-name&amp;gt; cmd&lt;br&gt;
dir C:\Users\ContainerAdministrator\.aws&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Important Notes:&lt;/p&gt;

&lt;p&gt;Ensure that the directory paths are correctly specified according to your environment.&lt;/p&gt;

&lt;p&gt;On Windows, you need to use the full path to the .aws directory, while on Linux and MacOS, you can use ~/.aws.&lt;/p&gt;

&lt;p&gt;Depending on the container image, the user home directory may differ. On Linux containers, the home directory is typically /root, while on Windows containers, it might be C:/Users/ContainerAdministrator.&lt;/p&gt;

&lt;p&gt;When mounting volumes between different operating systems (e.g., mounting a Linux directory into a Windows container), ensure that the paths and permissions are correctly configured to avoid any permission issues or path incompatibilities.&lt;/p&gt;

&lt;p&gt;This guideline should cover most scenarios where you need to forward your AWS credentials and configurations into a Docker container, ensuring that your containerized applications can seamlessly interact with AWS services.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>ZSH with Starship</title>
      <dc:creator>Bach Huynh V. VN.Danang</dc:creator>
      <pubDate>Wed, 28 Aug 2024 02:58:43 +0000</pubDate>
      <link>https://dev.to/bachhuynh/zsh-with-starship-do2</link>
      <guid>https://dev.to/bachhuynh/zsh-with-starship-do2</guid>
      <description>&lt;p&gt;&lt;code&gt;brew install starship&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;add the end of file ~/.zshrc&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Starship
export STARSHIP_CONFIG=~/.config/starship.toml
export STARSHIP_CACHE=~/.starship/cache
eval "$(starship init zsh)"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;comment this line (if you are using power9k)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# source ~/powerlevel9k/powerlevel9k.zsh-theme
# ZSH_THEME=robbyrussell
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install Fonts (Dành cho Ubuntu, nếu macOS thì tải về và click đôi vào file otf hoặc tff để install):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Tạo thư mục tạm để lưu các tệp tải về
mkdir ~/nerd-fonts &amp;amp;&amp;amp; cd ~/nerd-fonts # Tải xuống các tệp zip
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/DroidSansMono.zip
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/NerdFontsSymbolsOnly.zip
# Giải nén DroidSansMono
unzip DroidSansMono.zip -d DroidSansMono 
# Giải nén NerdFontsSymbolsOnly
unzip NerdFontsSymbolsOnly.zip -d NerdFontsSymbolsOnly
sudo mkdir -p /usr/share/fonts/truetype/nerd-fonts
sudo cp DroidSansMono/*.otf /usr/share/fonts/truetype/nerd-fonts/
sudo cp NerdFontsSymbolsOnly/*.ttf /usr/share/fonts/truetype/nerd-fonts/
sudo fc-cache -fv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Get theme&lt;br&gt;
&lt;code&gt;starship preset gruvbox-rainbow -o ~/.config/starship.toml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;or&lt;br&gt;
copy this to the starship.toml (AWS added)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"$schema" = 'https://starship.rs/config-schema.json'

format = """
[](color_orange)\
$os\
$username\
[](bg:color_yellow fg:color_orange)\
$directory\
[](fg:color_yellow bg:color_aqua)\
$aws\
$git_branch\
$git_status\
[](fg:color_aqua bg:color_blue)\
$c\
$rust\
$golang\
$nodejs\
$php\
$java\
$kotlin\
$haskell\
$python\
[](fg:color_blue bg:color_bg3)\
$docker_context\
$conda\
[](fg:color_bg3 bg:color_bg1)\
$time\
[ ](fg:color_bg1)\
$line_break$character"""

palette = 'gruvbox_dark'

[palettes.gruvbox_dark]
color_fg0 = '#fbf1c7'
color_bg1 = '#3c3836'
color_bg3 = '#665c54'
color_blue = '#458588'
color_aqua = '#689d6a'
color_green = '#98971a'
color_orange = '#d65d0e'
color_purple = '#b16286'
color_red = '#cc241d'
color_yellow = '#d79921'

[os]
disabled = false
style = "bg:color_orange fg:color_fg0"

[os.symbols]
Windows = "󰍲"
Ubuntu = "󰕈"
SUSE = ""
Raspbian = "󰐿"
Mint = "󰣭"
Macos = "󰀵"
Manjaro = ""
Linux = "󰌽"
Gentoo = "󰣨"
Fedora = "󰣛"
Alpine = ""
Amazon = ""
Android = ""
Arch = "󰣇"
Artix = "󰣇"
CentOS = ""
Debian = "󰣚"
Redhat = "󱄛"
RedHatEnterprise = "󱄛"


[username]
show_always = true
style_user = "bg:color_orange fg:color_fg0"
style_root = "bg:color_orange fg:color_fg0"
format = '[ $user ]($style)'

[directory]
style = "fg:color_fg0 bg:color_yellow"
format = "[ $path ]($style)"
truncation_length = 3
truncation_symbol = "…/"

[directory.substitutions]
"Documents" = "󰈙 "
"Downloads" = " "
"Music" = "󰝚 "
"Pictures" = " "
"Developer" = "󰲋 "

[aws]
format = '[$symbol($profile )(\($region\) )]($style)'
style = 'fg:color_fg0 bg:color_orange'
symbol = '  '
[aws.region_aliases]
ap-southeast-2 = 'au'
us-east-1 = 'va'
[aws.profile_aliases]
CompanyGroupFrobozzOnCallAccess = 'Frobozz'

[git_branch]
symbol = ""
style = "bg:color_aqua"
format = '[[ $symbol $branch ](fg:color_fg0 bg:color_aqua)]($style)'

[git_status]
style = "bg:color_aqua"
format = '[[($all_status$ahead_behind )](fg:color_fg0 bg:color_aqua)]($style)'

[nodejs]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[c]
symbol = " "
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[rust]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[golang]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[php]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[java]
symbol = " "
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[kotlin]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[haskell]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[python]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'

[docker_context]
symbol = ""
style = "bg:color_bg3"
format = '[[ $symbol( $context) ](fg:#83a598 bg:color_bg3)]($style)'

[conda]
style = "bg:color_bg3"
format = '[[ $symbol( $environment) ](fg:#83a598 bg:color_bg3)]($style)'

[time]
disabled = false
time_format = "%R"
style = "bg:color_bg1"
format = '[[  $time ](fg:color_fg0 bg:color_bg1)]($style)'

[line_break]
disabled = false

[character]
disabled = false
success_symbol = '[](bold fg:color_green)'
error_symbol = '[](bold fg:color_red)'
vimcmd_symbol = '[](bold fg:color_green)'
vimcmd_replace_one_symbol = '[](bold fg:color_purple)'
vimcmd_replace_symbol = '[](bold fg:color_purple)'
vimcmd_visual_symbol = '[](bold fg:color_yellow)'

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Choose correct font on VSC and Terminal&lt;/p&gt;

&lt;p&gt;Open Setting VSC: CMD+Shift+P&lt;br&gt;
Type: setting&lt;br&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%2Ffstdip86vthguzg7sqn6.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%2Ffstdip86vthguzg7sqn6.png" alt="Open Setting on VSC" width="774" height="82"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Search: Font&lt;br&gt;
Point to Editor:&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%2F7n18ogn1mxga0veewha2.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%2F7n18ogn1mxga0veewha2.png" alt="Editor font" width="594" height="137"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add thêm: DroidSansMono Nerd Font, Symbols Nerd Font&lt;/p&gt;

&lt;p&gt;Point to Terminal:&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%2Fm3wdsc9zxxcfgdebb12m.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%2Fm3wdsc9zxxcfgdebb12m.png" alt="Terminal font" width="665" height="123"&gt;&lt;/a&gt;&lt;br&gt;
Add thêm: DroidSansMono Nerd Font, Symbols Nerd Font&lt;/p&gt;
&lt;h1&gt;
  
  
  Khởi động lại zsh
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;exec zsh&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Chú ý nếu setup trên môi trường mới:&lt;br&gt;
cần cài đặt lại zsh, oh-my-zsh để có thể dùng được các plugin như zsh-autosuggestions&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting\

git clone https://github.com/zsh-users/zsh-completions.git ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Với Firebase Studio cần chú ý đặt những biến sau vào ~/.zshrc&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HISTSIZE=10000000
SAVEHIST=10000000
setopt HIST_IGNORE_DUPS
setopt APPEND_HISTORY
setopt SHARE_HISTORY
setopt INC_APPEND_HISTORY 
ZSH_DISABLE_COMPFIX="true"
autoload -Uz compinit &amp;amp;&amp;amp; compinit # Đặt trên plugins
plugins=(git zsh-autosuggestions zsh-syntax-highlighting zsh-completions)
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8'
export ZSH=~/.oh-my-zsh
source $ZSH/oh-my-zsh.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Quick create virtual env for python</title>
      <dc:creator>Bach Huynh V. VN.Danang</dc:creator>
      <pubDate>Wed, 21 Aug 2024 10:09:37 +0000</pubDate>
      <link>https://dev.to/bachhuynh/quick-create-virtual-env-for-python-33m8</link>
      <guid>https://dev.to/bachhuynh/quick-create-virtual-env-for-python-33m8</guid>
      <description>&lt;h1&gt;
  
  
  move to the folder
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;cd python-script&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Setup virtualenv
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;python3 -m venv &amp;lt;env-name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Create a virtualenv
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;virtualenv &amp;lt;env-name&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  activate the virtualenv
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;source &amp;lt;env-name&amp;gt;/bin/activate&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  install boto3
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;pip install boto3&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  run script
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;cd ..&lt;br&gt;
python &amp;lt;python file name&amp;gt;&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Useful SQL Query command</title>
      <dc:creator>Bach Huynh V. VN.Danang</dc:creator>
      <pubDate>Wed, 21 Aug 2024 04:30:42 +0000</pubDate>
      <link>https://dev.to/bachhuynh/useful-sql-query-command-36n4</link>
      <guid>https://dev.to/bachhuynh/useful-sql-query-command-36n4</guid>
      <description>&lt;p&gt;Check your Database server connection encrypt or not:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mysql&amp;gt; show status like '%onn%';
+--------------------------+-------+
| Variable_name            | Value |
+--------------------------+-------+
| Aborted_connects         | 0     |
| Connections              | 303   |
| Max_used_connections     | 127   |
| Ssl_client_connects      | 0     |
| Ssl_connect_renegotiates | 0     |
| Ssl_finished_connects    | 0     |
| Threads_connected        | 127   |
+--------------------------+-------+
7 rows in set (0.01 sec)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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