AWS Systems Manager (SSM) คืออะไร? การแนะนำฟังก์ชันล่าสุดของ AWS

AWS Systems Manager คืออะไร ? คือเครื่องมือที่ใช้ในการจัดการ AWS และ on-premises เซิร์ฟเวอร์ ซึ่งเป็นการรวมของความสามารถและฟังก์ชั่นการทำงานต่างๆที่เกี่ยวข้องกับตัว resource มาจัดการและใช้งานซึ่งมีความสามารถดังนี้
2022.12.03

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

AWS Systems Manager คืออะไร ?

คือเครื่องมือที่ใช้ในการจัดการ AWS และ on-premises เซิร์ฟเวอร์ ซึ่งเป็นการรวมของความสามารถและฟังก์ชั่นการทำงานต่างๆที่เกี่ยวข้องกับตัว resource มาจัดการและใช้งานซึ่งมีความสามารถดังนี้

  • Shared resource
  • SSM Documents
  • Parameter Store
  • grouping
  • OpsCenter
  • Resource Groups
  • scheduling
  • Maintenance Windows
  • operation
  • Run Command
  • Automation
  • Distributor
  • Session manager
  • Aggregation and auditing of configuration information
  • State Manager
  • Inventory
  • Patch Manager

โดยปกติแล้วเป็นเรื่องยากที่จะทำความเข้าใจฟังก์ชันเหล่านี้ทั้งหมดที่อยู่ใน AWS Systems Manager ซึ่งในหลายๆฟังก์ชันนั้นส่วนใหญ่จะนำมาถูกใช้งานใน EC2 Instances แต่ไม่ใช่แค่นั้นเพราะก็ยังสามารถจัดการ on-premise resource ได้ด้วยเช่นกันผ่านการใช้งาน AWS Systems Manager

ประวัติของ AWS Systems Manager

ก่อนอื่นต้องบอกว่าเป็นเรื่องดีของ AWS Systems Manager ที่มีการอัพเดทเวอร์ชั่นอย่างสม่ำเสมอตลอดเวลาเพื่อให้ทันกับเทคโนโลยีในปัจจุบัน ทำให้อาจจะเป็นเรื่องยากที่จะติดตามให้ทันเวอร์ชั่นล่าสุด เคยมีเอกสารที่กล่าวถึงตัวย่อ SSM ก่อนหน้าที่เราจะรู้จักเกี่ยวกับ "AWS Systems Manager" โดยย่อมาจาก "Amazon Simple Systems Manager (SSM)" และ "Amazon EC2 Systems Manager (SSM)" ซึ่งมีตัวย่อสั้นๆว่า "SSM" แต่ผู้คนก็ยังคงเกิดความสงสัยและคำถามว่า
AWS Systems Manager คืออะไร ?
นี้คือสิ่งที่ผมเชื่อว่าเป็นข้อมูลที่เก่าแก่ที่สุดของประวัติ AWS Systems Manager ครับ

ภาษาญี่ปุ่น Do you know AWS's new service SSM?


ในช่วงต้น SSM อยู่ใน EC2 ที่เป็น Window เท่านั้นแต่ก็ได้มีการนำมาดัดแปลงเป็น domain ที่มีการเข้าถึงได้จาก AWS Directory Service โดยที่ระบบหลังบ้านยังคงเป็น Window ที่อยู่บน EC2 ซึ่งดูเหมือน SSM นั้นจะสามารถดำเนินการในรูปแบบงานต่างๆได้เป็นอย่างดี
และด้วยการตอบสนองจากความต้องการของลูกค้าหลายราย Amazon EC2 Systrms Manager (SSM) จึงถูกเปิดตัวครั้งแรกในงาน re:Invent ปี 2016

ภาษาญี่ปุ่น [Breaking News] Announcing Amazon EC2 Systems Manager #reinvent


จากส่วนที่เหลือหลังจาก AWS Systems Manager เปิดตัว SSM ก็ได้ปฏิบัติการในเซอร์วิส EC2 และนำมาใช้งานกับ AWS Management Console จนมาถึงปัจจุบันนี้ แต่ก็นำมาซึ่งความสับสนด้วยเช่นกันเพราะหลังจากนั้นได้มีการลบเซอร์วิส SSM ออกไปสำหรับการใช้งาน EC2 บน Window ดังนั้นเราควรเข้าใจว่า SSM เริ่มต้นคือ Sub-service ที่อยู่ใน EC2 และมีการพัฒนาอัพเดทอยู่อย่างต่อเนื่องควบคู่กับการเพิ่มประสิทธิภาพในการใช้งานให้มากขึ้นในระดับ Enterprise โดยเฉพาะ

Environment สำหรับระบบปฏิบัติการ

AWS Systems Manager ทำงานด้วย configuration ตามภาพด้านล่างนี้ข้อมูลโดยรวมทั้งหมด AWS Systems Manager ผ่าน SSM Agent ที่ปรับใช้ใน EC2 Instance หรือ Server บน on-premise ซึ่งมีการตรวจสอบหรือ monitoring ผลลัพธ์ทั้งหมด และยังสามารถจัดการตั้งค่า resource ต่างๆ ที่ต้องการได้ด้วยตนเองและแบบอัตโนมัติ


