<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Siwawong Wuttipongprasert on Medium]]></title>
        <description><![CDATA[Stories by Siwawong Wuttipongprasert on Medium]]></description>
        <link>https://medium.com/@siwawong.wut?source=rss-90bbcaa5e9da------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Qgw7EwTBg-Idxq7_.</url>
            <title>Stories by Siwawong Wuttipongprasert on Medium</title>
            <link>https://medium.com/@siwawong.wut?source=rss-90bbcaa5e9da------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 09:32:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@siwawong.wut/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ทำ Skill ให้ AI ทำงานทั้งโปรเจคแทนคนทั้งทีม]]></title>
            <link>https://medium.com/@siwawong.wut/%E0%B8%97%E0%B8%B3-skill-%E0%B9%83%E0%B8%AB%E0%B9%89-ai-%E0%B8%97%E0%B8%B3%E0%B8%87%E0%B8%B2%E0%B8%99%E0%B8%97%E0%B8%B1%E0%B9%89%E0%B8%87%E0%B9%82%E0%B8%9B%E0%B8%A3%E0%B9%80%E0%B8%88%E0%B8%84%E0%B9%81%E0%B8%97%E0%B8%99%E0%B8%84%E0%B8%99%E0%B8%97%E0%B8%B1%E0%B9%89%E0%B8%87%E0%B8%97%E0%B8%B5%E0%B8%A1-44fb4e046632?source=rss-90bbcaa5e9da------2</link>
            <guid isPermaLink="false">https://medium.com/p/44fb4e046632</guid>
            <dc:creator><![CDATA[Siwawong Wuttipongprasert]]></dc:creator>
            <pubDate>Thu, 03 Dec 2026 18:23:23 GMT</pubDate>
            <atom:updated>2026-12-03T18:23:23.352Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C8b2Gq05dfqiniU8-Kcbyw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@markuswinkler?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Markus Winkler</a> on <a href="https://unsplash.com/photos/white-and-black-typewriter-with-white-printer-paper-tGBXiHcPKrM?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>สืบเนื่องมาจากการพยายามผลักดันให้คนในทีม พยายามใช้ AI ในการทำงาน (หรือว่าเขียนโค้ดนี่แหละ) ให้มากขึ้น เริ่มจากการ setup ส่วนเสริมต่างๆ เข้าไปในพวก AI Agent Harness (ซึงในทีมก็ใช้ Antigravity Desktop นี่แหละ)</p><p>จริงๆ พอเริ่มใช้พวกนี้ ชีวิตก็ดีขึ้นจริงๆ คือวันหนึ่ง พวกเล่นปิดกันวันละ 20 issues ต่อคน แต่หลังๆ มา Antigravity ก็มีแต่โมเดลง่อยๆ มาให้ใช้ บอกให้แก้ไขที ออกทะเลบ่อยมาก</p><p>พอๆ ไปค้นๆ มาเค้าก็บอกว่า ลองใช้ <strong>Skill </strong>มาควบคุมสิ จะได้ควบคุมงานได้ ซึ่งพอโหลด skill ต่างๆ มาใช้ก็พบว่า</p><ul><li><a href="https://github.com/google/elephant-goldfish-model">EGM</a> (Elephant-Goldfish model) : ก็ดีนะ ลงผ่าน Antigravity Desktop ได้โดยตรง แต่ทำงานช้าชะมัด</li><li><a href="https://github.com/backnotprop/pstack">pstack</a> : เอา version ที่เค้า port จาก Cursor, พอใช้จริงผลาญ token นรก</li><li><a href="https://github.com/obra/superpowers">Superpowers</a>: เอาทดสอบนิดๆ หน่อยๆ ก็ชอบนะ</li></ul><p>พอมาดู…อ้าว จะทำงานทีลง 3 skills และแต่ละ skill ก็ดีเสียต่างกัน คำสั่งก็เยอะบรม ต้องเสียเวลาจำคำสั่งใช้งานที่ยุบยับ แล้วเราไม่มี skill เดียวที่</p><ul><li>ผลาญ token น้อยๆ (สำคัญสุด)</li><li>ทำงานตาม SDLC (Software Development Life Cycle)</li><li>เก่งเรื่อง requirements &amp; analyse แบบ EGM</li><li>ตรวจสอบผลการแก้ไขก่อนแจ้งแบบ pstack</li><li>เข้มงวดกับ TDD (Test-driven Development) แบบ Superpowers</li><li>ไม่จริตกับลักษณะงานที่กำลังทำอยู่</li></ul><p>เมื่อไม่มี หรือหาไม่เจอ….ก็สร้างมันสะสิ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tOkcp-jtZE84aoE10ODD5Q.avif" /><figcaption><a href="https://unsplash.com/photos/a-brick-wall-with-a-neon-sign-on-it-_T8X9pZyKaQ">https://unsplash.com/photos/a-brick-wall-with-a-neon-sign-on-it-_T8X9pZyKaQ</a></figcaption></figure><blockquote>สิ่งที่ได้คือ <a href="https://github.com/siwawong/tstack">https://github.com/siwawong/tstack</a></blockquote><p>โดยเน้นให้ Skill Plugin ที่คุมขนาดไฟล์หลัก SKILL.md ให้ต่ำกว่า 800 tokens และใน skill แบ่งออกเป็น 4 เฟสหลัก (บวก Phase 0 /t-setup ตรวจความพร้อมก่อนเริ่ม):</p><ol><li><strong>Spec &amp; Audit:</strong> เคลียร์ Requirement ทำ Spec แบบกระชับ และใช้ Dual Goldfish subagents แยกบริบทช่วยรีวิว</li><li><strong>Isolate &amp; Plan:</strong> แยก Git worktree อัตโนมัติ พร้อมแตกงานย่อยระดับ 2–5 นาที</li><li><strong>Disciplined TDD:</strong> เขียนโค้ดตามรอบ Red-Green-Refactor อย่างเคร่งครัด</li><li><strong>Verify &amp; Ship:</strong> ทดสอบรันไทม์จริง ตรวจ Diff และเปิด PR</li></ol><p>สำหรับงานระดับองค์กรที่มีหลาย Repo สามารถใช้ --handoff และ --refine เพื่อกระจาย Spec ให้ทีมย่อย พร้อมระบบ Stale Downstream Guard (--resync-from) ป้องกันโค้ดปลายน้ำพังเมื่อต้นน้ำแก้ไข</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FFkh0Uu4bp5QrvG8B0uYHQ.avif" /><figcaption><a href="https://unsplash.com/photos/a-device-with-a-plus-sign-prints-out-code--mC54EuxfqY">https://unsplash.com/photos/a-device-with-a-plus-sign-prints-out-code--mC54EuxfqY</a></figcaption></figure><p>ลองใช้เองหล่ะ ทำงานส่งขึ้น Production, พัฒนา features เพิ่ม, แก้ไข bugs จากทีม Pentests, etc. มาประมาณ 1 สัปดาห์ ก็พบว่า</p><ul><li>เอา requirements ที่อยากได้แปะลงไป, ตัว AI Agent Harness ทำงานให้หมดเป็น stage และแต่ละ stage ให้ preview ก่อนสั่ง</li><li>สั่งงานทีละหลาย project พร้อมกัน จะได้ไม่รอ</li><li>แรกๆ นานชิบ ตอนนี้ เร็วขึ้นหล่ะ</li></ul><p>แต่บอกก่อนนะ ว่าผลการทดสอบข้างต้น</p><ul><li>ทดสอบกับ Antigravity Desktop application เป็นหลัก ยังไม่เคยทดสอบกับ Claude หรือ Codex</li><li>ใช้ Gemini 4 Neon กับ Hydrogen สลับไปมา</li></ul><p>หากใครกำลังปวดหัวกับ Agent ที่กิน Token เยอะแต่หลุด Spec บ่อย หรือต้องคุมงาน Feature ข้ามหลาย Repo ลองเอา t-stack ไปปรับใช้กับเวิร์กโฟลว์ของทีมดูได้ครับ โค้ดและสคริปต์ทั้งหมดเปิดให้ใช้งานภายใต้ MIT License <a href="https://github.com/siwawong/tstack">https://github.com/siwawong/tstack</a> — ยินดีรับ Feedback และ Issue เพื่อนำไปขัดเกลาต่อครับ</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44fb4e046632" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Backup ฐานข้อมูล MySQL ไว้บน S3 bucket]]></title>
            <link>https://medium.com/@siwawong.wut/backup-%E0%B8%90%E0%B8%B2%E0%B8%99%E0%B8%82%E0%B9%89%E0%B8%AD%E0%B8%A1%E0%B8%B9%E0%B8%A5-mysql-%E0%B9%84%E0%B8%A7%E0%B9%89%E0%B8%9A%E0%B8%99-s3-bucket-a4e0135cd885?source=rss-90bbcaa5e9da------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4e0135cd885</guid>
            <dc:creator><![CDATA[Siwawong Wuttipongprasert]]></dc:creator>
            <pubDate>Sat, 09 May 2020 04:01:01 GMT</pubDate>
            <atom:updated>2020-05-09T04:01:01.028Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*QRjg-E6Q1wOtepskTS7aNw.jpeg" /></figure><p>บทความนี้จะยกตัวอย่าง<strong>การสำรองข้อมูล</strong> (Backup) ของฐานข้อมูล MySQL เพื่อเก็บไว้ใน S3 bucket โดยอัตโนมัติ ในทุกๆ วัน</p><h3>ก่อนจะเริ่ม</h3><p>เรามาดูก่อนว่า เราต้องมีอะไรบ้าง?</p><ul><li>มี AWS Account</li><li>มี EC2 instance พร้อม AWS CLI ที่ติดตั้งและ configure แล้ว</li><li>มี S3 bucket ที่เป็นแบบ Private</li><li>มีผู้ใช้ที่เข้าถึง AWS Platform แบบ Programmatic และมีสิทธิ์เข้าถึง EC2 และ S3 แบบ Full Permission</li><li>ใช้ฐานข้อมูล MySQL เป็น และรู้จัก command line เบื้องต้น</li></ul><p>รายละเอียดข้างต้น สามารถอ่านได้จาก<a href="https://medium.com/@siwawong.wut/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%83%E0%B8%8A%E0%B9%89%E0%B8%87%E0%B8%B2%E0%B8%99-iam-user-%E0%B9%81%E0%B8%9A%E0%B8%9A-programmatic-%E0%B8%9C%E0%B9%88%E0%B8%B2%E0%B8%99-cli-b62ad42a312b">บทความเก่า</a></p><p><strong>พร้อมแล้ว เรามาลองกันเลย!!</strong></p><p><strong>ขั้นที่ 1</strong> — สร้าง script สำหรับ backup ฐานข้อมูล ในชื่อ <strong>daily_backup.sh</strong></p><pre># Create variables that will be used later<br>hour=`date +%Y%m%d_%H%M%S`<br>mysql_user=<strong>&#39;YourUserName&#39;</strong><br>mysql_password=<strong>&#39;YourPassword&#39;</strong><br>database_name=<strong>&#39;YourDatabaseName&#39;</strong><br>s3_bucket_name=<strong>&#39;YourS3BucketName&#39;</strong></pre><pre># Backup database into a sql dump file and save it to /tmp folder (you can store it elsewhere if desired)<br>mysqldump -u$mysql_user -p$mysql_password $database_name &gt; /tmp/$hour.sql </pre><pre># ZIP<br>zip /tmp/$hour.sql.zip /tmp/$hour.sql</pre><pre># Move file from server to your S3 bucket<br># IMPORTANT: depending on your setup, you may have to call the full<br># directory of the aws executable instead of aws.  For example: <br># /home/ec2-user/.local/bin/aws<br>aws s3 mv /tmp/$hour.sql.zip s3://$s3_bucket_name/</pre><p>จุดสังเกตใน script นี้คือ เรามีการใช้คำสั่ง mv เพื่อย้ายไฟล์จาก folder tmp ไปเก็บใน S3 bucket ที่เราต้องการ</p><p><strong>ขั้นที่ 2 </strong>— ทดสอบ script ที่เราสร้างโดยการ run ที่ terminal ดู</p><pre>$ sh daily_backup.sh</pre><p>หลังจากนั้น ลงไปตรวจสอบผลที่ S3 bucket ที่กำหนดไว้ ว่ามีไฟล์ zip ที่เราต้องการหรือไม่?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NZvkI1vHwxWpfRmpVcBbCA.png" /></figure><p><strong>ขั้นที่ 3</strong>— ตั้ง schedule ให้ทำการ backup ข้อมูลอัตโนมัติผ่าน Cron</p><pre>$ sudo crontab -e</pre><p>ระบบจะถาม editor ที่ต้องการใช้งาน (สำหรับผมเลือก nano เพราะง่ายดี) และทำการเปิดไฟล์ cronjob เพี่อตั้งเวลาให้ทำงาน ซึ่งรูปแบบการระบุเวลาจะเป็นตามตารางด้านล่าง</p><pre> +---------------- minute (0 - 59)<br> |  +------------- hour (0 - 23)<br> |  |  +---------- day of month (1 - 31)<br> |  |  |  +------- month (1 - 12)<br> |  |  |  |  +---- day of week (0 - 6) (Sunday=0 or 7)<br> |  |  |  |  |<br> *  *  *  *  *  command to be executed</pre><p>เช่น ต้องการจะสำรองข้อมูลทุกๆ 4ทุ่มของทุกวัน เราสามารถพิมพ์คำสั่งเพิ่มเติมได้ดังนี้</p><pre>#everyday at 10 pm<br>00 22 * * * /bin/bash /home/ubuntu/daily_backup.sh</pre><p>เพียงแค่นี้ เราก็จะสามารถสำรองข้อมูลที่เรา ❤ ได้ทุกวัน โดยอัตโนมัติ</p><p><strong>อ้างอิง</strong></p><ul><li><a href="https://medium.com/@vishal.sharma./create-an-aws-s3-bucket-using-aws-cli-5a19bc1fda79">https://medium.com/@vishal.sharma./create-an-aws-s3-bucket-using-aws-cli-5a19bc1fda79</a></li><li><a href="https://medium.com/@ss.shawnshi/backup-mysql-database-hourly-and-send-them-to-aws-s3-for-storage-adf4977c18f9">https://medium.com/@bansalnagesh/backing-up-mongodb-on-aws-ec2-to-s3-b045b5727fd6</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4e0135cd885" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[การใช้งาน IAM user แบบ Programmatic ผ่าน CLI]]></title>
            <link>https://medium.com/@siwawong.wut/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%83%E0%B8%8A%E0%B9%89%E0%B8%87%E0%B8%B2%E0%B8%99-iam-user-%E0%B9%81%E0%B8%9A%E0%B8%9A-programmatic-%E0%B8%9C%E0%B9%88%E0%B8%B2%E0%B8%99-cli-b62ad42a312b?source=rss-90bbcaa5e9da------2</link>
            <guid isPermaLink="false">https://medium.com/p/b62ad42a312b</guid>
            <category><![CDATA[aws-cli]]></category>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[aws-iam]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Siwawong Wuttipongprasert]]></dc:creator>
            <pubDate>Wed, 06 May 2020 04:01:01 GMT</pubDate>
            <atom:updated>2020-05-06T04:01:01.410Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*lzLXJCWOSkc8wTCPwZXo5Q.png" /><figcaption>AWS CLI — Command Line สำหรับใช้งาน AWS services</figcaption></figure><p>จาก<a href="https://medium.com/@siwawong.wut/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%88%E0%B8%B1%E0%B8%94%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B9%83%E0%B8%8A%E0%B9%89%E0%B8%9A%E0%B8%99-aws-platform-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-aws-iam-660892c8624f">บทความที่แล้ว</a> ที่เล่าเกี่ยวกับ<strong>ชนิดของผู้ใช้</strong> (User) ใน <strong>AWS IAM</strong> ว่ามี <strong>2 แบบ</strong>คือ “<strong>AWS Management Console</strong>”​ และ “<strong>Programmatic</strong>” ซึ่งในบทความนี้ จะกล่าวถึงการสร้างผู้ใช้แบบ <strong>Programmatic </strong>พร้อมยกตัวอย่างการใช้งาน</p><h3>ก่อนเริ่ม</h3><ul><li>มี AWS Account</li><li>เข้าใจเรื่องของ AWS IAM เบื้องต้น (ถ้ายังงงกลับไปอ่าน<a href="https://medium.com/@siwawong.wut/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%88%E0%B8%B1%E0%B8%94%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B9%83%E0%B8%8A%E0%B9%89%E0%B8%9A%E0%B8%99-aws-platform-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-aws-iam-660892c8624f">บทความที่แล้ว</a>นะ)</li><li>สร้าง S3 Bucket แบบ <strong>Private</strong> รอไว้แล้ว (ถ้าสร้างไม่เป็นลองอ่าน<a href="https://medium.com/@siwawong.wut/%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87-web-site-%E0%B8%9A%E0%B8%99-aws-aab9c5ec1476">บทความเก่าๆ</a> ได้นะ)</li></ul><h3><strong>เริ่มจาก</strong></h3><ol><li>ไปที่แท็ป <strong>Services</strong> บนหน้า <strong>AWS Management console</strong> และเลือ <strong>IAM</strong> จากนั้นทำการเลือก “<strong>Users</strong>” และกดปุ่ม “<strong>Add user</strong>”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e2JKdr-JQHM9cIqW.png" /><figcaption>หน้าจอ IAM บน AWS Management Console</figcaption></figure><p>2. ทำการเพิ่มผู้ใช้ โดยระบุชื่อผู้ใช้ (ในที่นี้ ระบุเป็น <strong>John</strong>) และเลือกการเข้าถึง (Access Type) เป็น “<strong>Programmatic” </strong>access</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DNc0DTyhXUfohEM7.png" /><figcaption>ระบุข้อมูลผู้ใช้ (User)</figcaption></figure><p>หลังจากนั้นกดปุ่ม “<strong>Next: Permissions</strong>” เพื่อดำเนินการต่อไป</p><p>3. เลือก “<strong>Attach Existing Policies directly</strong>” ในที่นี้ เราจะให้ “<strong>John</strong>” มีสิทธิ์แค่สามารถอ่านไฟล์ใน S3 Bucket ได้ แต่ไม่สามารถแก้ไขไฟล์ได้ จึงเลือก Policy ตามรูปด้านล่าง</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AsxwHrJ-WnWUigyICmdgAA.png" /><figcaption>ระบุสิทธิ์การใช้งานของผู้ใช้ (Users)</figcaption></figure><p><strong>หมายเหตุ</strong> การใช้สิทธิ์แบบนี้ไม่ค่อยดีนะครับ (ดูจาก <strong>Best Practise</strong> ในบทความก่อนหน้าได้) แต่เนื่องจาก ผมต้องการแสดงให้วิธีการใช้แบบรวดเร็วจึงขออนุญาตข้ามในสิ่งที่ <strong>Best Practise</strong> บอกให้ทำก่อนนะครับ</p><p>4. จากนั้นกดปุ่ม “<strong>Next: review</strong>” เพื่อตรวจสอบความถูกต้องก่อนจะบันทึก จากนั้น กดปุ่ม “<strong>Download .csv</strong>” เพื่อทำการดาวน์โหลด <strong>access key</strong> และ <strong>secret key</strong> เก็บไว้ก่อนจะทำการกดปุ่ม “Close” เพื่อจบการทำงาน</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SUaqeTFLq2EUo_fT.jpeg" /><figcaption>ขั้นตอนสุดท้าย ก่อนจะจบการทำงาน</figcaption></figure><p>อ่านถึงตรงนี้ ขอบอกก่อนว่า <strong>access key</strong> และ <strong>secret key </strong>นี่สำคัญมาก<strong> ห้ามทำหายเด็ดขาด </strong>(จริงๆ ทำหายได้นะ แต่เสียเวลา reset ตัว secret key มากกว่า)</p><h3>การใช้งาน</h3><p>พอเราได้ข้อมูล <strong>access key</strong> และ <strong>secret key </strong>มาแล้ว การใช้งานนั้น เราสามารถนำไปใช้ในการเขียนโปรแกรมที่เกี่ยวกับ services ต่างๆ ของ AWS หรือจะใช้แบบ <strong>CLI</strong> (Command Line Interface) ก็ได้ ซึ่ง CLI ของ AWS สามารถใช้งานได้ทั้งบน Windows, Mac OS หรือว่า Linux</p><p><strong>แต่ในที่นี่</strong> จะขอยกตัวอย่างการใช้งานผ่าน CLI เป็นหลัก และทำงานผ่าน Linux (บน EC2 instance)</p><p><strong>ขั้นที่ 1</strong> ติดตั้ง AWS CLI ลงบน EC2 instance ที่ต้องการ</p><pre>$ sudo apt udpate<br>$ sudo apt install awscli</pre><p>หลังจากลงโปรแกรมแล้ว สามารถตรวจสอบ version ได้โดยใช้คำสั่ง</p><pre>$ aws --version</pre><p>ตัวอย่างที่เครื่องผมจะได้</p><pre>aws-cli/1.14.44 Python/3.6.9 Linux/4.15.0–1044-aws botocore/1.8.48</pre><p><strong>ขั้นที่ 2</strong> ทำการ configure AWS โดยระบุ AWS Access Key ID และ AWS Secret Access ลงไป โดยใช้คำสั่ง</p><pre>$ aws configure</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*139ljvIN92IJ604Y.jpeg" /></figure><p>หลังจากนั้น ลองพิมพ์</p><pre>$ aws s3 ls</pre><p>เพื่อดูรายชื่อ S3 Bucket ทั้งหมดที่มีอยู่ออกมา</p><p><strong>หมายเหตุ</strong> ตัว aws cli นั้นมีคำสั่งมากมายเหลือเกิน จากตัวอย่างเป็นการ list (ls) รายการ S3 Bucket ออกมา</p><p><strong>อ้างอิง</strong></p><ul><li><a href="https://medium.com/@prawit/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%83%E0%B8%8A%E0%B9%89-aws-cli-command-line-interface-43198755dc43">https://medium.com/@prawit/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%83%E0%B8%8A%E0%B9%89-aws-cli-command-line-interface-43198755dc43</a></li><li><a href="https://medium.com/@yogeshdarji99/run-as-iam-user-on-cli-programmatically-try-to-modify-s3-buckets-on-aws-3ba4424f0e5c">https://medium.com/@yogeshdarji99/run-as-iam-user-on-cli-programmatically-try-to-modify-s3-buckets-on-aws-3ba4424f0e5c</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b62ad42a312b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[การจัดการผู้ใช้บน AWS Platform ด้วย AWS IAM]]></title>
            <link>https://medium.com/@siwawong.wut/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%88%E0%B8%B1%E0%B8%94%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B9%83%E0%B8%8A%E0%B9%89%E0%B8%9A%E0%B8%99-aws-platform-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-aws-iam-660892c8624f?source=rss-90bbcaa5e9da------2</link>
            <guid isPermaLink="false">https://medium.com/p/660892c8624f</guid>
            <category><![CDATA[aws-iam]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Siwawong Wuttipongprasert]]></dc:creator>
            <pubDate>Sun, 03 May 2020 04:01:00 GMT</pubDate>
            <atom:updated>2020-05-03T04:01:00.843Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DEEjZxSfa6_CbkEqT2LidA.png" /></figure><p>AWS Platform จริงๆ มันก็เหมือน application ขนาดใหญ่อื่นๆ นั้นคือการอนุญาตให้มีการเข้าใช้งานพร้อมๆ กัน (Multi-users) ได้ โดยใน AWS Platform จะมีบริการ (services) ที่ใช้ในการบริหารจัดการผู้ใช้ ให้เข้าถึงบริการต่างๆ ในระบบ AWS ที่เรียกว่า “<strong>AWS Identitiy and Access Management</strong>” หรือเรียกสั้นๆ ว่า <strong>IAM</strong></p><p>เราสามารถเข้าถึงบริการ IAM ได้ โดยเลือกบริการ <strong>IAM</strong> จาก <strong>AWS Management Console</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JZey0tbjSjBZHxndHumwuQ.png" /><figcaption>AWS IAM Console</figcaption></figure><p>และเราจะเข้าบริการ/หน้าจอนี้ได้ก็ต่อเมื่อ</p><ul><li>เป็น root account (คือผู้ที่สร้าง AWS account นั้นๆ)</li><li>ได้รับสิทธิ์ให้เข้าถึง</li></ul><h3>โครงสร้างของ IAM</h3><p>จริงๆ มันก็ไม่ได้แปลกโครงสร้างความปลอดภัยของระบบใหญ่ๆ หรือแอพพลิเคชั่นทั่วๆ ไป อันประกอบไปด้วย</p><h3>Users</h3><p>หรือ “<strong>ผู้ใช้</strong>” นั้นเอง (เชื่อว่าทุกคนน่าจะคุ้นเคย) ซึ่งผู้ใช้งานนั้นสามารถเข้าถึงบริการต่างๆ ของ AWS ซึ่ง ใน AWS IAM ซึ่งสามารถเข้าถึงบริการต่างๆ ของ AWS ได้ <strong>2 ช่องทาง</strong> คือ</p><ul><li><strong>AWS Management Console </strong>คือ ให้ผู้ใช้ล็อคอินผ่าน Web browser เพื่อใช้งาน (ก็เหมือน application อื่นๆ นั้นแหละ)</li><li><strong>Programmatic </strong>คือ<strong> </strong>ให้ผู้ใช้ทำงานผ่าน<strong> </strong>AWS API หรือ command line เพื่อใช้บริการต่างๆ บน AWS Platform ซึ่งผู้ใช้ลักษณะนี้เหมาะสำหรับการเขียนโปรแกรม</li></ul><h3>Groups</h3><p>คือ การจัดกลุ่มผู้ใช้ ที่มีสิทธิ์การเข้าถึงบริการต่างๆ ของ AWS ที่คล้ายๆ กัน เพื่อง่ายต่อการจัดการสิทธิ์</p><h3>Roles</h3><p>คือ สิทธิ์ (Permission) ที่เข้าถึงแต่ละบริการของ AWS เช่น ให้สามารถอ่านไฟล์ใน S3 bucket ได้อย่างเดียว หรือจะให้สิทธิ์การอ่านเขียนใน S3 bucket เป็นต้น</p><h3>Policies</h3><p>คือการอธิบายการกระทำต่างๆ ของบริการต่างๆ ของ AWS Platform เช่น Read-Only (อ่านได้อย่างเดียว) หรือ Full Access (เข้าถึงได้เต็มที่) ซึ่ง Policy สามารถระบุให้กับ Users, Groups หรือ Roles</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7RFKWns8UKc_B_ZcRKxJ-w.png" /><figcaption>ความสัมพันธ์ของ Policy ที่ใช้งาน Role, Group และ Users</figcaption></figure><p>ซึ่ง Policy สามารถแบ่งออกเป็น</p><ol><li>Service Control Policies</li><li>Identity-Based Policies</li><li>Resource-Based Policies</li></ol><p>สำหรับเรื่อง Policy คงไม่ขอลงลึกไปอีกนะครับ เพราะมันยาวมากกกก…….</p><p>ถ้าอ่านถึงตรงนี้แล้วงงๆ ว่า User, Group และ Role มันสัมพันธ์กันอย่างไร? ลองดูแผนผังประกอบดีกว่า</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*SEr3GFMB_pbZeo7PIUw3xg.png" /><figcaption><strong>ผู้ใช้ </strong>(User) ทุกคนที่อยู่ภายใน<strong>กลุ่ม</strong> (Group) เดียวกัน จะมี<strong>สิทธิ์</strong> (Permission) ในการเข้าถึงบริการของ AWS ตามที่ระบุ role เอาไว้</figcaption></figure><p>ถ้ามองในมุมของ “<strong>ผู้ใช้</strong>” (User) แล้ว Role และ Policies จะมีสัมพันธ์ตามรูปด้านล่าง</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*6Ca9u4mSElQr6N0BnkC2Zg.png" /><figcaption>ความสัมพันธ์ของผู้ใช้ (User) และ Role กับ Policy</figcaption></figure><h3>IAM Best Practices</h3><p>หัวข้อสุดท้ายก่อนจบ…..นั้นคือ Best Practices หรือแนวทางที่ควรนำไปปฏิบัติ ในการใช้ <strong>AWS IAM</strong> เพื่อให้ Platform ที่เราใช้นั้นมีความปลอดภัย เช่น</p><ul><li>สร้าง “<strong>ชื่อผู้ใช้</strong>” (user name) ตามจำนวนที่ใช้งานจริง — ไม่แชร์ user name ระหว่างผู้ใช้งาน</li><li>ใช้ “<strong>กลุ่ม</strong>” (Group) ในการให้สิทธิ์การเข้าถึงของแต่ละ<strong>ผู้ใช้</strong> (User) — อย่าให้สิทธิ์พิเศษกับ user ใด user หนึ่ง (เพราะมันจะดูแลยาก)</li><li>ให้ “<strong>สิทธิ์</strong>” ที่น้อยที่สุด เท่าที่จำเป็นแต่ละกลุ่มผู้ใช้</li><li>พยายามให้สิทธิ์ที่มีอยู่ใน <strong>AWS Managed Policies</strong> — อย่าสร้าง Policies ใหม่ๆ โดยไม่จำเป็น</li><li>ใช้ <strong>Customer Managed Policies</strong> แทนที่จะใช้ <strong>Inline Policies</strong></li><li>Use Access Levels to Review IAM Permissions</li><li>กำหนด <strong>Password Policy</strong> ให้เข้มแข็งในการตั้ง password ของผู้ใช้ในระบบ เช่น ยาวไม่ต่ำกว่า 8ตัวอักษร, ต้องมีอักขระพิเศษปนอยู่ด้วยอย่างน้อย 1ตัวอักษร เป็นต้น</li><li>เปิดใช้งาน MFA หรือ Multi-Factor Authentication เช่นมีการส่ง SMS เพื่อรับ OTP ในการ login เข้าระบบ</li><li>ติดตามการเข้าใช้งานบน AWS Platform บ่อยๆ เพื่อดูว่ามีผู้แปลกปลอมเข้ามาใช้บ้างหรือไม่?</li><li>ฯลฯ</li></ul><p>ในบทความนี้ เป็นการอธิบาย AWS IAM เบื้องต้นเท่านั้น ถ้าใครต้องการทราบรายละเอียดที่ลึกซึ้งกว่านี้ สามารถอ่านเพิ่มเติมตามลิ้งค์ด้านล่างได้</p><ul><li><a href="https://medium.com/everythingatonce/aws-iam-its-features-day-1-5c5bb6a075c6">https://medium.com/everythingatonce/aws-iam-its-features-day-1-5c5bb6a075c6</a></li><li><a href="https://medium.com/@manojf/aws-iam-summary-5d97bb129ae1">https://medium.com/@manojf/aws-iam-summary-5d97bb129ae1</a></li><li><a href="https://medium.com/@pmuens/aws-fundamentals-what-is-iam-b57f2fb88f66">https://medium.com/@pmuens/aws-fundamentals-what-is-iam-b57f2fb88f66</a></li><li><a href="https://medium.com/@kangzeroo/aws-security-from-day-1-with-iam-31bcf8e1ad63">https://medium.com/@kangzeroo/aws-security-from-day-1-with-iam-31bcf8e1ad63</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=660892c8624f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[การติดตั้ง Node.js version 12.x บน Ubuntu EC2]]></title>
            <link>https://medium.com/@siwawong.wut/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%95%E0%B8%B4%E0%B8%94%E0%B8%95%E0%B8%B1%E0%B9%89%E0%B8%87-node-js-version-12-x-%E0%B8%9A%E0%B8%99-ubuntu-ec2-f8d7cd574dea?source=rss-90bbcaa5e9da------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8d7cd574dea</guid>
            <category><![CDATA[node-js-tutorial]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Siwawong Wuttipongprasert]]></dc:creator>
            <pubDate>Sat, 02 May 2020 08:48:04 GMT</pubDate>
            <atom:updated>2020-05-02T08:48:04.595Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*1O5ZCS1pblon0T3fLSEvcw.png" /><figcaption>ภาพจาก <a href="https://nodejs.org/en/about/releases/">https://nodejs.org/en/about/releases/</a></figcaption></figure><p><a href="https://nodejs.org/en/">Node.js</a> ภาษายอดนิยมในการพัฒนา Back-end application ภาษาหนึ่งในบ้านเรา เพราะเรียนรู้ได้ง่าย (เพราะใช้พื้นฐานของ Javascript) และใช้งานได้หลาย Platform ไม่ว่าจะเป็น MS(R) Windows, Linux หรือ Mac OS.</p><p>วันนี้ ผมจึงขอยกตัวอย่างการ install Node.js บน Ubuntu (EC2 instance) บน AWS Platform ซึ่ง Node.js ที่ใช้นี้ เราจะใช้ <strong>Version 12.x</strong> นะครับ</p><p>ถ้าถามว่า ทำไมเลือกใช้ version นี้? ทำไมไม่เลือก version อื่นๆ เช่น 10.x หรือ 13.x? <strong>คำตอบสั้นๆ</strong> ก็คือ Version 12.x นี้เป็น <strong>LTS</strong> (Long Term Support) version ซึ่งมั่นใจว่าเลือกใช้งานแล้ว มีคน support ให้อีกนาน (ประกาศล่าสุดคือ จะหยุด support ใน<strong>วันที่ 2022–04–30</strong>)</p><p>เกริ่นมาเยอะแล้ว….<strong>เริ่มกันเลยดีกว่า!</strong></p><h3>Pre-requisition</h3><ul><li>มี AWS account แล้ว</li><li>เข้าใจ Node.js เบื้องต้น หรือพอจะเขียนโปรแกรมง่ายๆ บน Node.js ได้</li><li>สร้าง EC2 instance เป็น ในที่นี้แนะนำให้ใช้ Ubuntu Server 18.04 LTS และเลือก instance type เป็น t2.micro</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MO6GovVtHbG2JNwENiUlDA.png" /></figure><h3>ขั้นตอนการ install</h3><p><strong>ขั้นที่ 1</strong> Login เข้า EC2 instance ผ่าน terminal (MacOS หรือ Linux)หรือ putty (Windows) แล้วทำการ update system ก่อน โดยใช้ command ด้านล่าง</p><pre>$ sudo apt update<br>$ sudo apt -y upgrade</pre><p><strong>ขั้นที่ 2 </strong>เพิ่ม <strong>Node.js APT repository</strong> เพื่อเตรียมดาวน์โหลด <strong>Node.js</strong> version 12.x มาที่เครื่องของเรา</p><pre>$ sudo apt update<br>$ sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates<br>$ curl -sL <a href="https://deb.nodesource.com/setup_12.x">https://deb.nodesource.com/setup_12.x</a> | sudo -E bash -</pre><p><strong>ขั้นที่ 3 </strong>ติดตั้ง <strong>Node.js</strong> version 12.x มาที่เครื่องของเรา</p><pre>$ sudo apt -y install nodejs</pre><p>และหากต้องการติดตั้ง addon สำหรับ compile โมดูลเพิ่มเติมสำหรับ Node.js (เช่น bcrypt) ก็ให้เพิ่ม library ตามด้านล่าง</p><pre>$ sudo apt -y  install gcc g++ make</pre><p><strong>ขั้นที่ 4 </strong>ตรวจสอบการติดตั้ง <strong>Node.js </strong>ที่เครื่องของเรา โดยพิมพ์ command ตามด้านล่าง</p><pre>$ node --version<br>v12.10.0<br><br>$ npm --version<br>6.10.3</pre><p>อ้างอิงจาก <a href="https://computingforgeeks.com/how-to-install-nodejs-on-ubuntu-debian-linux-mint/">https://computingforgeeks.com/how-to-install-nodejs-on-ubuntu-debian-linux-mint/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8d7cd574dea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[สร้าง Secure web site บน AWS]]></title>
            <link>https://medium.com/@siwawong.wut/%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87-secure-web-site-%E0%B8%9A%E0%B8%99-aws-4b347cea3068?source=rss-90bbcaa5e9da------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b347cea3068</guid>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws-cloudfront]]></category>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Siwawong Wuttipongprasert]]></dc:creator>
            <pubDate>Tue, 31 Mar 2020 13:29:47 GMT</pubDate>
            <atom:updated>2020-03-31T13:29:47.535Z</atom:updated>
            <content:encoded><![CDATA[<p>ความเดิมต่อจากตอนที่แล้ว : <a href="https://medium.com/@siwawong.wut/%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87-web-site-%E0%B8%9A%E0%B8%99-aws-aab9c5ec1476">สร้าง web site บน AWS</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sodB0fgY7Vz5UtIiKLgRhQ.jpeg" /></figure><p>หลังจาก ที่เราสามารถสร้าง web site หรือเวปแอพฯ​ บน AWS ได้แล้ว แต่สิ่งที่ได้มันยังไม่ดีพอ เพราะเวปไซด์ / เวปแอพฯ​ ที่เราทำนี้</p><ul><li>ยังรับโหลดได้ไม่เยอะมาก</li><li>ไม่ปลอดภัย (คือยังไม่มี HTTPs นั้นเอง)</li></ul><p>วันนี้ เราจะมาแก้ไขปัญหาทั้งสองจุดนี้กัน โดยพระเอกของเราที่จะมาแก้ไขปัญหานี้ คือ <strong>AWS CloundFront</strong> นั้นเอง</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*l9BV-gJzPc7hnL9HdrmPwQ.jpeg" /></figure><p>หลักการของ <strong>AWS CloundFront</strong> ก็คือ การทำการกระจายโหลดให้กับ static files เช่น ไฟล์รูปภาพ,​ ไฟล์ VDO, ไฟล์เสียง หรือตัว HTML ที่ไม่ค่อยเปลี่ยนแปลง ให้สามารถเข้าถึง (Access) จากที่ต่างๆ (หรือที่ว่า <strong>CDN</strong> — Contents Distributed Network)</p><h3>เริ่มเลยดีกว่า</h3><p>(1) ไปที่หน้าจอของ AWS Cloudfront แล้วกดปุ่ม “<strong>Create Distribution</strong>” แล้วเลือก Delivery Method เป็น “<strong>Web</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jn0mJdtKIdvCWDBorRCnog.png" /></figure><p>(2) ระบุ “<strong>Original Domain Name</strong>” เป็น S3 Bucket ที่เก็บข้อมูล static files เอาไว้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-21ANhKJ239YgKx18tbp6A.png" /></figure><p>(3) หลังจากนั้น ระบุ “<strong>Viewer Protocol Policy</strong>” โดยสามารถเลือกได้ดังนี้</p><ul><li>HTTP and HTTPS : กรณีที่เวปไซด์ / เวปแอพฯ​ เรา<strong>ไม่มี SSL รองรับ</strong>ให้เลือกข้อนี้</li><li>Redirect HTTP to HTTPS: กรณีที่เวปไซด์ / เวปแอพฯ​ เรา<strong>มี SSL รองรับ</strong>ให้เลือกข้อนี้ (ซึ่งใน tutorial นี้<strong>แนะนำ</strong>ให้ใช้แบบนี้นะครับ)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*od65H9jmguoHzNgrO-WmEw.png" /></figure><p>(4) กำหนดอายุของ object ใน cache ของ Cloundfront (<strong>TTL</strong> — Time To Live: หน่วยเป็น<strong>วินาที</strong>) เนื่องด้วย default จาก AWS มาค่อยข้างโหด ก็สามารถปรับตามชอบใจได้เลยนะครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_zHym2YkRFbT8QBryUX7bA.png" /></figure><p>(5) ถึงจุดไฮไลท์ของ tutorial นี้แล้วนะครับ 👋🏽 👋🏽 👋🏽 นั้นคือการระบุ Domain Name ที่ต้องการ และการใส่ SSL ลงไป แต่ถ้าใครไม่ต้องการระบุ Domain Name ก็ข้ามได้นะครับ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TJyX9qdSFW9_LaUkl1SpCw.png" /></figure><p>(A) Alternative Domain Names (CNAMEs) ระบุ domain name ที่ต้องการลงไป และสามารถระบุได้มากกว่า 1 ชื่อ (คั้นด้วย ENTER) เช่น</p><blockquote>examples.aws-tutorial.com</blockquote><blockquote>demo.aws-tutorial.com</blockquote><p>ไม่ว่าจะเรียก domain name ไหน ก็จะถูกส่งมาที่ S3 bucket ที่กำหนดไว้</p><p>(B) ระบุให้เป็น “<strong>Custom SSL Certificate</strong>” (ถ้ามีการตั้งชื่อ Alternative Domain Name ไว้)</p><p>( C) ระบุ “SSL Certificate” ที่สร้างจาก <strong>ACM</strong> (อันนี้….ฟรี!!!) — อ่านได้จาก<a href="https://medium.com/@siwawong.wut/ssl-certificate-%E0%B8%9F%E0%B8%A3%E0%B8%B5-%E0%B8%AA%E0%B8%B3%E0%B8%AB%E0%B8%A3%E0%B8%B1%E0%B8%9A%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B9%83%E0%B8%8A%E0%B9%89-aws-platform-f52ea84470f7">ที่นี่</a></p><p>(6) ระบุไฟล์หลักในการเรียก เช่น index.html และก็สร้าง CDN ได้เลย!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0W0DKztRL0jhvJuZO3X0jg.png" /></figure><p>หลังจากนั้น รอประมาณ 15–30 นาที ตัว CDN ที่เราสร้างจะเริ่มทำงานโดยสามารถเรียกเวปไซด์มาทดสอบได้ผ่าน</p><ul><li>Alternative Domain Names</li><li>Domain Name (ขอตัว Cloudfront เอง)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OUi24-s_gaEF110yEfG9gA.png" /></figure><p><strong>จบ!!</strong></p><p>แถมอีกนิด สำหรับคนที่ระบุ <strong>Alternative Domain Names</strong> ให้กับ Cloundfront ต้องไประบุ “<strong>A record</strong>” ใน DNS setup ด้วย โดยระบุเป็นชื่อ Domain Name ของ Cloundfront</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b347cea3068" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[สร้าง web site บน AWS]]></title>
            <link>https://medium.com/@siwawong.wut/%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87-web-site-%E0%B8%9A%E0%B8%99-aws-aab9c5ec1476?source=rss-90bbcaa5e9da------2</link>
            <guid isPermaLink="false">https://medium.com/p/aab9c5ec1476</guid>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[Siwawong Wuttipongprasert]]></dc:creator>
            <pubDate>Sat, 28 Mar 2020 14:21:37 GMT</pubDate>
            <atom:updated>2020-04-01T02:44:44.233Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*g-CQhDLOTgmLDIp7BSGsyQ.jpeg" /></figure><p>การสร้าง<strong>เวปไซด์</strong> (Web site) แบบ static page (คือมีหน้าเดียว เนื้อหาไม่เปลี่ยนแปลง) หรือจะเป็น<strong>เวปแอพฯ</strong>​ (Web Application) บนอินเตอร์เน็ทนั้นค ไม่เรื่องยากสำหรับสมัยนี้ แต่การสร้างเวปไซด์ หรือเวปแอพฯ <strong>ที่ดีๆ</strong> นั้นก็คงยังเป็นปัญหาโลกแตกต่อไป ซึ่งปัญหาส่วนใหญ่ที่ผมได้ยินเค้าบ่นๆ กัน เช่น</p><ul><li>เวปไซด์/เวปแอพฯ​ ทำงานได้ช้ามาก</li><li>ค่าเช่า server เพื่อทำเวปไซด์/เวปแอพฯ ต่อเดือนแพงมาก</li><li>Server ที่ใช้ไม่ปลอดภัย</li><li>Server ที่ใช้ไม่รองรับ HTTPs</li><li>ฯลฯ</li></ul><p>ปัญหาเหล่านี้ บางส่วนมาจากการพัฒนา และบางส่วนมาจากโครงสร้าง (Infrastructure) ซึ่งในวันนี้ผมจะขอนำเสนอ solution เพื่อปัญหาข้างต้นใน<strong>ส่วนของ Infrastructure</strong> ด้วย <strong>AWS S3</strong> และ <strong>AWS CloundFront</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fo52wgR_qDvgXqnk8w9fJg.png" /><figcaption>การทำงานของ Amazon CloundFront และ Amazon S3</figcaption></figure><p><strong>หลักการทำงาน</strong></p><ul><li><strong>AWS S3:</strong> ทำหน้าที่เป็นที่เก็บข้อมูล (storage) ซึ่งในที่นี้จะใช้เก็บตัวเวปไซด์/เวปแอพฯ</li><li><strong>AWS CloudFront: </strong>ทำหน้าที่เป็น Content Distribution Network (ย่อๆ ว่า <strong>CDN</strong>) หรือกระจายข้อมูลออกไปเพื่อลดภาระ (load)ให้กับ server (ในที่นี่คือตัว S3)</li></ul><p>จริงๆ แล้วพระเอกของเราในงานนี้ คือ <strong>AWS CloudFront </strong>เลยนะ เพราะไม่ใช่แค่หน้าที่ลดโหลดให้กับ server เท่านั้น แต่ยัง</p><ul><li>กำหนด (Point) ชื่อ <strong>Domain Name</strong> มาให้กับเวปไซด์/เวปแอพฯ​ ได้</li><li>รองรับ <a href="https://medium.com/@siwawong.wut/ssl-certificate-%E0%B8%9F%E0%B8%A3%E0%B8%B5-%E0%B8%AA%E0%B8%B3%E0%B8%AB%E0%B8%A3%E0%B8%B1%E0%B8%9A%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B9%83%E0%B8%8A%E0%B9%89-aws-platform-f52ea84470f7">SSL จาก ACM</a> เพื่อให้เวปไซด์/เวปแอพฯ​ ได้ ใช้งาน <strong>HTTPs</strong> ได้</li></ul><p><strong>สิ่งที่ต้องมี</strong></p><ul><li><strong>AWS account:</strong> สมัครได้ก่อนที่ <a href="https://aws.amazon.com/">https://aws.amazon.com/</a></li><li>ตัวเวปไซด์ / เวปแอพฯ ที่เป็น static page หรือ<a href="https://medium.com/@siwawong.wut/spa-%E0%B8%AA%E0%B8%9B%E0%B8%B2-single-page-application-98c576fe78e7">เป็น SPA</a></li></ul><h3>เริ่ม!</h3><p><strong>(1) สร้าง S3 Bucket ขึ้นมา</strong> เพื่อเก็บตัวเวปไซด์/เวปแอพฯ​ ของเรา​ โดยเริ่มจากไปที่หน้า <strong>S3 console</strong> และเลือก <strong>Create Bucket</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rrfwZAY3sb7jZAo66CVRBw.png" /></figure><p><strong>(2) ใส่ข้อมูลของ Bucket ใหม่</strong> เช่น ชื่อของ Bucket​ และ เขตที่ใช้งาน (Region) ซึ่งขอแนะนำให้เลือกเขตเดียวกับกลุ่มผู้ใช้ เพื่อลดค่าโอนย้าย (Transfer) ที่ทาง AWS จะมาเก็บเงินกับเรา ก่อนจะกด<strong>ปุ่ม Next</strong> เพื่อทำงานต่อ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oi5UxqlZb2tVk6bJnsPJgg.png" /></figure><p>หน้าต่อมาให้ระบุคุณสมบัติเพิ่มเติม ขอข้ามไปเลย (เพราะไม่ต้องใช้) โดย<strong>การกด Next</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BknKqkuKemI5JrMdyhdfGA.png" /></figure><p>(3) จากนั้นทำการเลือก <strong>“Block <em>all</em> public access”</strong> ออก เพราะตัวเวปไซด์/เวปแอพฯ เรานั้นต้องการให้เข้าถึงจากอินเตอร์เน็ทได้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1gTmr9bB-9trjL-7Ti6L9w.png" /></figure><p><strong>หมายเหตุขำๆ </strong>ขั้นตอนนี้เพิ่งเพิ่มมาในปี 2018 ซึ่งเป็น features ใหม่<a href="https://www.blognone.com/node/101502">ที่ร้องขอ</a>โดยคนไทย!</p><p>จบหล่ะ สำหรับการสร้างตัว Bucket ใหม่เพื่อเก็บตัวเวปไซด์/เวปแอพฯ ของเรา ต่อไปเป็นการกำหนดค่า (Configure) ให้ตัว Bucket ใหม่นี้ ทำงานเป็น <strong>Web server</strong></p><p>เร่ิมจาก….</p><p>(1) ทำการ upload ตัวเวปไซด์/เวปแอพฯ เข้าไปยัง Bucket ที่สร้างใหม่นี้</p><p>(2) เปิดตัว Bucket ใหม่ และเลือกแทป <strong>“Properties” </strong>และมองว่า<strong> “Static website hosting”</strong> เพื่อจะกดเข้าไป Config ตัว Web server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4kXlYn9iLszsTQM78rJE5w.png" /></figure><p>(3) ในหน้าจอ “<strong>Static website hosting</strong>” เราจะพบกับ</p><ul><li><strong>Endpoint: </strong>คือชื่อเวปไซด์ที่เราจะให้คนอื่นๆ เรียกดูได้จากอินเตอร์เน็ท</li><li>เลือก “<strong>Use this bucket to host a website</strong>” และระบุ “<strong>Index document</strong>” เป็นชื่อไฟล์ที่ต้องการให้เรียกทำงานเป็นตัวแรก (และอยู่ใน S3 Bucket)</li><li>ส่วน “<strong>Error document</strong>” ให้ระบุเป็นไฟล์ที่มี S3 bucket เพื่อแสดง error message ซึ่งไม่ต้องระบุก็ได้</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P1pCt31_ZNwaZHwJJVdgRA.png" /></figure><p>จากนั้นกด “<strong>Save</strong>” เพื่อบันทึกค่าที่ตั้งไว้</p><p>ถ้าลองเรียกตัวเวปไซด์ตาม “<strong>Endpoint</strong>” ที่แสดงข้างต้นจะได้ไหม? คำตอบคือ “<strong>ยังไม่ได้</strong>”​ เพราะเราต้องกำหนด permission เพิ่มเติมดังรูปด้านล่าง</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BUookXjXbYyky4Bbr2Iz6Q.png" /><figcaption>หน้าจอ Permission ของตัว Bucket ที่ใช้เป็น Web server</figcaption></figure><p>โดยค่าที่ต้องใส่เพิ่มนี้ ทำได้โดยกดไปที่ “<strong>Bucket Policy</strong>” และลอกข้อมูลด้านล่างลงไป (และช่วยเปลี่ยน <strong>YOUR_BUCKET_NAME</strong> เป็นชื่อ S3 Bucket ที่ใช้งาน</p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Sid&quot;: &quot;Allow Public Access to All Objects&quot;,<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Principal&quot;: &quot;*&quot;,<br>            &quot;Action&quot;: &quot;s3:GetObject&quot;,<br>            &quot;Resource&quot;: &quot;arn:aws:s3:::<strong>YOUR_BUCKET_NAME</strong>/*&quot;<br>        }<br>    ]<br>}</pre><p>หลังจากกดปุ่ม “<strong>Save</strong>” ที่มุมขวาบน เพียงเท่านี้ ทุกคนก็สามารถเข้าถึงเวปไซด์นี้ (ทั้งๆ ที่ทำจาก S3 storage ธรรมดาๆ ได้) ผ่านชื่อ “Endpoint” ตามข้างต้น</p><p>ถ้าถามว่า ค่าใช้จ่ายของการตั้ง Server แบบนี้ เดือนหล่ะประมาณเท่าไหร่? เท่าที่อ่านจากหลายๆ ที่ และผมทดสอบเองพบว่า น้อยกว่า<strong>เดือนละ $1 </strong>สะอีก</p><p>งั้นเราจะตั้ง server แบบแพงๆ ต่อไปทำไมกัน!</p><p><strong>จบ!</strong></p><p>ปล. เรื่อง <strong>CloudFront</strong> ขอยกยอดไป<a href="https://medium.com/@siwawong.wut/%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87-secure-web-site-%E0%B8%9A%E0%B8%99-aws-4b347cea3068">ต่อตอนหน้า</a></p><p><strong>อ้างอิง</strong></p><ul><li><a href="https://medium.com/@sithum/host-your-static-website-in-aws-under-2-minutes-with-s3-a01237a83fda">https://medium.com/@sithum/host-your-static-website-in-aws-under-2-minutes-with-s3-a01237a83fda</a></li><li><a href="https://www.freecodecamp.org/news/simple-site-hosting-with-amazon-s3-and-https-5e78017f482a/">https://www.freecodecamp.org/news/simple-site-hosting-with-amazon-s3-and-https-5e78017f482a/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aab9c5ec1476" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SPA (สปา) : Single Page Application]]></title>
            <link>https://medium.com/@siwawong.wut/spa-%E0%B8%AA%E0%B8%9B%E0%B8%B2-single-page-application-98c576fe78e7?source=rss-90bbcaa5e9da------2</link>
            <guid isPermaLink="false">https://medium.com/p/98c576fe78e7</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[web-architecture]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Siwawong Wuttipongprasert]]></dc:creator>
            <pubDate>Sat, 28 Mar 2020 13:10:24 GMT</pubDate>
            <atom:updated>2020-03-28T13:10:24.570Z</atom:updated>
            <content:encoded><![CDATA[<h3>SPA (สปา) : Single Page Application</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*1MnGa9JOzlO-YPvJ80qgSA.png" /><figcaption>Landscape การพัฒนาเวปไซด์สมัยใหม่ (Modern Web development) จาก <a href="https://www.seguetech.com/what-is-a-single-page-application/">https://www.seguetech.com/what-is-a-single-page-application/</a></figcaption></figure><p><strong>SPA</strong> หรือ <strong>Single Page Application</strong> เป็นรูปแบบการพัฒนาเวปไซด์สมัยใหม่ ที่จะให้ทำผู้เข้าชมเวปใช้เวลา<strong>ไม่ถึง 2วินาที</strong>ในการโหลดหน้าเวป!!!</p><p>เหตุที่<strong>เวปไซด์</strong> (Web site) หรือ<strong>เวปแอพฯ </strong>(Web application) ที่พัฒนาแบบ <strong>SPA</strong> นั้นมีการโหลดข้อมูลเร็วกว่าการพัฒนาเวปแบบเดิมๆ (ต่อไปนี้จะขอเรียกว่า Multi Page Application หรือ <strong>MPA</strong>) เพราะ <strong>SPA</strong> ถูกออกแบบมาให้เรียกข้อมูลจาก server มาแสดง<strong>โดยไม่ต้อง</strong>โหลดหน้าเวปใหม่ทั้งหมด!!!</p><p>ลองดูแผนผังเปรียบเทียบด้านล่างเพื่อความชัดเจน</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*J7vk3i4y6PXN12skt53IqA.jpeg" /><figcaption>เทียบการทำงานแบบ MPA กับ SPA</figcaption></figure><p>จริงๆ แล้วเราสามารถพบเห็นเวปไซด์ / เวปแอพฯ ที่พัฒนาแบบ SPA อยู่รอบตัวเรา เช่น</p><ul><li>Gmail</li><li>Google Maps</li><li>Facebook</li><li>Twitter</li><li>GitHub</li><li>Google Drive</li></ul><p>การพัฒนาเวปไซด์ / เวปแอพฯ​ แบบ SPA นั้นส่วนใหญ่เราจะพึ่งพา <strong>Javascript Framework</strong> (JS Framework) เป็นหลัก (90% ที่เหลือใช้ HTML และ CSSเพิ่มเติม) เพราะว่าเวปไซด์/เวปแอพฯ แบบ SPA นั้นจะทำงาน<strong>บน Web browser เป็นหลัก!!</strong></p><p>สำหรับ JS Framework ที่ฮิตๆ ในการพัฒนา SPA กันได้แก่</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XKtXMeu-BrcDX1OafP1xZg.png" /><figcaption>JS framework สุดฮิตในปี 2020</figcaption></figure><ul><li>Angular</li><li>React</li><li>VueJS</li></ul><p>การพัฒนาเวปไซด์ / เวปแอพฯ​ แบบ SPA นั้นมีข้อดีเด่นๆ เช่น</p><ul><li><strong>User Experience:</strong> ใช้ทำตัวได้เหมือน Mobile application หรือ Desktop application ได้ เช่น รองรับการทำงานแบบ Offline, มี local Storage เพื่อเก็บข้อมูลในตัว Web browser เอง,​ etc.</li><li><strong>Performance:</strong> แน่นอนว่า การที่โหลดเฉพาะข้อมูลที่เปลี่ยนแปลงจาก Server ย่อยใช้ปริมาณเน็ทน้อยกว่าโหลดที่ละหน้าเวป แถมใช้งานในที่ bandwidth ต่ำๆ ได้อีก</li><li><strong>Easy to Development: </strong>เพราะสามารถแยกงานของ Frontend developer ออกจาก Backend developer (เช่น การเชื่อมต่อกับฐานข้อมูล หรือการคำนวนที่ซับซ้อนของข้อมูล) ออกจากกันอย่างเด็ดขาด ทำให้สามารถได้คล่องตัวกว่า</li></ul><p>แล้วข้อเสียหล่ะ?</p><ul><li><strong>Search Engine Optimization:</strong> ไม่รองรับ เพราะข้อมูลโหลดแบบ dynamic</li><li><strong>Security:</strong> อาศัยการทำงานบน Web browser เป็นหลัก ทำให้ต้องเผชิญกับการโจมตีจาก <strong>XSS</strong> (Cross-site script) ได้</li><li><strong>ไม่รองรับการทำงานแบบ POST:</strong> ทำการส่งข้อมูลไปยัง server อาจจะไม่ปลอดภัย</li></ul><p>ถ้าถามว่าเราควรพัฒนาไปแนวทาง SPA หรือ MPA ดี? คำตอบคงไม่ตายขึ้นกับว่าวัตถุประสงค์ของการพัฒนานั้น เราต้องการทำอะไร?</p><p>ถ้าต้องการใช้กับงานที่ข้อมูลไม่ต้องการความ secure มาก อาจจะใช้ SPA 100% เลยก็ได้ แต่ถ้างานนั้นๆ มีความต้องการความ secure ของข้อมูลมากๆ (เช่น เชื่อมต่อกับ Payment Gateway) อาจจะพัฒนาแบบ Hybrid โดยทำส่วนแสดงผล (View) ด้วย SPA และส่วนประมวลผลเป็น MPA อีกที (เช่นใน ASP.NET)</p><p><strong>ข้อมูลอ้างอิง</strong></p><p><a href="https://scand.com/company/blog/single-page-application-vs-multi-page-application/">What is Single Page Application - Benefits, Disadvantages, Examples | SCAND Blog</a></p><p><a href="https://medium.com/@ahmedyousefarnous/single-page-application-c14eff32ecc1">https://medium.com/@ahmedyousefarnous/single-page-application-c14eff32ecc1</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98c576fe78e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SSL Certificate ฟรี! สำหรับผู้ใช้ AWS Platform]]></title>
            <link>https://medium.com/@siwawong.wut/ssl-certificate-%E0%B8%9F%E0%B8%A3%E0%B8%B5-%E0%B8%AA%E0%B8%B3%E0%B8%AB%E0%B8%A3%E0%B8%B1%E0%B8%9A%E0%B8%9C%E0%B8%B9%E0%B9%89%E0%B9%83%E0%B8%8A%E0%B9%89-aws-platform-f52ea84470f7?source=rss-90bbcaa5e9da------2</link>
            <guid isPermaLink="false">https://medium.com/p/f52ea84470f7</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[route-53]]></category>
            <category><![CDATA[aws-certificate-manager]]></category>
            <dc:creator><![CDATA[Siwawong Wuttipongprasert]]></dc:creator>
            <pubDate>Sun, 15 Mar 2020 13:38:08 GMT</pubDate>
            <atom:updated>2020-03-15T13:38:08.947Z</atom:updated>
            <content:encoded><![CDATA[<p>โลกของ <strong>WWW</strong> (World-Wide-Web) หรือชาวบ้านอย่างเราๆ เรียกมันว่า “<strong>เวปไซด์</strong>” นั้น ถูกคิดค้นโดย <strong>“ทิม เบอร์เนอร์ส-ลี” </strong>นักวิจัย/นักวิทยาศาสตร์ของ CERN (<a href="https://home.cern/">European Center for Nuclear Research</a>) เมื่อปี 1991</p><p>และตั้งแต่นั้นมา WWW ก็ได้อาศัย protocol ที่ชื่อ “<strong>http</strong>” (หรือชื่อเต็มๆ ว่า <strong>H</strong>yper<strong>T</strong>ext <strong>T</strong>ransfer <strong>P</strong>rotocol) มาตลอดจวบจนปัจจุบัน แต่สิ่งหนึ่งที่เปลี่ยนไปคือ protocal “<strong>http</strong>” ที่เราใช้อยู่นี่ มันไม่ค่อยปลอดภัย เพราะข้อมูลที่ส่งกันไปมาบน protocal นี้ <strong>ไม่มี</strong>การเข้าระหัสอะไรเลย!! ทำให้ผู้ไม่หวังดีสามารถดักฟังข้อมูลที่ส่งกันไปมาได้</p><p>ดังนั้น พี่ใหญ่แห่งโลกอินเตอร์เน็ทอย่างเช่น กูเกิ้ล ก็พยายามผลักดันให้ทุกเวปไซด์มีการใช้ protocol ที่มีการเข้าระหัสที่เรียก “<strong>https</strong>” (หรือชื่อเต็มๆ ว่า Hypertext Transfer Protocol Secure)ให้มากขี้น โดยเริ่มจาก <strong>Chrome เวอร์ชัน 68</strong> ซึ่งจะแสดงข้อความ <strong>“Not Secure”</strong> หรือ “<strong>ไม่ปลอดภัย” </strong>เป็นตัวอักษร<strong>สีเทา</strong> กับทุกเว็บไซต์ที่ยังใช้การเชื่อมต่อแบบไม่เข้ารหัส หรือ HTTP ดังรูป</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*fmX3l6oCJR0Bga2qnEcLBw.png" /></figure><p>แต่ถ้าเวปไซด์ไหนใช้ “<strong>https</strong>” แล้วจะแสดงผลดังรูป</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*1y1UeXVHQcX3LuZcsdcWPw.png" /></figure><p><strong>แล้วทำไมคนถึงไม่ใช้ “https” ในเวปไซด์</strong>ของตัวเองกันหล่ะ ซึ่งคำตอบก็คือ “<strong>มีค่าใช้จ่าย</strong>” จนบางครั้งถึง<strong>แพง</strong>เลยทีเดียว!โดยค่าใช้จ่ายที่ว่าคือการไปซื้อ <strong>SSL certificate </strong>โดยราคาเค้าจะคิดเป็นรายปี เหมือนกับโดเมนเนมนี่แหละ (ยังไม่นับวิธีการติดตั้งที่ยุ่งยากอีกนะ)</p><p><strong>แต่ช้าก่อน!</strong> ชาวเราผู้ใช้ AWS Platform เราสามารถมี <strong>SSL certificate </strong>ฟรี และปลอดภัยภายใต้ AWS Platform (เอาไปใช้นอก AWS Platform ไม่ได้นะ) ซึ่งพระเอกของเราในที่นี่คือ <strong>AWS Certificate Manager</strong> หรือ <strong>ACM</strong></p><p><strong>และนี่คือขั้นตอนการ</strong>ได้มาซึ่ง SSL จาก ACM</p><p>(1) คุณต้องมี Domain Name ก่อนนะ ซึ่งจะ register จากที่ไหนก็ได้ หรือจะใช้ Route53 ก็ง่ายดี</p><p>(2) ไปที่ <strong>Certificate Manager</strong> แล้วเลือก “<strong>Request a certificate</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b_yY_sVMQSbWHEE2XuZYgQ.png" /><figcaption>หน้าจอ console ของ Amazon Certificate Manager (ACM)</figcaption></figure><p>(3) เลือก “Request a public certificate” ตามรูปและกดปุ่ม “<strong>Request a certificate</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vC5n0rLLpKBWmGF4o4RlRg.png" /></figure><p>(4) ระบุ <strong>domain name</strong> ที่ต้องการ <strong>SSL certificate</strong> ลงไป โดยให้นำหน้าด้วย <strong>“*”</strong> (สำคัญ) เช่น เราต้องการ SSL ของ mywebsite.com ก็ระบุในช่องนี้เป็น “<strong>*.mywebsite.com</strong>” ลงไป พร้อมกับกดปุ่ม “<strong>Next</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N80RbK5hjeNg2Oh1vUkQrA.png" /></figure><p>(5) ระบุวิธีการ verify domain name เพื่อยืนยันความเป็นเจ้าของจริงๆ ซึ่งจะมีสองวิธี คือ</p><ul><li>DNS validation เหมาะสำหรับผู้ที่เข้าใจทางเทคนิค และสร้างเข้าไปหน้าจัดการ domain name ได้</li><li>Email validation เหมาะสำหรับผู้ที่ไม่เก่งเรื่องกำหนด domain name โดยตัว ACM จะส่ง email ไปยังเจ้าของ domain name เพื่อให้เจ้าของยืนยัน</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mA1CPx8F2l-ZBN78ST82wQ.png" /></figure><p>ในที่นี่ขอเลือกแบบ <strong>DNS validate </strong>และกดปุ่ม<strong> “Next”</strong></p><p>(4) ต่อไปติด “<strong>Tag</strong>” ขออนุญาต<strong>ข้ามไป</strong> และไปที่ขั้นตอนการ “<strong>Review</strong>” ซึ่งเราก็ทำหน้าที่ตรวจสอบอีกครั้ง ก่อนจะทำการกด “<strong>Confirm and Request</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_z0x9yhCWcpc3amGClvqnA.png" /></figure><p>(5) รอสักพักระบบจะแสดงหน้าจอสรุปการสร้าง SSL ให้เรา confirm อีกครั้ง</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TSj-ugHiSjHlHH-kMwjlNQ.png" /></figure><ul><li>สถานะการ Validate จะเป็น “Pending Validation”</li><li>สามารถ Validate โดยการ export ค่า DNS เพื่อไปกำหนดใน domain name serverได้</li></ul><p>ถ้าถามว่าไฟล์ที่ Export ออกมามีค่าอะไรบ้าง? ก็สามารถดูจากได้หน้าจอตรงๆ เลย (นำไปเพิ่มใน Domain Name Server ตรงๆ เลย)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t4FxyAJoA4URTcKfCfPZBQ.png" /></figure><p><strong>ข่าวดี</strong>สำหรับผู้ที่จด Domain Name ใน Route53 สามารถ Validate ตัว domain name ได้จากการกดปุ่ม “<strong>Create record in Route53</strong>” เลย</p><p>หลังจากกดปุ่ม “<strong>Continue</strong>” ด้านล่าง แล้วจะไปกลับไปที่หน้าจอ console ของ ACM อีกครั้ง และรอสักพักเพื่อรอ AWS platform ยืนยัน SSL certificate กับ DNS ที่เราต้องการ ซึ่งหลังจากที่ validate สำเร็จ สถานะจะเปลี่ยนเป็น “<strong>Issued</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bverjKTqQFqGFlSSXi09Fg.png" /></figure><h3>จบ!</h3><p><strong>อ้างอิง</strong></p><ul><li><a href="https://en.wikipedia.org/wiki/HTTPS">https://en.wikipedia.org/wiki/HTTPS</a></li><li><a href="https://standard.etda.or.th/?p=9745">https://standard.etda.or.th/?p=9745</a></li><li><a href="https://www.it24hrs.com/2013/internet-milestone-the-first/">https://www.it24hrs.com/2013/internet-milestone-the-first/</a></li><li><a href="https://blog.lawrencemcdaniel.com/get-free-ssl-certificate-aws/">https://blog.lawrencemcdaniel.com/get-free-ssl-certificate-aws/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f52ea84470f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>