การตั้งค่าสิทธิขาเข้าในการใช้งานนั้นไม่จำเป็นสำหรับใช้ใน SSM Agent ของระบบปฏิบัติการแต่ในรูปแบบของขาออกระหว่าง Systems Manager API นั้นจำเป็นที่จะต้องใข้งาน ดังนั้นอยากให้ระมัดระวังจากการใช้งานในซับเน็ตส่วนตัว สามารถศึกษาข้อมูลเพิ่มเติมได้จากบล็อกนี้เลยครับ
ภาษาญี่ปุ่น Access EC2 placed in a private subnet using AWS Systems Manager Session Manager | DevelopersIO

SSM Agent

สำหรับการจัดการต่างๆ AWS Systems Manager Agent (SSM Agent) นี้เป็นส่วนจำเป็นต่อการใช้งาน แต่ภายในจะได้รับข้อมูลผ่าน Amazon Message Delivery Service และการจัดการ

  • ภาษาญี่ปุ่น Actions, Resources, and Condition Keys for Amazon Message Delivery Service - AWS Identity and Access Management

  • OS ที่ใช้กับ SSM Agent นั้นเป็นแบบติดตั้งแล้วกับตัว AMI มีด้วยกันทั้งหมดดังนี้

  • Windows Server 2003-2012 R2 AMIs เปิดตัวเมื่อปี 2016 เดือนพศจิกายน
  • Windows Server 2016 and 2019
  • Windows Server 2022
  • Amazon Linux
  • Amazon Linux 2
  • Amazon Linux 2022
  • Ubuntu Server 16.04
  • Ubuntu Server 18.04
  • แต่ถ้าเรามีการใช้งาน AMI ที่เก่ากว่านั้นอย่างเช่นบน on-premise server หรือ OS ที่เหนือกว่านี้ คุณจำเป็นที่จะต้องติดตั้ง SSM Agent ซึ่งสามารถศึกษาวิธีการได้จากบทความของบล็อกด้านล่างนี้ครับ สำหรับผู้ใช้งาน OS

  • About SSM Agent - AWS Systems Manager
  • Supported Operating Systems - AWS Systems Manager
  • SSM Agent สามารถติดตั้ง instance ในสภาพแวดล้อมของ on-premises ได้ ซึ่งถ้าเรามีความสนใจที่จะใช้งาน SSM บนระบบที่เก่ากว่านี้สามารถศึกษาข้อมูลจากบล็อกด้านล่างนี้ได้ครับ

  • ภาษาญี่ปุ่น Manage on-premises servers with EC2 Systems Manager #reinvent
  • AWS Systems Manager Pricing (ราคา)

    หลายๆฟังก์ชั่นนั้นสามารถใช้งานได้ฟรี แต่ก็มีบางฟังก์ชั่นที่มีการคิดค่าใช้จ่ายในการทำงาน ตัวอย่างเช่น

  • OpsCenter
  • Advanced parameters
  • Parameter Store API execution
  • On-premise instance management
  • Using non-AWS packages in Distributor
  • Automation
  • ส่วนใหญ่การใช้งาน Log ที่บันทึกข้อมูลขาออกที่ใช้งานการรายงานต่างๆ จะเป็นส่วนที่มีการคิดค่าใช้ แต่ก็แลกมาด้วยกับความคุ้มค่าที่คุณสามารถ intergrated management ฟังก์ชั่นที่มีค่าใช้จ่ายน้อย

    feather และ elements ที่สร้าง AWS Systems Manager

    ในส่วนนี้ผมได้รวบรวมเนื้อหาของ function และ elements ที่ใช้งานอยู่ใน AWS Systems Manager มาจากบล็อกและบทความที่เขียนขึ้นภายใน Classmethod | Developers.IO . นะครับ ก่อนอื่นเลยผมคิดว่าเป็นเรื่องดีที่จะทำความเข้าใจ elements ของ 2 ตัวนี้ก่อนเพราะเป็นส่วนที่ใช้ในการแชร์ resource ต่างๆครับ

    SSM Documents

    SSM Documents ถูกกำหนดให้มีการทำงานและรันคำสั่งบนเพื่อจัดการ instances และ สามารถแชร์ resource จากส่วนกลางของ AWS Systems Manager และยังนำไปใช้กับ backend ในหลายๆเซอร์วิสที่ถูกสร้างโดย AWS Systems Manager ได้ด้วยเช่นกัน เริ่มต้นจากการใช้ Window AD ที่ได้กล่าวไปก่อนหน้านี้ภายในบล็อกว่าสามารถเก็บและบันทึกเอกสารไฟล์งานต่างๆได้ภายใน ซึ่งความยากของการใช้งานอยู่ที่การดึงไฟล์เหล่านั้นทั้งหมดออกมาใช้งาน นั้นทำให้การป้อนคำสั่งเพื่อสร้างเงื่อนไขการแสดงข้อมูลมีการใช้งานอย่างแพร่หลาย เพราะสามารถรันคำสั่งซ้ำเดิมที่เหมือนหรือคล้ายคลึงกันได้ ไม่ต้องเสียเวลามองหา ในเดือน กรกฎาคม ปี 2019 ได้มีเอกสารมากมายออกมาเกี่ยวกับเซอร์วิสต่างๆ (ถึงแม้ว่าตอนนี้จะไมไ่ด้อ่านหรือใช้งานทั้งหมด แต่ผมจะนำมาเขียนอธิบายในภายหลังนะครับ) รวมถึงเรื่องประเภทของ Document ด้วย เช่น Command Document/Automation Document/Policy Document,และอื่นๆ

    $ aws ssm list-documents --query "DocumentIdentifiers[?Owner==\`Amazon\`].{Name:Name,PlatformTypes:to_string(PlatformTypes),DocumentType:DocumentType,SchemaVersion:SchemaVersion,DocumentFormat:DocumentFormat,TargetType:TargetType}" --output table
    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    |                                                                              ListDocuments                                                                              |
    +----------------+---------------+----------------------------------------------------------------+----------------------+----------------+-------------------------------+
    | DocumentFormat | DocumentType  |                             Name                               |    PlatformTypes     | SchemaVersion  |          TargetType           |
    +----------------+---------------+----------------------------------------------------------------+----------------------+----------------+-------------------------------+
    |  JSON          |  Automation   |  AWS-ASGEnterStandby                                           |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  JSON          |  Automation   |  AWS-ASGExitStandby                                            |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  JSON          |  Command      |  AWS-ApplyDSCMofs                                              |  ["Windows"]         |  2.2           |  None                         |
    |  JSON          |  Command      |  AWS-ApplyPatchBaseline                                        |  ["Windows"]         |  1.2           |  None                         |
    |  JSON          |  Automation   |  AWS-AttachEBSVolume                                           |  ["Windows","Linux"] |  0.3           |  None                         |
    |  YAML          |  Automation   |  AWS-AttachIAMToInstance                                       |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  JSON          |  Command      |  AWS-ConfigureAWSPackage                                       |  ["Windows","Linux"] |  2.0           |  None                         |
    |  JSON          |  Command      |  AWS-ConfigureCloudWatch                                       |  ["Windows"]         |  1.2           |  None                         |
    |  JSON          |  Automation   |  AWS-ConfigureCloudWatchOnEC2Instance                          |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  JSON          |  Command      |  AWS-ConfigureDocker                                           |  ["Windows","Linux"] |  2.0           |  None                         |
    |  YAML          |  Automation   |  AWS-ConfigureS3BucketLogging                                  |  ["Windows","Linux"] |  0.3           |  /AWS::S3::Bucket             |
    |  YAML          |  Automation   |  AWS-ConfigureS3BucketVersioning                               |  ["Windows","Linux"] |  0.3           |  /AWS::S3::Bucket             |
    |  JSON          |  Command      |  AWS-ConfigureWindowsUpdate                                    |  ["Windows"]         |  1.2           |  None                         |
    |  JSON          |  Automation   |  AWS-CopySnapshot                                              |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Snapshot          |
    |  JSON          |  Automation   |  AWS-CreateDynamoDbBackup                                      |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWS-CreateImage                                               |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  JSON          |  Automation   |  AWS-CreateJiraIssue                                           |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWS-CreateManagedLinuxInstance                                |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWS-CreateManagedLinuxInstanceWithApproval                    |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWS-CreateManagedWindowsInstance                              |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWS-CreateManagedWindowsInstanceWithApproval                  |  ["Windows","Linux"] |  0.3           |  None                         |
    |  YAML          |  Automation   |  AWS-CreateSnapshot                                            |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Volume            |
    |  JSON          |  Automation   |  AWS-DeleteCloudFormationStack                                 |  ["Windows","Linux"] |  0.3           |  /AWS::CloudFormation::Stack  |
    |  JSON          |  Automation   |  AWS-DeleteCloudFormationStackWithApproval                     |  ["Windows","Linux"] |  0.3           |  /AWS::CloudFormation::Stack  |
    |  YAML          |  Automation   |  AWS-DeleteDynamoDbBackup                                      |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWS-DeleteDynamoDbTableBackups                                |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWS-DeleteEbsVolumeSnapshots                                  |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Volume            |
    |  JSON          |  Automation   |  AWS-DeleteImage                                               |  ["Windows","Linux"] |  0.3           |  None                         |
    |  YAML          |  Automation   |  AWS-DeleteSnapshot                                            |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Snapshot          |
    |  JSON          |  Automation   |  AWS-DetachEBSVolume                                           |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Volume            |
    |  YAML          |  Automation   |  AWS-DisablePublicAccessForSecurityGroup                       |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::SecurityGroup     |
    |  YAML          |  Automation   |  AWS-DisableS3BucketPublicReadWrite                            |  ["Windows","Linux"] |  0.3           |  /AWS::S3::Bucket             |
    |  YAML          |  Automation   |  AWS-EnableCloudTrail                                          |  ["Windows","Linux"] |  0.3           |  None                         |
    |  YAML          |  Automation   |  AWS-EnableS3BucketEncryption                                  |  ["Windows","Linux"] |  0.3           |  /AWS::S3::Bucket             |
    |  JSON          |  Command      |  AWS-FindWindowsUpdates                                        |  ["Windows"]         |  1.2           |  None                         |
    |  JSON          |  Policy       |  AWS-GatherSoftwareInventory                                   |  ["Windows","Linux"] |  2.0           |  None                         |
    |  JSON          |  Command      |  AWS-InstallApplication                                        |  ["Windows"]         |  1.2           |  None                         |
    |  JSON          |  Command      |  AWS-InstallMissingWindowsUpdates                              |  ["Windows"]         |  1.2           |  None                         |
    |  JSON          |  Command      |  AWS-InstallPowerShellModule                                   |  ["Windows"]         |  1.2           |  None                         |
    |  JSON          |  Command      |  AWS-InstallSpecificWindowsUpdates                             |  ["Windows"]         |  1.2           |  None                         |
    |  JSON          |  Command      |  AWS-InstallWindowsUpdates                                     |  ["Windows"]         |  1.2           |  None                         |
    |  JSON          |  Command      |  AWS-JoinDirectoryServiceDomain                                |  ["Windows"]         |  1.2           |  None                         |
    |  JSON          |  Command      |  AWS-ListWindowsInventory                                      |  ["Windows"]         |  1.2           |  None                         |
    |  JSON          |  Session      |  AWS-PasswordReset                                             |  ["Windows","Linux"] |  1.0           |  None                         |
    |  JSON          |  Automation   |  AWS-PatchAsgInstance                                          |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  JSON          |  Automation   |  AWS-PatchInstanceWithRollback                                 |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  YAML          |  Automation   |  AWS-PublishSNSNotification                                    |  ["Windows","Linux"] |  0.3           |  /AWS::SNS::Topic             |
    |  YAML          |  Automation   |  AWS-RebootRdsInstance                                         |  ["Windows","Linux"] |  0.3           |  /AWS::RDS::DBInstance        |
    |  JSON          |  Command      |  AWS-RefreshAssociation                                        |  ["Windows","Linux"] |  2.0           |  None                         |
    |  YAML          |  Automation   |  AWS-ReleaseElasticIP                                          |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::EIP               |
    |  YAML          |  Automation   |  AWS-ResizeInstance                                            |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  JSON          |  Automation   |  AWS-RestartEC2Instance                                        |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  JSON          |  Automation   |  AWS-RestartEC2InstanceWithApproval                            |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  JSON          |  Command      |  AWS-RunAnsiblePlaybook                                        |  ["Linux"]           |  2.0           |  None                         |
    |  JSON          |  Command      |  AWS-RunDockerAction                                           |  ["Windows","Linux"] |  2.0           |  None                         |
    |  JSON          |  Command      |  AWS-RunDocument                                               |  ["Windows","Linux"] |  2.2           |  None                         |
    |  JSON          |  Command      |  AWS-RunInspecChecks                                           |  ["Windows","Linux"] |  2.2           |  None                         |
    |  JSON          |  Command      |  AWS-RunPatchBaseline                                          |  ["Windows","Linux"] |  2.2           |  None                         |
    |  JSON          |  Command      |  AWS-RunPowerShellScript                                       |  ["Windows","Linux"] |  1.2           |  None                         |
    |  JSON          |  Command      |  AWS-RunRemoteScript                                           |  ["Windows","Linux"] |  2.2           |  None                         |
    |  JSON          |  Command      |  AWS-RunSaltState                                              |  ["Linux"]           |  2.0           |  None                         |
    |  JSON          |  Command      |  AWS-RunShellScript                                            |  ["Linux"]           |  1.2           |  None                         |
    |  JSON          |  Automation   |  AWS-SetupInventory                                            |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  JSON          |  Automation   |  AWS-SetupManagedInstance                                      |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  JSON          |  Automation   |  AWS-SetupManagedRoleOnEc2Instance                             |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  JSON          |  Automation   |  AWS-StartEC2Instance                                          |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  JSON          |  Automation   |  AWS-StartEC2InstanceWithApproval                              |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  YAML          |  Automation   |  AWS-StartRdsInstance                                          |  ["Windows","Linux"] |  0.3           |  /AWS::RDS::DBInstance        |
    |  JSON          |  Session      |  AWS-StartSSHSession                                           |  ["Windows","Linux"] |  1.0           |  None                         |
    |  JSON          |  Automation   |  AWS-StopEC2Instance                                           |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  JSON          |  Automation   |  AWS-StopEC2InstanceWithApproval                               |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  YAML          |  Automation   |  AWS-StopRdsInstance                                           |  ["Windows","Linux"] |  0.3           |  /AWS::RDS::DBInstance        |
    |  JSON          |  Automation   |  AWS-TerminateEC2Instance                                      |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  JSON          |  Automation   |  AWS-TerminateEC2InstanceWithApproval                          |  ["Windows","Linux"] |  0.3           |  /AWS::EC2::Instance          |
    |  JSON          |  Automation   |  AWS-UpdateCloudFormationStack                                 |  ["Windows","Linux"] |  0.3           |  /AWS::CloudFormation::Stack  |
    |  JSON          |  Automation   |  AWS-UpdateCloudFormationStackWithApproval                     |  ["Windows","Linux"] |  0.3           |  /AWS::CloudFormation::Stack  |
    |  JSON          |  Command      |  AWS-UpdateEC2Config                                           |  ["Windows"]         |  1.2           |  None                         |
    |  JSON          |  Automation   |  AWS-UpdateLinuxAmi                                            |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Command      |  AWS-UpdateSSMAgent                                            |  ["Windows","Linux"] |  1.2           |  None                         |
    |  JSON          |  Automation   |  AWS-UpdateWindowsAmi                                          |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWSSupport-ActivateWindowsWithAmazonLicense                   |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWSSupport-ExecuteEC2Rescue                                   |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWSSupport-GrantPermissionsToIAMUser                          |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWSSupport-ManageRDPSettings                                  |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWSSupport-ManageWindowsService                               |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWSSupport-ResetAccess                                        |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Command      |  AWSSupport-RunEC2RescueForWindowsTool                         |  ["Windows"]         |  2.2           |  None                         |
    |  JSON          |  Automation   |  AWSSupport-SendLogBundleToS3Bucket                            |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWSSupport-SetupIPMonitoringFromVPC                           |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWSSupport-StartEC2RescueWorkflow                             |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWSSupport-TerminateIPMonitoringFromVPC                       |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWSSupport-TroubleshootRDP                                    |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWSSupport-TroubleshootSSH                                    |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWSSupport-UpgradeWindowsAWSDrivers                           |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Command      |  AmazonInspector-ManageAWSAgent                                |  ["Windows","Linux"] |  2.2           |  None                         |
    |  JSON          |  Command      |  AWSEC2-ApplicationInsightsCloudwatchAgentInstallAndConfigure  |  ["Windows","Linux"] |  2.2           |  None                         |
    |  JSON          |  Automation   |  AWSEC2-CloneInstanceAndUpgradeSQLServer                       |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Automation   |  AWSEC2-CloneInstanceAndUpgradeWindows                         |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Command      |  AWSEC2-CreateVssSnapshot                                      |  ["Windows"]         |  2.2           |  None                         |
    |  JSON          |  Command      |  AWSEC2-ManageVssIO                                            |  ["Windows"]         |  2.2           |  None                         |
    |  JSON          |  Command      |  AWSEC2-RunSysprep                                             |  ["Windows"]         |  2.2           |  None                         |
    |  JSON          |  Automation   |  AWSEC2-SQLServerDBRestore                                     |  ["Windows","Linux"] |  0.3           |  None                         |
    |  JSON          |  Command      |  AmazonCloudWatch-ManageAgent                                  |  ["Windows","Linux"] |  2.2           |  None                         |
    |  JSON          |  Command      |  AmazonCloudWatch-MigrateCloudWatchAgent                       |  ["Windows"]         |  2.2           |  None                         |
    +----------------+---------------+----------------------------------------------------------------+----------------------+----------------+-------------------------------+


    สามารถส่งบทความเกี่ยวกับการสร้าง SSM Document ที่

    ภาษาญี่ปุ่น I created a document for AWS Systems Manager and tried using it.

    Parameter Store

    Parameter Store ถูกสร้างและจัดเตรียมเกี่ยวกับการลำดับความปลอดภัยของการจัดเก็บข้อมูลสำหรับตั้งค่า การจัดการข้อมูลและการจัดการในส่วนที่เป็นความลับ ตัวอย่างเช่น รหัสผ่าน,ฐานข้อมูล และโค้ดลิขสิทธิ์ต่างๆ สามารถจัดเก็บให้อยู่ในรูปแบบ parameter vaules

    ภาษาญี่ปุ่น Presented Parameter Store at an internal study meeting

    และล่าสุดได้มีการเปิดตัว Advanced Parameter เพื่อให้สามารถใช้งานกับแอพพลิเคชันในระดับสูงได้

    ภาษาญี่ปุ่น Parameter store has been greatly updated!

    และทั้งนี้ยังมี parameter สาธารณะให้เปิดใช้งานเก็บข้อมูลสำหรับโดย AWS ซึ่งทำให้การใช้งานสะดวกมากยิ่งขึ้นในบางกรณี

    ภาษาญี่ปุ่น I want to launch EC2 from the latest Windows AMI at any time with CloudFormation (using public parameter store)

    ภาษาญี่ปุ่น Get a list of AWS services using AWS Systems Manager Parameter Store

    ต่อไป ผมจะแนะนำเกี่ยวกับเซอร์วิสสำหรับ การจำแนกกลุ่มและจัดการ resources นะครับ

    OpsCenter

    เปิดตัวในเดือน มิถุนายน ปี 2019 เป็นเซอร์วิสที่ผู้ใช้สามารถมองเห็นและตรวจสอบข้อมูลได้ รวมถึงแก้ไขปัญหาที่เกิดขึ้นกับ resource ต่างๆ หรือส่วนที่มีความเกี่ยวข้องครับ OPsItems เซอร์วิสนี้ถูกออกแบบมาเพื่อลดระยะเวลาในการกระจัดขอบเขตของข้อมูลที่อาจส่งผลกระทบต่อ AWS resources ของเรา

    ภาษาญี่ปุ่น [NEW FEATURE] Systems Manager OpsCenter Released!

    การรวบรวมข้อมูลด้วย CloudWatch Events ทำให้เราสามารถเพิ่ม instances ได้อัตโนมัติไปยัง OpsItems และยังสามารถเพิ่มการจัดการ resource ได้ด้วยตนเอง จากการเก็บข้อมูลอัตโนมัติก็สามารภที่จะเตรียมการ recovery แบบอัตโนมัติได้โดยใช้เงื่อนไขที่ทำให้ CloudWatch Events ทำงาน

    Resource Groups

    Resource Groups จะอนุญาตให้เราเข้าไปจัดการกระบวนการจัดเก็บ AWS resource โดยมีการกำหนัดเงื่อนไขชัดเจนในการแสดงผลข้อมูลที่อยู่ใน Region เดียวกัน สามารถจัดกลุ่มเพื่อจัดการเป้าหมายที่เราต้องการได้ภายใน Resource Group ที่ใช้หน่วยกลไกการจัดการต่าง ๆ ตามมาในแต่ละหน่วยจะมีการสร้างกลุ่มกลไกการจัดการต่าง ๆ ตามมาในแต่ละหน่วย

    ภาษาญี่ปุ่น [AWS] Use resource groups to manage AWS resources for test, staging, and production environments

  • resource-groups — AWS CLI 1.16.197 Command Reference
  • และสำหรับฟังก์ชันถัดไปที่ผมจะนำเสนอ จะเกี่ยวกับการตั้งเวลาและกำหนดเวลาอย่างแม่นยำ ซึ่งก็มีฟังก์ชันมากมายที่สามารถกำหนดเวลาได้ แค่ผมคิดว่าฟังก์ชันนี้คือฟังก์ชันเดียวที่ใช้งานเฉพาะและจัดการในส่วนของการตั้งเวลาได้เท่านั้น

    Maintenance Windows

    Maintenance Windows คือฟังก์ชันที่สามารถตั้งเวลาเพื่อเปลี่ยนแปลงการกระทำต่างๆได้ เช่น Run Command, Automation, Lambda, Step Function สำหรับใช้จัดการ instances เหมือนกับแอพพลิเคชันที่อยู่ในระบบปฏิบัติการอย่าง driver update และ SW Patch installation ซึ่งจะใช้งานเมื่อเรามีการกำหนดว่าที่แน่นอนให้เริ่มต้นสิ่งนั้นๆ

    ภาษาญี่ปุ่น Periodically reboot any EC2 instance in Systems Manager Maintenance Window

    นอกจากนี้ ถึงแม้ว่าจะเป็นบทความเก่าเล็กน้อยแต่ผมอยากให้เราได้ดูข้อมูลต่อไปนี้เพื่อเป็นข้อมูลอ้างอิงสำหรับกรณีมีการใช้งาน

  • ภาษาญี่ปุ่น Resource-groups — AWS CLI 1.16.197 Command Reference
  • ภาษาญี่ปุ่น I tried daily acquisition of AMI with EC2 Systems Manager | DevelopersIO
  • ต่อไปเราจะมาแนะนำเกี่ยวกับฟังก์ชันสำหรับการดำเนินการเปลี่ยนแปลงต่างๆ โดยปกติแล้วมีอยู่หลายประเภทที่นี่ซึ่งอาจทำให้สับสนได้

    Run Command

    คือฟังก์ชันที่ใช้ในการรันคำสั่งล่วงหน้าเพื่งกำหนดข้อมูล SSM ไปยังอินสแตนซ์ที่มีการจัดการซึ่งมีการติดตั้งตัวแทน SSM และสามารถเก็บรวบรวมการจัดการ resources โดยไม่จำเป็นต้องมีการทำ logging ภายใน RDP หรือ SSH ซึ่งจำเป็นต่อการใช้ AWS Systems Manager บนเซิร์ฟเวอร์ ผมได้เขียนให้มีการกำหนดเอกสาร SSM ไว้ล่วงหน้า แต่ความจริงก็ยังมีเอกสารที่สามารถใช้งานได้โดยไม่ต้องผ่านการควบคุม เช่น "AWS-RunShellScript" และ "AWS-RunPowerShellScript" ดังนั้นจึงสามารถเรียกใช้คำสั่งโดยอำเภอใจได้โดยมีสิทธิ์ของผู้ดูแลระบบ

    วิธีการรันคำสั่งจาก Management Console โดยไม่ต้องเข้า Windows

  • ภาษาญี่ปุ่น I made a simple OS configuration document with AWS Systems Manager for Amazon Linux 2 | DevelopersIO
  • Automation

    Automation คือความสามารถในการสร้าง Workflows อัตโนมัติเพื่อเอามาจัดการ instances และ AWS resources และเพื่อกำหนด workflows ล่วงหน้า เราสามารถสร้างและออกแบบ workflows ของเราได้ตามต้องการ หนึ่งในกระบวนการสำคัญของการกำหนด workflows คือความสามารถในการ monitoring และทำการแจ้งเตือน(notification) ภายในเซอร์วิส CloudWatch ได้ หรือ จากตัว AWS Systems Manager console ก็ได้เช่นกัน

    ตัวอย่างของการใช้งาน Automation อย่างเป็นทางการได้แก่

  • perform common IT tasks
  • Workflow management based on approval
  • Safely execute destructive tasks in batches
  • Combine with Resource Groups to operate multiple units at once
  • Simplify complex tasks
  • Automated AMI creation with AWS-UpdateLinuxAmi, AWS-UpdateWindowsAmi
  • Restoring a failed instance using AWSSupport-ExecuteEC2Rescue
  • Enhance operational security
  • Operation by a delegated administrator by embedding an IAM role in Automation
  • share best practices
  • Automation Document sharing as know-how
  • In addition, please take a look at the following articles.
  • AWS Systems Manager Automation - AWS Systems Manager
  • Distributor

    ด้วย Distributer เราสามารถเปลี่ยนเป็นแพ็คเกจซอฟต์แวร์ลักษณะเฉพาะ และค้นหา agent software package ที่ให้บริการโดย AWS เช่น AmazonCloudWatchAgent และ ติดตั้งทั้งหมดนี้ลงใน instances ของเราได้ (เมื่อมีการรันคำสั่ง/การกำหนดเวลาจะเกิดขึ้นใน State Manager)

    ภาษาญี่ปุ่น Distribute software with Systems Manager Distributor!

    Session manager

    คือฟีเจอร์ที่อนุญาตให้เราสามารถจัดการส่วนความปลอดภัยและ instances ที่มีการตรวจสอบได้โดยไม่ต้องเปิดใช้งาน inbound ports, maintaining bastion hosts, หรือส่วนการจัดการ SSH Keys เลยแม้แต่นิดเดียว

    ภาษาญี่ปุ่น Will there ever be an era where SSH is unnecessary!? AWS Systems Manager Session Manager has been released!

    และในอัพเดทล่าสุดของฟังก์ชันนี้ก็มีการตอบรับที่ทั้ง 2 ฝั่ง ทั้งฝั่งที่อยู่ในและนอกบริษัท สำหรับการบำรุงแก้ไขเซิร์ฟเวอร์ด้วยไม่จำเป็นต้องใช้ inbound ในการขอความยินยอมเพื่อไปตั้งค่าการใช้งาน และจะทำให้กลายเป็นพื้นฐานการใช้งานในอนาคต

    ภาษาญี่ปุ่น AWS Systems Manager Session Manager now supports SSH/SCP

    สุดท้ายแล้ว เราจะขอนำเสนอฟังก์ชันสำหรับการจัดการสถานของการจัดการ object

    State Manager

    คือระบบความปลอดภัย เป็นเซอร์วิสที่สามารถปรับขนาดการใช้งานได้อัตโนมัติโดยอ้างอิงจากการทำงานของ EC2 หรือ on-premises instances ที่อยู่ในพื้นที่ที่กำหนด State Manager ถูกใช้งานในการปรับปรุงและตั้งค่าคำร้องขอที่มาจาก policy
    ตัวอย่างที่สามารถจัดการได้โดยใช้ State Manager

  • Bootstrap an instance with specific software at launch
  • Download and update agents (such as SSM Agent) according to a defined schedule
  • Configure network settings
  • Join an instance to a Windows domain (Windows instances only)
  • Patch instances with software updates throughout their lifecycle
  • Run scripts on Linux and Windows managed instances throughout their lifecycle
  • ตามการตั้งค่าพื้นฐานจะมีการตั้งค่าดังนี้ 1. กำหนดฟอร์มในรูปแบบของ SSM Document 2. Associate managed resources ด้วย SSM documents
    -- ถ้าเป็นการใช้ Command Document/Policy Document จะมีการตั้งค่าและกำหนดให้ตรวจสอบเป็นระยะๆ
    -- ถ้าเป็นการใช้ Automation Document จะมีการกำหนด Automation workflow

  • ภาษาญี่ปุ่น I tried State Manager of Amazon EC2 Systems Manager #reinvent | DevelopersIO
  • Inventory

    Inventory จะอนุญาตให้เราสามารถบันทึกการข้อมูลการตั้งค่าของเราได้เช่นเดียวกัน managed applications และยังสามารถส่งข้อมูลการแจ้งเตือนไปยัง AWS Config เพื่อใช้รวมการจัดการเข้ากับ Config Rules และ การนำมาวิเคราะห์และแสดงผลข้อมูลที่มีการบันทึกไว้ใน S3 ด้วย Athena และ QuickSight

    ภาษาญี่ปุ่น I want to display the software and version list installed on the EC2 instance

    ภาษาญี่ปุ่น I tried to find out which application information AWS Systems Manager inventory collects

    Patch Manager

    Patch Manager คือฟังก์ชันที่ใช้ในการระบุ patch application rules สำหรับใช้ในการจัดการเป้าหมายและการทำ automates patch application และ การรายงาน โดยเฉพาะเจาะจง มีการตั้งค่าที่ถูกสร้างขึ้นจากองค์ประกอบ 4 อย่างด้านล่างนี้คือ

    1.Create patch baseline (predefined/custom)
    2.Create a patch group (specify management targets)
    3.Add Patch Group to Patch Baseline
    4.Create MaintenanceWindow for patching

    การจัดการ Window instances และ Linux instances จะมีการเปลี่ยนแปลงของกระบวนการต่างๆเพื่อประเมินว่า patches ไหนควรจะถูกส่งมอบและใช้งานสำหรับการทำ Window patching ระบบจะทำการจัดการและคำนวนว่า patch baseline rules และ ข้อมูลไหนควรที่จะอนุญาตให้ใช้งานหรือควรจะถูกปฏิเสธจากการเข้าถึงของเซอร์วิส ซึ่งสามารถทำได้เพราะ Windows patches นั้นมาจาก single repository หรือ Windows Update นั้นเอง

  • Key Differences Between Linux and Windows Patching - AWS Systems Manager
  • ภาษาญี่ปุ่น I tried to find out which application information AWS Systems Manager inventory collects
  • ข้อมูลเพิ่มเติม

    สำหรับใครที่อยากศึกษาข้อมูลเพิ่มเติมทั้งหมดของเนื้อหานี้ สามารถดูได้จากลิงก์ด้านล่างนี้เลยครับ

  • AWS Systems Manager Documentation
  • Frequently Asked Questions - AWS Systems Manager | AWS
  • ภาษาญี่ปุ่น [Session Report] How I Stopped Using SSH in One Day - AWS Systems Manager Session Manager Installation and Operation Tips - #jawsdays #jawsug #jd2019_e | DevelopersIO
  • ภาษาญี่ปุ่น [Report] [Beginner] Automation of System Operation Management on AWS #AWSSummit | DevelopersIO
  • ภาษาญี่ปุ่น [Report] "Thorough Use of AWS Systems Manager -From Enterprise Use Cases-" AWS Summit Tokyo 2019 #AWSSummit | DevelopersIO
  • สรุป

    สำหรับเนื้อหาของบล็อกนี้ทั้งหมด ผมแปลมาจากบล็อกภาษาญี่ปุ่นของคุณ にしざわ (Nishizawa-san) ครับ เขาได้มีการสรุปและเรียบเรียงของมูลเอาไว้เป็นอย่างดี มีความละเอียดและทำความเข้าใจได้ง่ายซึ่งสำหรับใครที่สนใจลิงก์ต้นฉบับสามารถคลิ้กดูได้ด้านล่างนี้เลยครับ

  • AWS再入門ブログリレー AWS Systems Manager編
  • หวังว่าทุกคนที่ได้เข้ามาอ่านบล็อกนี้จะได้รับความรู้มากขึ้นเกี่ยวกับ Amazon SSM มากขึ้นนะครับ ในเรื่องการแปลและเรียบเรียงคำจากภาษาญี่ปุ่นเป็นภาษาไทยอาจจะ ไม่ค่อยสวยแต่จะพยายามฝึกและเขียนบล็อกแปลต่อไปเรื่อยๆ ครับผม ขอบคุณครับ

    บทความที่เกี่ยวข้อง

  • AWS Systems Manager คืออะไร ?
  • Do you know AWS's new service SSM?
  • AWS Directory Service
  • [Breaking News] Announcing Amazon EC2 Systems Manager #reinvent
  • Access EC2 placed in a private subnet using AWS Systems Manager Session Manager | DevelopersIO
  • Actions, Resources, and Condition Keys for Amazon Message Delivery Service - AWS Identity and Access Management
  • Actions, Resources, and Condition Keys for Amazon Message Delivery Service - AWS Identity and Access Management
  • Supported Operating Systems - AWS Systems Manager
  • Manage on-premises servers with EC2 Systems Manager #reinvent
  • Classmethod | Developers.IO .
  • I created a document for AWS Systems Manager and tried using it.
  • Presented Parameter Store at an internal study meeting
  • Parameter store has been greatly updated!
  • I want to launch EC2 from the latest Windows AMI at any time with CloudFormation (using public parameter store)
  • Get a list of AWS services using AWS Systems Manager Parameter Store
  • [NEW FEATURE] Systems Manager OpsCenter Released!
  • [AWS] Use resource groups to manage AWS resources for test, staging, and production environments
  • resource-groups — AWS CLI 1.16.197 Command Reference
  • Periodically reboot any EC2 instance in Systems Manager Maintenance Window
  • resource-groups — AWS CLI 1.16.197 Command Reference
  • I tried daily acquisition of AMI with EC2 Systems Manager | DevelopersIO
  • [Small story] How to write SSM Run Command with reboot
  • I made a simple OS configuration document with AWS Systems Manager for Amazon Linux 2 | DevelopersIO
  • Automate Windows Update execution with SSM Automation
  • Introduction of step execution that you want to use when trying out SSM Automation
  • I set up a CloudWatch Event that notifies me when SSM Automation fails
  • I tried SSM Automation to automatically patch one by one with AutoScaling
  • AWS Systems Manager Automation - AWS Systems Manager
  • Distribute software with Systems Manager Distributor!
  • Distribute software with Systems Manager Distributor!
  • AWS Systems Manager Session Manager now supports SSH/SCP
  • I tried State Manager of Amazon EC2 Systems Manager #reinvent | DevelopersIO
  • I want to display the software and version list installed on the EC2 instance
  • I tried to find out which application information AWS Systems Manager inventory collects
  • Key Differences Between Linux and Windows Patching - AWS Systems Manager
  • I tried to find out which application information AWS Systems Manager inventory collects
  • AWS Systems Manager Documentation
  • Frequently Asked Questions - AWS Systems Manager | AWS
  • [Session Report] How I Stopped Using SSH in One Day - AWS Systems Manager Session Manager Installation and Operation Tips - #jawsdays #jawsug #jd2019_e | DevelopersIO
  • [Report] [Beginner] Automation of System Operation Management on AWS #AWSSummit | DevelopersIO
  • [Report] "Thorough Use of AWS Systems Manager -From Enterprise Use Cases-" AWS Summit Tokyo 2019 #AWSSummit | DevelopersIO
  • にしざわ (Nishizawa-san)
  • AWS再入門ブログリレー AWS Systems Manager編