์ธํ”„๋ผ ๋ชจ๋‹ˆํ„ฐ๋ง

์‹ค์Šต ๊ฐœ์š”

์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ ์ธํ”„๋ผ ๋ชจ๋‹ˆํ„ฐ๋ง์€ ์•ˆ์ •์ ์ด๊ณ  ์ผ๊ด€๋œ IT ์„œ๋น„์Šค ์ œ๊ณต์— ๋งค์šฐ ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค.

๋ชจ๋‹ˆํ„ฐ๋ง ์š”๊ตฌ ์‚ฌํ•ญ์€ ์žฅ๊ธฐ ๋ถ„์„์„ ์œ„ํ•œ ํ†ต๊ณ„ ์ˆ˜์ง‘๋ถ€ํ„ฐ ๋ณ€๊ฒฝ ๋ฐ ์ค‘๋‹จ์— ๋Œ€ํ•œ ์‹ ์†ํ•œ ๋Œ€์‘๊นŒ์ง€ ๋‹ค์–‘ํ•ฉ๋‹ˆ๋‹ค. ๋ชจ๋‹ˆํ„ฐ๋ง์€ ์ธํ”„๋ผ๊ฐ€ ์กฐ์ง ํ‘œ์ค€์„ ์ถฉ์กฑํ•˜๋Š”์ง€ ์ง€์†์ ์œผ๋กœ ํ™•์ธํ•จ์œผ๋กœ์จ ๊ทœ์ • ์ค€์ˆ˜ ๋ณด๊ณ ๋„ ์ง€์›ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ์‹ค์Šต์—์„œ๋Š” Amazon CloudWatch Metrics, Amazon CloudWatch Logs, Amazon CloudWatch Events, AWS Config๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜๊ณผ ์ธํ”„๋ผ๋ฅผ ๋ชจ๋‹ˆํ„ฐ๋งํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

์ด ์‹ค์Šต์„ ์™„๋ฃŒํ•˜๋ฉด ๋‹ค์Œ์„ ํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

์†Œ์š” ์‹œ๊ฐ„

๋ณธ ์‹ค์Šต์„ ์™„๋ฃŒํ•˜๋Š” ๋ฐ๋Š” ์•ฝ 60๋ถ„์ด ์†Œ์š”๋ฉ๋‹ˆ๋‹ค.

 

AWS Management Console ์•ก์„ธ์Šค

  1. ์ง€์นจ์˜ ๋งจ ์œ„์—์„œ ์‹ค์Šต ์‹œ์ž‘(Start Lab)์„ ์„ ํƒํ•˜์—ฌ ์‹ค์Šต์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

์‹ค์Šต์‹œ์ž‘(Start Lab) ํŒจ๋„์ด ์—ด๋ฆฌ๊ณ  ์‹ค์Šต ์ƒํƒœ๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

  1. โ€œ์‹ค์Šต ์ƒํƒœ: ์ค€๋น„(Lab status: ready)โ€ ๋ฉ”์‹œ์ง€๊ฐ€ ํ‘œ์‹œ๋˜๋ฉด X๋ฅผ ์„ ํƒํ•˜์—ฌ Start Lab ํŒจ๋„์„ ๋‹ซ์Šต๋‹ˆ๋‹ค.
  2. ์ง€์นจ์˜ ๋งจ ์œ„์—์„œ AWS๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

์ƒˆ ๋ธŒ๋ผ์šฐ์ € ํƒญ์—์„œ AWS Management Console์ด ์—ด๋ฆฝ๋‹ˆ๋‹ค. ์‹œ์Šคํ…œ์— ์ž๋™์œผ๋กœ ๋กœ๊ทธ์ธ๋ฉ๋‹ˆ๋‹ค.

ํŒ: ์ƒˆ ๋ธŒ๋ผ์šฐ์ € ํƒญ์ด ์—ด๋ฆฌ์ง€ ์•Š๋Š” ๊ฒฝ์šฐ ์ผ๋ฐ˜์ ์œผ๋กœ ๋ธŒ๋ผ์šฐ์ €์—์„œ ํŒ์—… ์ฐฝ์„ ์—ด ์ˆ˜ ์—†์Œ์„ ๋‚˜ํƒ€๋‚ด๋Š” ๋ฐฐ๋„ˆ ๋˜๋Š” ์•„์ด์ฝ˜์ด ๋ธŒ๋ผ์šฐ์ € ์ƒ๋‹จ์— ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ๋ฐฐ๋„ˆ ๋˜๋Š” ์•„์ด์ฝ˜์„ ์„ ํƒํ•˜๊ณ  ํŒ์—… ํ—ˆ์šฉ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  1. ์ด ์ง€์นจ๊ณผ ํ•จ๊ป˜ ํ‘œ์‹œ๋˜๋„๋ก AWS Management Console ํƒญ์„ ์ •๋ ฌํ•ฉ๋‹ˆ๋‹ค. ๋‘ ๋ธŒ๋ผ์šฐ์ € ํƒญ์ด ๋™์‹œ์— ํ‘œ์‹œ๋˜์–ด ์‹ค์Šต ๋‹จ๊ณ„๋ฅผ ๋ณด๋‹ค ์‰ฝ๊ฒŒ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

์ด ์‹ค์Šต ๋„์ค‘ ๋ฆฌ์ „์„ ๋ณ€๊ฒฝํ•˜์ง€ ๋งˆ์‹ญ์‹œ์˜ค.

 

๊ณผ์ œ 1: CloudWatch ์—์ด์ „ํŠธ ์„ค์น˜

CloudWatch ์—์ด์ „ํŠธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ EC2 ์ธ์Šคํ„ด์Šค์™€ ์˜จํ”„๋ ˆ๋ฏธ์Šค ์„œ๋ฒ„์—์„œ ๋‹ค์Œ์„ ํฌํ•จํ•œ ์ง€ํ‘œ๋ฅผ ์ˆ˜์ง‘ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ๊ณผ์ œ์—์„œ๋Š” Systems Manager๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ EC2 ์ธ์Šคํ„ด์Šค์— CloudWatch ์—์ด์ „ํŠธ๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค. ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ง€ํ‘œ์™€ ์‹œ์Šคํ…œ ์ง€ํ‘œ๋ฅผ ๋ชจ๋‘ ์ˆ˜์ง‘ํ•˜๋„๋ก ์—์ด์ „ํŠธ๋ฅผ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

AWS Systems Manager

  1. AWS ๊ด€๋ฆฌ ์ฝ˜์†”์˜ ์„œ๋น„์Šค(Services) ๋ฉ”๋‰ด์—์„œ Systems Manager๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  2. ์™ผ์ชฝ ํƒ์ƒ‰ ์ฐฝ์—์„œ Run Command๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

    ํ‘œ์‹œ๋˜๋Š” ํƒ์ƒ‰ ์ฐฝ์ด ์—†๋Š” ๊ฒฝ์šฐ ์™ผ์ชฝ ์ƒ๋‹จ ๋ชจ์„œ๋ฆฌ์˜ ์•„์ด์ฝ˜์„ ์„ ํƒํ•˜์—ฌ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.

    Run Command๋Š” CloudWatch ์—์ด์ „ํŠธ๋ฅผ ์„ค์น˜ํ•˜๋Š” ๋ฏธ๋ฆฌ ์ž‘์„ฑ๋œ ๋ช…๋ น์„ ๋ฐฐํฌํ•˜๋Š” ๋ฐ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

  3. ๋ช…๋ น ์‹คํ–‰(Run a Command)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  4. AWS-ConfigureAWSPackage ์˜†์˜ ๋ฒ„ํŠผ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. (์ผ๋ฐ˜์ ์œผ๋กœ ๋ชฉ๋ก ์œ„์ชฝ์— ํ‘œ์‹œ๋จ)

  5. ํŒŒ๋ผ๋ฏธํ„ฐ ๋ช…๋ น(Command parameters) ์„น์…˜์œผ๋กœ ์Šคํฌ๋กคํ•˜๊ณ  ๋‹ค์Œ ์ •๋ณด๋ฅผ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

    • ์ž‘์—…(Action): ์„ค์น˜(Install)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
    • ์ด๋ฆ„(Name): AmazonCloudWatchAgent๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
    • ๋ฒ„์ „(Version): latest๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
  6. ๋Œ€์ƒ(Targets) ์„น์…˜์—์„œ ์ˆ˜๋™์œผ๋กœ ์ธ์Šคํ„ด์Šค ์„ ํƒ(Choose instances manually)๋ฅผ ์„ ํƒํ•œ ๋‹ค์Œ ์ธ์Šคํ„ด์Šค(Instances) ์•„๋ž˜์—์„œ Web Server ์˜†์˜ ํ™•์ธ๋ž€์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

    ์ด ๊ตฌ์„ฑ์€ ์›น ์„œ๋ฒ„์— CloudWatch ์—์ด์ „ํŠธ๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

  7. ํŽ˜์ด์ง€ ํ•˜๋‹จ์—์„œ ์‹คํ–‰(Run)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  8. ์ „์ฒด ์ƒํƒœ(Overall status)๊ฐ€ ์„ฑ๊ณต(Success)์œผ๋กœ ๋ฐ”๋€” ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆฝ๋‹ˆ๋‹ค. ์ด๋”ฐ๊ธˆ ํŽ˜์ด์ง€ ์ƒ๋‹จ์˜ ์ƒˆ๋กœ๊ณ ์นจ์„ ์„ ํƒํ•˜์—ฌ ์ƒํƒœ๋ฅผ ์—…๋ฐ์ดํŠธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

    ์ž‘์—…์˜ ์ถœ๋ ฅ ๊ฒฐ๊ณผ์—์„œ ์„ฑ๊ณต์ ์œผ๋กœ ์‹คํ–‰๋˜์—ˆ์Œ์„ ์•Œ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  9. ๋Œ€์ƒ ๋ฐ ์ถœ๋ ฅ(Targets and outputs)์—์„œ ์ธ์Šคํ„ด์Šค ID(Instance ID) ์•„๋ž˜ ํ‘œ์‹œ๋˜๋Š” ์ธ์Šคํ„ด์Šค ์ด๋ฆ„์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  10. 1๋‹จ๊ณ„ - ์ถœ๋ ฅ(Step 1 - Output)์„ ํ™•์žฅํ•ฉ๋‹ˆ๋‹ค.

    ๋‹ค์Œ ๋ฉ”์‹œ์ง€๊ฐ€ ํ‘œ์‹œ๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. arn:aws:ssm:::package/AmazonCloudWatchAgent๋ฅผ ์„ฑ๊ณต์ ์œผ๋กœ ์„ค์น˜ํ–ˆ์Šต๋‹ˆ๋‹ค.(Successfully installed arn:aws:ssm:::package/AmazonCloudWatchAgent.)

    ์‚ฌ์ „ ์กฐ๊ฑด์ด ์ถฉ์กฑ๋˜์ง€ ์•Š์•„ ์‹คํ–‰ ๋‹จ๊ณ„๋ฅผ ๊ฑด๋„ˆ๋œ๋‹ˆ๋‹ค.'"StringEquals": [platformType, Windows]โ€™. ๋‹จ๊ณ„ ์ด๋ฆ„: createDownloadFolder(Step name: createDownloadFolder)๋ผ๋Š” ๋ฉ”์‹œ์ง€๊ฐ€ ํ‘œ์‹œ๋˜๋ฉด 2๋‹จ๊ณ„ - ์ถœ๋ ฅ(Step 2 - Output)์„ ๋Œ€์‹  ํ™•์žฅํ•ฉ๋‹ˆ๋‹ค. ์‚ฌ์šฉ ์ค‘์ธ ์ธ์Šคํ„ด์Šค๊ฐ€ Linux AMI์—์„œ ์ƒ์„ฑ๋˜์—ˆ๊ธฐ ๋•Œ๋ฌธ์— ์ด ์˜ต์…˜์„ ์„ ํƒํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์ด ๋ฉ”์‹œ์ง€๋Š” ๋ฌด์‹œํ•ด๋„ ๋ฉ๋‹ˆ๋‹ค.

    ์ด์ œ ์›ํ•˜๋Š” ๋กœ๊ทธ ์ •๋ณด๋ฅผ ์ˆ˜์ง‘ํ•˜๋„๋ก CloudWatch ์—์ด์ „ํŠธ๋ฅผ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค. ์ธ์Šคํ„ด์Šค์— ์›น ์„œ๋ฒ„๊ฐ€ ์„ค์น˜๋˜์–ด ์žˆ์œผ๋ฏ€๋กœ ์›น ์„œ๋ฒ„ ๋กœ๊ทธ์™€ ์ผ๋ฐ˜์ ์ธ ์‹œ์Šคํ…œ ์ง€ํ‘œ๋ฅผ ์ˆ˜์ง‘ํ•˜๋„๋ก CloudWatch ์—์ด์ „ํŠธ๋ฅผ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

    ๊ตฌ์„ฑ ํŒŒ์ผ์„ AWS Systems Manager Parameter Store์— ์ €์žฅํ•˜๋ฉด CloudWatch ์—์ด์ „ํŠธ๊ฐ€ ๊ตฌ์„ฑ ํŒŒ์ผ์„ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  11. ์™ผ์ชฝ ํƒ์ƒ‰ ์ฐฝ์—์„œ ํŒŒ๋ผ๋ฏธํ„ฐ ์Šคํ† ์–ด(Parameter Store)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  12. ํŒŒ๋ผ๋ฏธํ„ฐ ์ƒ์„ฑ(Create parameter)์„ ์„ ํƒํ•˜๊ณ  ๋‹ค์Œ ์ •๋ณด๋ฅผ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

    • ์ด๋ฆ„(Name): Monitor-Web-Server๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
    • ์„ค๋ช…(Description): Collect web logs and system metrics๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
    • ๊ฐ’(Value): ๋‹ค์Œ ๊ตฌ์„ฑ์„ ๋ณต์‚ฌํ•˜์—ฌ ๋ถ™์—ฌ๋„ฃ์Šต๋‹ˆ๋‹ค.

    ์œ„์˜ ๊ตฌ์„ฑ์„ ๊ฒ€์‚ฌํ•ฉ๋‹ˆ๋‹ค. ์ด ๊ตฌ์„ฑ์€ ๋ชจ๋‹ˆํ„ฐ๋งํ•  ๋‹ค์Œ ํ•ญ๋ชฉ์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค.

    • ๋กœ๊ทธ(Logs): ์ˆ˜์ง‘ํ•˜์—ฌ CloudWatch Logs๋กœ ์ „์†กํ•  2๊ฐœ์˜ ์›น ์„œ๋ฒ„ ๋กœ๊ทธ ํŒŒ์ผ
    • ์ง€ํ‘œ(Metrics): Amazon CloudWatch Metrics๋กœ ์ „์†กํ•  CPU, ๋””์Šคํฌ, ๋ฉ”๋ชจ๋ฆฌ ์ง€ํ‘œ
  13. ํŒŒ๋ผ๋ฏธํ„ฐ ์ƒ์„ฑ(Create parameter)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

    ์ด ํŒŒ๋ผ๋ฏธํ„ฐ๋Š” CloudWatch ์—์ด์ „ํŠธ๋ฅผ ์‹œ์ž‘ํ•  ๋•Œ ์ฐธ์กฐ๋ฉ๋‹ˆ๋‹ค.

    ์ด์ œ ๋‹ค๋ฅธ Run Command๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์›น ์„œ๋ฒ„์—์„œ CloudWatch ์—์ด์ „ํŠธ๋ฅผ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

  14. ์™ผ์ชฝ ํƒ์ƒ‰ ์ฐฝ์—์„œ Run Command๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  15. Run command๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  16. ์ƒ์ž๋ฅผ ์„ ํƒํ•˜๊ณ  ๋‹ค์Œ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

    • ๋ฌธ์„œ ์ด๋ฆ„ ์ ‘๋‘์‚ฌ(Document name prefix)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
    • Equals๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
    • AmazonCloudWatch-ManageAgent๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
    • ํ•„ํ„ฐ๊ฐ€ Document name prefix : Equals : AmazonCloudWatch-ManageAgent์ธ์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
    • Enter ํ‚ค๋ฅผ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.

    ๋ช…๋ น์„ ์‹คํ–‰ํ•˜๊ธฐ ์ „์— ๋ช…๋ น์˜ ์ •์˜๋ฅผ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  17. AmazonCloudWatch-ManageAgent๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค(์ด๋ฆ„ ์ž์ฒด๋ฅผ ์„ ํƒ).

    ๋ช…๋ น์˜ ์ •์˜๋ฅผ ๋ณด์—ฌ์ฃผ๋Š” ์ƒˆ ์›น ๋ธŒ๋ผ์šฐ์ € ํƒญ์ด ์—ด๋ฆฝ๋‹ˆ๋‹ค.

    ๊ฐ ํƒญ์˜ ์ฝ˜ํ…์ธ ๋ฅผ ํƒ์ƒ‰ํ•˜์—ฌ ๋ช…๋ น ๋ฌธ์„œ๊ฐ€ ์–ด๋–ป๊ฒŒ ์ •์˜๋˜๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

  18. ์ฝ˜ํ…์ธ (Content) ํƒญ์„ ์„ ํƒํ•˜๊ณ  ๋งจ ์•„๋ž˜๋กœ ์Šคํฌ๋กคํ•˜์—ฌ ๋Œ€์ƒ ์ธ์Šคํ„ด์Šค์—์„œ ์‹คํ–‰๋  ์‹ค์ œ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

    ์ด ์Šคํฌ๋ฆฝํŠธ๋Š” ์•ž์„œ ์ •์˜ํ•œ CloudWatch ์—์ด์ „ํŠธ ๊ตฌ์„ฑ์„ ๊ฐ€์ ธ์˜ค๋ฏ€๋กœ AWS Systems Manager Parameter Store๋ฅผ ์ฐธ์กฐํ•ฉ๋‹ˆ๋‹ค.

  19. ํ˜„์žฌ ์›น ๋ธŒ๋ผ์šฐ์ € ํƒญ์„ ๋‹ซ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋ฉด ์•ž์„œ ์‚ฌ์šฉํ•˜๋˜ ๋ช…๋ น ์‹คํ–‰(Run a command) ํƒญ์œผ๋กœ ๋Œ์•„๊ฐ‘๋‹ˆ๋‹ค.

    AmazonCloudWatch-ManageAgent ์˜†์˜ ๋ฒ„ํŠผ ์„ ์„ ํƒํ–ˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

  20. ํŒŒ๋ผ๋ฏธํ„ฐ ๋ช…๋ น(Command parameters) ์„น์…˜์—์„œ ๋‹ค์Œ ์ •๋ณด๋ฅผ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

    • ์ž‘์—…(Action): ๊ตฌ์„ฑ(configure)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
    • ๋ชจ๋“œ(Mode): ec2๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
    • ์„ ํƒ์  ๊ตฌ์„ฑ ์†Œ์Šค(Optional Configuration Source): ssm์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
    • ์„ ํƒ์  ๊ตฌ์„ฑ ์œ„์น˜(Optional Configuration Location): Monitor-Web-Server๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
    • ์„ ํƒ์  ์žฌ์‹œ์ž‘(Optional Restart): ์˜ˆ(yes)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

    ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ์ด์ „์— Parameter Store์— ์ €์žฅํ•œ ๊ตฌ์„ฑ์„ ์‚ฌ์šฉํ•˜๋„๋ก ์—์ด์ „ํŠธ๊ฐ€ ๊ตฌ์„ฑ๋ฉ๋‹ˆ๋‹ค.

  21. ๋Œ€์ƒ(Targets) ์„น์…˜์—์„œ ์ˆ˜๋™์œผ๋กœ ์ธ์Šคํ„ด์Šค ์„ ํƒ(Choose instances manually)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  22. ์ธ์Šคํ„ด์Šค(Instances) ์„น์…˜์—์„œ Web Server ์˜†์˜ ํ™•์ธ๋ž€์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  23. ์‹คํ–‰(Run)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  24. ์ „์ฒด ์ƒํƒœ(Overall status)๊ฐ€ ์„ฑ๊ณต(Success)์œผ๋กœ ๋ฐ”๋€” ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆฝ๋‹ˆ๋‹ค. ์ด๋”ฐ๊ธˆ ํŽ˜์ด์ง€ ์ƒ๋‹จ์˜ ์ƒˆ๋กœ๊ณ ์นจ์„ ์„ ํƒํ•˜์—ฌ ์ƒํƒœ๋ฅผ ์—…๋ฐ์ดํŠธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

    ์ด์ œ CloudWatch ์—์ด์ „ํŠธ๊ฐ€ ์ธ์Šคํ„ด์Šค์—์„œ ์‹คํ–‰๋˜์–ด ๋กœ๊ทธ ๋ฐ ์ง€ํ‘œ ๋ฐ์ดํ„ฐ๋ฅผ CloudWatch๋กœ ์ „์†กํ•ฉ๋‹ˆ๋‹ค.

 

๊ณผ์ œ 2: CloudWatch Logs๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋กœ๊ทธ ๋ชจ๋‹ˆํ„ฐ๋ง

CloudWatch Logs๋กœ ๋กœ๊ทธ ๋ฐ์ดํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ ์‹œ์Šคํ…œ์„ ๋ชจ๋‹ˆํ„ฐ๋งํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด CloudWatch Logs๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋กœ๊ทธ์—์„œ ์˜ค๋ฅ˜ ๋ฐœ์ƒ ๊ฐœ์ˆ˜๋ฅผ ์ถ”์ ํ•˜๊ณ  ์˜ค๋ฅ˜ ๋น„์œจ์ด ์ง€์ •๋œ ์ž„๊ณ„๊ฐ’์„ ์ดˆ๊ณผํ•  ๋•Œ๋งˆ๋‹ค ์•Œ๋ฆผ์„ ์ „์†กํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

CloudWatch Logs๋Š” ๊ธฐ์กด ๋กœ๊ทธ ๋ฐ์ดํ„ฐ๋ฅผ ๋ชจ๋‹ˆํ„ฐ๋ง์— ์‚ฌ์šฉํ•˜๋ฏ€๋กœ ์ฝ”๋“œ๋ฅผ ๋ณ€๊ฒฝํ•  ํ•„์š”๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ํŠน์ • ๋ฆฌํ„ฐ๋Ÿด ๋ฌธ์ž(์˜ˆ: โ€˜NullReferenceExceptionโ€™)์— ๋Œ€ํ•œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋กœ๊ทธ๋ฅผ ๋ชจ๋‹ˆํ„ฐ๋งํ•˜๊ฑฐ๋‚˜ ๋กœ๊ทธ ๋ฐ์ดํ„ฐ์˜ ํŠน์ • ์œ„์น˜(์˜ˆ: ์›น ์„œ๋ฒ„ ์•ก์„ธ์Šค ๋กœ๊ทธ์˜ 404 ์ƒํƒœ ์ฝ”๋“œ)์—์„œ ๋ฆฌํ„ฐ๋Ÿด ๋ฌธ์ž์˜ ์ถœํ˜„ ํšŸ์ˆ˜๋ฅผ ๊ณ„์‚ฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์›ํ•˜๋Š” ์šฉ์–ด๊ฐ€ ๊ฒ€์ƒ‰๋˜๋ฉด CloudWatch Logs๋Š” ์ง€์ •๋œ CloudWatch ์ง€ํ‘œ์— ๋ฐ์ดํ„ฐ๋ฅผ ๋ณด๊ณ ํ•ฉ๋‹ˆ๋‹ค. ๋กœ๊ทธ ๋ฐ์ดํ„ฐ๋Š” ์ „์†ก ์‹œ๋Š” ๋ฌผ๋ก  ์ €์žฅ ์‹œ์—๋„ ์•”ํ˜ธํ™”๋ฉ๋‹ˆ๋‹ค.

์ด ๊ณผ์ œ์—์„œ๋Š” ์›น ์„œ๋ฒ„์—์„œ ๋กœ๊ทธ ๋ฐ์ดํ„ฐ๋ฅผ ์ƒ์„ฑํ•œ ๋‹ค์Œ CloudWatch Logs๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋กœ๊ทธ๋ฅผ ๋ชจ๋‹ˆํ„ฐ๋งํ•ฉ๋‹ˆ๋‹ค.

CloudWatch Logs

์›น ์„œ๋ฒ„๊ฐ€ ์ƒ์„ฑํ•˜๋Š” ๋กœ๊ทธ ๋ฐ์ดํ„ฐ ์œ ํ˜•์€ ๋‹ค์Œ ๋‘ ๊ฐ€์ง€์ž…๋‹ˆ๋‹ค.

๋จผ์ € ์›น ์„œ๋ฒ„์— ์•ก์„ธ์Šคํ•ฉ๋‹ˆ๋‹ค.

  1. ์ง€์นจ ์œ„์— ์žˆ๋Š” ์„ธ๋ถ€ ์ •๋ณด(Details) ๋“œ๋กญ๋‹ค์šด ๋ฉ”๋‰ด๋ฅผ ์„ ํƒํ•œ ํ›„ ๋ณด๊ธฐ(Show)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

    WebServerIP ๊ฐ’์„ ๋ณต์‚ฌํ•ฉ๋‹ˆ๋‹ค.

  2. ์ƒˆ ์›น ๋ธŒ๋ผ์šฐ์ € ํƒญ์„ ์—ด๊ณ  ๋ณต์‚ฌํ•œ WebServerIP๋ฅผ ๋ถ™์—ฌ๋„ฃ์€ ๋‹ค์Œ Enter ํ‚ค๋ฅผ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.

    ์›น ์„œ๋ฒ„ ํ…Œ์ŠคํŠธ ํŽ˜์ด์ง€(Test Page)๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

    ์ด์ œ ์กด์žฌํ•˜์ง€ ์•Š๋Š” ํŽ˜์ด์ง€์— ์•ก์„ธ์Šค๋ฅผ ์‹œ๋„ํ•˜์—ฌ ๋กœ๊ทธ ๋ฐ์ดํ„ฐ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

  3. ๋ธŒ๋ผ์šฐ์ € URL์— /start๋ฅผ ์ถ”๊ฐ€ํ•˜๊ณ  Enter ํ‚ค๋ฅผ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.

    ํŽ˜์ด์ง€๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์œผ๋ฏ€๋กœ ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ๊ทธ๋ž˜๋„ ๊ดœ์ฐฎ์Šต๋‹ˆ๋‹ค. CloudWatch Logs๋กœ ์ „์†ก๋˜๋Š” ์•ก์„ธ์Šค ๋กœ๊ทธ์— ๋ฐ์ดํ„ฐ๊ฐ€ ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.

  4. ์›น ๋ธŒ๋ผ์šฐ์ €์—์„œ ์ด ํƒญ์„ ๊ณ„์† ์—ด์–ด ๋‘๊ณ  AWS Management Console์ด ํ‘œ์‹œ๋œ ๋ธŒ๋ผ์šฐ์ € ํƒญ์œผ๋กœ ๋Œ์•„๊ฐ‘๋‹ˆ๋‹ค.

  5. ์„œ๋น„์Šค(Services) ๋ฉ”๋‰ด์—์„œ CloudWatch๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  6. ์™ผ์ชฝ ํƒ์ƒ‰ ์ฐฝ์—์„œ ๋กœ๊ทธ ๊ทธ๋ฃน(Log groups)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

    HttpAccessLog์™€ HttpErrorLog๋ผ๋Š” 2๊ฐœ์˜ ๋กœ๊ทธ๊ฐ€ ๋‚˜์—ด๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

    ์ด๋Ÿฌํ•œ ๋กœ๊ทธ๊ฐ€ ๋‚˜์—ด๋˜์ง€ ์•Š์œผ๋ฉด ์ž ์‹œ ๊ธฐ๋‹ค๋ฆฐ ๋‹ค์Œ ์ƒˆ๋กœ ๊ณ ์นจ(Refresh)์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  7. HttpAccessLog๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค(์ด๋ฆ„ ์ž์ฒด๋ฅผ ์„ ํƒ).

  8. ๋กœ๊ทธ ์ŠคํŠธ๋ฆผ(Logs streams) ์„น์…˜์˜ ํ‘œ์—์„œ ๋กœ๊ทธ ์ŠคํŠธ๋ฆผ(Log stream)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค(์ด๋ฆ„ ์ž์ฒด๋ฅผ ์„ ํƒ). ๋กœ๊ทธ๊ฐ€ ์—ฐ๊ฒฐ๋œ EC2 ์ธ์Šคํ„ด์Šค์™€ ID๊ฐ€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

    ์›น ์„œ๋ฒ„๋กœ ์ „์†ก๋œ GET ์š”์ฒญ์œผ๋กœ ๊ตฌ์„ฑ๋œ ๋กœ๊ทธ ๋ฐ์ดํ„ฐ๊ฐ€ ํ‘œ์‹œ๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์•„์ด์ฝ˜์„ ํด๋ฆญํ•˜์—ฌ ํ–‰์„ ํ™•์žฅํ•˜๋ฉด ์ถ”๊ฐ€ ์ •๋ณด๋ฅผ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋กœ๊ทธ ๋ฐ์ดํ„ฐ์—๋Š” ์š”์ฒญ์„ ํ•œ ์ปดํ“จํ„ฐ์™€ ๋ธŒ๋ผ์šฐ์ €์— ๋Œ€ํ•œ ์ •๋ณด๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

    /start ์š”์ฒญ๊ณผ 404 ์ฝ”๋“œ๊ฐ€ ์žˆ๋Š” ํ–‰์ด ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ์ด ์ฝ”๋“œ๋Š” ํŽ˜์ด์ง€๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์—ˆ๋‹ค๋Š” ๋œป์ž…๋‹ˆ๋‹ค.

    ์ด๋ฅผ ํ†ตํ•ด EC2 ์ธ์Šคํ„ด์Šค ๋˜๋Š” ์˜จํ”„๋ ˆ๋ฏธ์Šค ์„œ๋ฒ„์—์„œ CloudWatch Logs๋กœ ๋กœ๊ทธ ํŒŒ์ผ์ด ์ž๋™์œผ๋กœ ์ „์†ก๋˜๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ฐœ๋ณ„ ์„œ๋ฒ„์— ๋กœ๊ทธ์ธํ•˜์ง€ ์•Š๊ณ  ๋กœ๊ทธ ๋ฐ์ดํ„ฐ์— ์•ก์„ธ์Šคํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์›น ์„œ๋ฒ„์˜ Auto Scaling ํ”Œ๋ฆฟ๊ณผ ๊ฐ™์€ ์—ฌ๋Ÿฌ ์„œ๋ฒ„์—์„œ ๋กœ๊ทธ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

 

CloudWatch Logs์—์„œ ์ง€ํ‘œ ํ•„ํ„ฐ ์ƒ์„ฑ

์ด์ œ ๋กœ๊ทธ ํŒŒ์ผ์—์„œ 404 ์˜ค๋ฅ˜๋ฅผ ์‹๋ณ„ํ•˜๋„๋ก ํ•„ํ„ฐ๋ฅผ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค. ์ด ์˜ค๋ฅ˜๋Š” ์ผ๋ฐ˜์ ์œผ๋กœ ์›น ์„œ๋ฒ„์—์„œ ์ž˜๋ชป๋œ ๋งํฌ๊ฐ€ ์ƒ์„ฑ๋˜์–ด ์‚ฌ์šฉ์ž๊ฐ€ ํด๋ฆญํ•˜๊ณ  ์žˆ๋‹ค๋Š” ์˜๋ฏธ์ž…๋‹ˆ๋‹ค.

  1. ์™ผ์ชฝ ํƒ์ƒ‰ ์ฐฝ์—์„œ ๋กœ๊ทธ ๊ทธ๋ฃน(Log groups)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  2. HttpAccessLog ์˜†์˜ ํ™•์ธ๋ž€์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  3. ์ž‘์—…(Actions) ๋“œ๋กญ๋‹ค์šด ๋ฉ”๋‰ด์—์„œ ์ง€ํ‘œ ํ•„ํ„ฐ ์ƒ์„ฑ(Create metric filter)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

    ํ•„ํ„ฐ ํŒจํ„ด์€ ๋กœ๊ทธ ํŒŒ์ผ์˜ ํ•„๋“œ๋ฅผ ์ •์˜ํ•˜๊ณ  ํŠน์ • ๊ฐ’์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ํ•„ํ„ฐ๋งํ•ฉ๋‹ˆ๋‹ค.

  4. ํ•„ํ„ฐ ํŒจํ„ฐ(Filter pattern) ์ƒ์ž์— ๋‹ค์Œ ํ–‰์„ ๋ถ™์—ฌ๋„ฃ์Šต๋‹ˆ๋‹ค.

    ์ด ํ–‰์€ CloudWatch Logs์— ๋กœ๊ทธ ๋ฐ์ดํ„ฐ์˜ ํ•„๋“œ๋ฅผ ์–ด๋–ป๊ฒŒ ํ•ด์„ํ•ด์•ผ ํ•˜๋Š”์ง€ ์•Œ๋ ค์ฃผ๊ณ , ํŽ˜์ด์ง€๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์—ˆ์Œ์„ ๋‚˜ํƒ€๋‚ด๋Š” status_code=404๊ฐ€ ์žˆ๋Š” ํ–‰๋งŒ ์ฐพ๋„๋ก ํ•„ํ„ฐ๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค.

  5. ํŒจํ„ด ํ…Œ์ŠคํŠธ(Test pattern) ์„น์…˜์—์„œ Select log data to test ๋“œ๋กญ๋‹ค์šด ๋ฉ”๋‰ด๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ EC2 ์ธ์Šคํ„ด์Šค ID๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. ID๋Š” i-0f07ab62aae4xxxx9์™€ ๋น„์Šทํ•œ ํ˜•์‹์ž…๋‹ˆ๋‹ค.

  6. ํŒจํ„ด ํ…Œ์ŠคํŠธ(Test pattern)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  7. ๊ฒฐ๊ณผ(Results) ์„น์…˜์—์„œ ํ…Œ์ŠคํŠธ ๊ฒฐ๊ณผ ๋ณด๊ธฐ(Show test results)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

    404 $status_code๊ฐ€ ํฌํ•จ๋œ ๊ฒฐ๊ณผ๊ฐ€ ํ•˜๋‚˜ ์ด์ƒ ํ‘œ์‹œ๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” ์š”์ฒญ๋œ ํŽ˜์ด์ง€๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์—ˆ๋‹ค๋Š” ์˜๋ฏธ์ž…๋‹ˆ๋‹ค.

  8. ๋‹ค์Œ(Next)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  9. ํ•„ํ„ฐ ์ด๋ฆ„ ์ƒ์„ฑ(Create filter name) ์„น์…˜์˜ ํ•„ํ„ฐ ์ด๋ฆ„(Filter name) ์ƒ์ž์— 404Errors๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

  10. ์ง€ํ‘œ ์„ธ๋ถ€ ์ •๋ณด(Metric details) ์„น์…˜์—์„œ ๋‹ค์Œ ์ •๋ณด๋ฅผ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

    • ์ง€ํ‘œ ๋„ค์ž„์ŠคํŽ˜์ด์Šค(Metric namespace): LogMetrics๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
    • ์ง€ํ‘œ ์ด๋ฆ„(Metric name): 404Errors๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
    • ์ง€ํ‘œ ๊ฐ’(Metric value): 1์„ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
  11. ๋‹ค์Œ(Next)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  12. ๊ฒ€ํ†  ๋ฐ ์ƒ์„ฑ(Review and create) ํŽ˜์ด์ง€์—์„œ ์ง€ํ‘œ ํ•„ํ„ฐ ์ƒ์„ฑ(Create metric filter)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

    ์ด์ œ ์ด ์ง€ํ‘œ ํ•„ํ„ฐ๋ฅผ ๊ฒฝ๋ณด์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

ํ•„ํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ฒฝ๋ณด ์ƒ์„ฑ

์ด์ œ 404 Not Found ์˜ค๋ฅ˜๊ฐ€ ๋„ˆ๋ฌด ๋งŽ์ด ์ˆ˜์‹ ๋  ๋•Œ ์•Œ๋ฆผ์„ ์ „์†กํ•˜๋„๋ก ๊ฒฝ๋ณด๋ฅผ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

  1. 404Errors ํŒจ๋„์—์„œ ์˜ค๋ฅธ์ชฝ ์ƒ๋‹จ ๋ชจ์„œ๋ฆฌ์— ์žˆ๋Š” ํ™•์ธ๋ž€์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  2. ์ง€ํ‘œ ํ•„ํ„ฐ(Metric filters) ์„น์…˜์—์„œ ๊ฒฝ๋ณด ์ƒ์„ฑ(Create alarm)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  3. ๋‹ค์Œ ์„ค์ •์„ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

    • ์ง€ํ‘œ(Metrics) ์„น์…˜์—์„œ ๊ธฐ๊ฐ„(Period)์œผ๋กœ 1 ๋ถ„(minute)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

    • ์กฐ๊ฑด(Conditions) ์„น์…˜์—์„œ ๋‹ค์Œ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

      • ๋‹ค์Œ ๊ฒฝ์šฐ ํ•ญ์ƒ: 404Errors(Whenever 404Errors is): Greater/Equal์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
      • than: 5๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
    • ๋‹ค์Œ(Next)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  4. ์•Œ๋ฆผ(Notification) ์„น์…˜์—์„œ ๋‹ค์Œ์„ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

    • SNS ์ฃผ์ œ ์„ ํƒ(Select an SNS Topic): ์ƒˆ ์ฃผ์ œ ์ƒ์„ฑ(Create new topic)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
    • ์•Œ๋ฆผ์„ ๋ฐ›์„ ์ด๋ฉ”์ผ ์—”๋“œํฌ์ธํŠธ(Email endpoints that will receive the notification): ๊ฐ•์˜์‹ค์—์„œ ์•ก์„ธ์Šคํ•  ์ˆ˜ ์žˆ๋Š” ์ด๋ฉ”์ผ ์ฃผ์†Œ๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
    • ์ฃผ์ œ ์ƒ์„ฑ(Create topic)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
    • ๋‹ค์Œ(Next)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  5. ์ด๋ฆ„ ๋ฐ ์„ค๋ช…(Name and description)์˜ ๊ฒฝ์šฐ ๋‹ค์Œ ์„ค์ •์„ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

    • ๊ฒฝ๋ณด ์ด๋ฆ„(Alarm name): 404 Errors๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
    • ๊ฒฝ๋ณด ์„ค๋ช…(Alarm description): Alert when too many 404s detected on an instance๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
    • ๋‹ค์Œ(Next)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  6. ๊ฒฝ๋ณด ์ƒ์„ฑ(Create alarm)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  7. ์ด๋ฉ”์ผ๋กœ ๊ฐ€์„œ ํ™•์ธ ๋ฉ”์‹œ์ง€๋ฅผ ์ฐพ๊ณ  ๊ตฌ๋… ํ™•์ธ(Confirm subscription) ๋งํฌ๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  8. AWS Management Console๋กœ ๋Œ์•„๊ฐ‘๋‹ˆ๋‹ค.

  9. ์™ผ์ชฝ ํƒ์ƒ‰ ์ฐฝ์—์„œ CloudWatch๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค(๋งจ ์œ„).

    ๊ฒฝ๋ณด๊ฐ€ ์ฃผํ™ฉ์ƒ‰์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” ๊ฒฝ๋ณด๋ฅผ ํŠธ๋ฆฌ๊ฑฐํ•  ๋ฐ์ดํ„ฐ๊ฐ€ ์ถฉ๋ถ„ํ•˜์ง€ ์•Š๋‹ค๋Š” ์˜๋ฏธ์ž…๋‹ˆ๋‹ค. ์ด ๊ฒฝ๋ณด๋Š” ์ง€๋‚œ 1๋ถ„ ๋™์•ˆ ๋ฐ์ดํ„ฐ๊ฐ€ ์ˆ˜์‹ ๋˜์ง€ ์•Š์•˜๊ธฐ ๋•Œ๋ฌธ์— ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

    ์ด์ œ ์›น ์„œ๋ฒ„์—์„œ ์•ก์„ธ์Šคํ•˜์—ฌ ๋กœ๊ทธ ๋ฐ์ดํ„ฐ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

  10. ์›น ์„œ๋ฒ„๊ฐ€ ์—ด๋ฆฐ ์›น ๋ธŒ๋ผ์šฐ์ € ํƒญ์œผ๋กœ ๋Œ์•„๊ฐ‘๋‹ˆ๋‹ค.

์›น ๋ธŒ๋ผ์šฐ์ € ํƒญ์ด ๋” ์ด์ƒ ์—ด๋ ค ์žˆ์ง€ ์•Š๋‹ค๋ฉด ์ง€์นจ ์œ„์— ์žˆ๋Š” ์„ธ๋ถ€ ์ •๋ณด(Details) ๋“œ๋กญ๋‹ค์šด ๋ฉ”๋‰ด๋ฅผ ์„ ํƒํ•˜๊ณ  ๋ณด๊ธฐ(Show)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

WebServerIP ๊ฐ’์„ ๋ณต์‚ฌํ•˜์—ฌ ์ƒˆ ์›น ๋ธŒ๋ผ์šฐ์ € ํƒญ์— ๋ถ™์—ฌ๋„ฃ์Šต๋‹ˆ๋‹ค.

  1. IP ์ฃผ์†Œ ๋’ค์— ํŽ˜์ด์ง€ ์ด๋ฆ„์„ ์ถ”๊ฐ€ํ•˜์—ฌ ์กด์žฌํ•˜์ง€ ์•Š๋Š” ํŽ˜์ด์ง€๋กœ ์ด๋™์„ ์‹œ๋„ํ•ฉ๋‹ˆ๋‹ค. ์ด ๋‹จ๊ณ„๋ฅผ 5๋ฒˆ ์ด์ƒ ๋ฐ˜๋ณตํ•ฉ๋‹ˆ๋‹ค.

    ์˜ˆ๋ฅผ ๋“ค๋ฉด http://192.0.2.0/start2๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

    ์š”์ฒญ๋งˆ๋‹ค ๋ณ„๋„์˜ ๋กœ๊ทธ ํ•ญ๋ชฉ์ด ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.

  2. ๊ฒฝ๋ณด๊ฐ€ ํŠธ๋ฆฌ๊ฑฐ๋  ๋•Œ๊นŒ์ง€ 1~2๋ถ„ ๊ธฐ๋‹ค๋ฆฝ๋‹ˆ๋‹ค. AWS Management Console์—์„œ ์ด๋”ฐ๊ธˆ ์ƒˆ๋กœ ๊ณ ์นจ(Refresh)์„ ์„ ํƒํ•˜์—ฌ ์ƒํƒœ๋ฅผ ์—…๋ฐ์ดํŠธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

    CloudWatch ํŽ˜์ด์ง€์— ํ‘œ์‹œ๋œ ๊ทธ๋ž˜ํ”„๊ฐ€ ๋นจ๊ฐ„์ƒ‰์œผ๋กœ ๋ฐ”๋€Œ์–ด ๊ฒฝ๋ณด ์ƒํƒœ์ž„์„ ๋‚˜ํƒ€๋‚ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

  3. ์ด๋ฉ”์ผ์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. ์ œ๋ชฉ์ด ALARM: "404 Errors"์ธ ์ด๋ฉ”์ผ์ด ์žˆ์„ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

    ์ด ๊ณผ์ œ๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋กœ๊ทธ ๋ฐ์ดํ„ฐ๋กœ๋ถ€ํ„ฐ ๊ฒฝ๋ณด๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ๋กœ๊ทธ ํŒŒ์ผ์—์„œ ๋น„์ •์ƒ์  ๋™์ž‘์ด ๊ฐ์ง€๋  ๋•Œ ๊ฒฝ๋ณด๋ฅผ ์ˆ˜์‹ ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค. CloudWatch Logs ์•ˆ์—์„œ ๋กœ๊ทธ ํŒŒ์ผ์— ์•ก์„ธ์Šคํ•˜์—ฌ ์ถ”๊ฐ€ ๋ถ„์„์„ ํ†ตํ•ด ๊ฒฝ๋ณด๋ฅผ ํŠธ๋ฆฌ๊ฑฐํ•œ ํ™œ๋™์„ ์ง„๋‹จํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

๊ณผ์ œ 3: CloudWatch๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ธ์Šคํ„ด์Šค ์ง€ํ‘œ ๋ชจ๋‹ˆํ„ฐ๋ง

์ง€ํ‘œ๋Š” ์‹œ์Šคํ…œ ์„ฑ๋Šฅ์— ๋Œ€ํ•œ ๋ฐ์ดํ„ฐ์ž…๋‹ˆ๋‹ค. CloudWatch๋Š” AWS ์„œ๋น„์Šค์— ๋Œ€ํ•œ ์ง€ํ‘œ๋ฅผ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. CloudWatch ์—์ด์ „ํŠธ๋ฅผ ํ†ตํ•ด ๋˜๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ์ง์ ‘ ์‚ฌ์šฉ์ž์˜ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ง€ํ‘œ๋ฅผ ๊ฒŒ์‹œํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค. CloudWatch๋Š” ๊ฒ€์ƒ‰, ๊ทธ๋ž˜ํ”„, ๋Œ€์‹œ๋ณด๋“œ, ๊ฒฝ๋ณด ์ง€ํ‘œ๋ฅผ ์ œ๊ณตํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด๋ฒˆ ๊ณผ์ œ์—์„œ๋Š” CloudWatch๊ฐ€ ์ œ๊ณตํ•˜๋Š” ์ง€ํ‘œ๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

CloudWatch ์ง€ํ‘œ

  1. ์„œ๋น„์Šค(Services) ๋ฉ”๋‰ด์—์„œ EC2๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  2. ์™ผ์ชฝ ํƒ์ƒ‰ ์ฐฝ์—์„œ ์ธ์Šคํ„ด์Šค(Instances)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  3. Web Server ์˜†์— ์žˆ๋Š” ํ™•์ธ๋ž€์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  4. ํŽ˜์ด์ง€ ํ•˜๋‹จ์—์„œ ๋ชจํ‹ฐํ„ฐ๋ง(Monitoring) ํƒญ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

    ์ œ๊ณต๋œ ์ง€ํ‘œ๋ฅผ ์‚ดํŽด๋ด…๋‹ˆ๋‹ค. ์ฐจํŠธ๋ฅผ ์„ ํƒํ•˜์—ฌ ๋” ๋งŽ์€ ์ •๋ณด๋ฅผ ํ‘œ์‹œํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

    CloudWatch๋Š” ์ธ์Šคํ„ด์Šค์˜ CPU, ๋””์Šคํฌ, ๋„คํŠธ์›Œํฌ ์‚ฌ์šฉ๋Ÿ‰์— ๋Œ€ํ•œ ์ง€ํ‘œ๋ฅผ ์บก์ฒ˜ํ•ฉ๋‹ˆ๋‹ค. ์ด ์ง€ํ‘œ๋Š” ์™ธ๋ถ€์—์„œ ์ธ์Šคํ„ด์Šค๋ฅผ ๊ฐ€์ƒ ๋จธ์‹ ์œผ๋กœ์„œ ์ธก์ •ํ•˜์ง€๋งŒ, ์—ฌ์œ  ๋ฉ”๋ชจ๋ฆฌ ๋˜๋Š” ์—ฌ์œ  ๋””์Šคํฌ ๊ณต๊ฐ„๊ณผ ๊ฐ™์€ ์ธ์Šคํ„ด์Šค ๋‚ด๋ถ€ ์ƒํ™ฉ์— ๋Œ€ํ•œ ์ •๋ณด๋Š” ์ œ๊ณตํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋‹คํ–‰ํžˆ CloudWatch ์—์ด์ „ํŠธ๊ฐ€ ์บก์ฒ˜ํ•˜๋Š” ์ •๋ณด๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ธ์Šคํ„ด์Šค ๋‚ด๋ถ€ ์ƒํ™ฉ์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. CloudWatch ์—์ด์ „ํŠธ๋Š” ์ง€ํ‘œ๋ฅผ ์ˆ˜์ง‘ํ•˜๊ธฐ ์œ„ํ•ด ์ธ์Šคํ„ด์Šค ๋‚ด๋ถ€์—์„œ ์‹คํ–‰๋˜๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

  5. ์„œ๋น„์Šค(Services) ๋ฉ”๋‰ด์—์„œ CloudWatch๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  6. ์™ผ์ชฝ ํƒ์ƒ‰ ์ฐฝ์—์„œ ์ง€ํ‘œ(Metrics)์•„๋ž˜์˜ All metrics๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

    ํŽ˜์ด์ง€ ํ•˜๋‹จ์— CloudWatch๊ฐ€ ์ˆ˜์ง‘ํ•œ ์—ฌ๋Ÿฌ ์ง€ํ‘œ๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ์ง€ํ‘œ ์ค‘ ์ผ๋ถ€๋Š” AWS๊ฐ€ ์ž๋™์œผ๋กœ ์ƒ์„ฑํ•˜๋ฉฐ, ์ผ๋ถ€๋Š” CloudWatch๊ฐ€ ์ˆ˜์ง‘ํ•ฉ๋‹ˆ๋‹ค.

  7. CWAgent๋ฅผ ์„ ํƒํ•˜๊ณ  device, fstype, host, path๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

    CloudWatch ์—์ด์ „ํŠธ๊ฐ€ ์บก์ฒ˜ํ•˜๊ณ  ์žˆ๋Š” ๋””์Šคํฌ ๊ณต๊ฐ„ ์ง€ํ‘œ๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

  8. ํ‘œ ์œ„์— ์žˆ๋Š” ๋ชจ๋“  ์ง€ํ‘œ(All metrics) ํƒญ[๋ชจ๋‘ > CWAgent > device, fstype, host, path(All > CWAgent > device, fstype, host, path)๋ผ๊ณ  ๋‚˜์™€ ์žˆ๋Š” ํ–‰]์—์„œ CWAgent๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  9. host๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

    ์‹œ์Šคํ…œ ๋ฉ”๋ชจ๋ฆฌ์™€ ๊ด€๋ จ๋œ ์ง€ํ‘œ๋ฅผ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  10. ํ‘œ ์œ„์— ์žˆ๋Š” ๋ชจ๋“  ์ง€ํ‘œ(All metrics) ํƒญ[๋ชจ๋‘ > CWAgent > device, fstype, host, path(All > CWAgent > device, fstype, host, path)๋ผ๊ณ  ๋‚˜์™€ ์žˆ๋Š” ํ–‰]์—์„œ ๋ชจ๋‘(All)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

    CloudWatch๊ฐ€ ์บก์ฒ˜ ์ค‘์ธ ๋‹ค๋ฅธ ์ง€ํ‘œ๋„ ์‚ดํŽด๋ด…๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ์ง€ํ‘œ๋Š” AWS ๊ณ„์ •์—์„œ ์‚ฌ์šฉ๋˜๋Š” AWS ์„œ๋น„์Šค๋กœ๋ถ€ํ„ฐ ์ „์†ก๋œ ์ž๋™ ์ƒ์„ฑ ์ง€ํ‘œ์ž…๋‹ˆ๋‹ค.

    ๊ทธ๋ž˜ํ”„์— ํ‘œ์‹œํ•  ์ง€ํ‘œ๋ฅผ ์„ ํƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

๊ณผ์ œ 4: ์‹ค์‹œ๊ฐ„ ์•Œ๋ฆผ ์ƒ์„ฑ

CloudWatch Events๋Š” AWS ๋ฆฌ์†Œ์Šค์˜ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ์„ค๋ช…ํ•˜๋Š” ์‹œ์Šคํ…œ ์ด๋ฒคํŠธ์˜ ์ŠคํŠธ๋ฆผ์„ ๊ฑฐ์˜ ์‹ค์‹œ๊ฐ„์œผ๋กœ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ๊ฐ„๋‹จํ•œ ๊ทœ์น™์„ ์‚ฌ์šฉํ•˜์—ฌ ์ผ์น˜ํ•˜๋Š” ์ด๋ฒคํŠธ๋ฅผ ์ฐพ๊ณ  ์ด๋Ÿฌํ•œ ์ด๋ฒคํŠธ๋ฅผ ํ•˜๋‚˜ ์ด์ƒ์˜ ๋Œ€์ƒ ํ•จ์ˆ˜ ๋˜๋Š” ์ŠคํŠธ๋ฆผ์œผ๋กœ ๋ผ์šฐํŒ…ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. CloudWatch Events๋Š” ์ž‘๋™์ƒ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ด ๋ฐœ์ƒํ•˜๋ฉด ํ•ญ์ƒ ์ด๋ฅผ ๊ฐ์ง€ํ•ฉ๋‹ˆ๋‹ค.

CloudWatch Events๋Š” ํ™˜๊ฒฝ์— ์‘๋‹ตํ•˜๊ธฐ ์œ„ํ•œ ๋ฉ”์‹œ์ง€๋ฅผ ์ „์†กํ•˜๊ณ , ํ•จ์ˆ˜๋ฅผ ํ™œ์„ฑํ™”ํ•˜๊ณ , ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ์ ์šฉํ•˜๊ณ , ์ƒํƒœ ์ •๋ณด๋ฅผ ์บก์ฒ˜ํ•˜๋Š” ๋“ฑ ์ด๋Ÿฌํ•œ ์ž‘๋™์ƒ ๋ณ€๊ฒฝ์— ์‘๋‹ตํ•˜๊ณ  ํ•„์š”์— ๋”ฐ๋ผ ๊ต์ • ์กฐ์น˜๋ฅผ ์ทจํ•ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ CloudWatch Events๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ cron ๋˜๋Š” rate ํ‘œํ˜„์‹์„ ํ†ตํ•ด ํŠน์ • ์‹œ๊ฐ„์— ์Šค์Šค๋กœ ํŠธ๋ฆฌ๊ฑฐ๋˜๋Š” ์ž๋™ ์ž‘์—…์„ ์˜ˆ์•ฝํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ๊ณผ์ œ์—์„œ๋Š” ์ธ์Šคํ„ด์Šค๊ฐ€ ์ค‘์ง€ ๋˜๋Š” ์ข…๋ฃŒ๋  ๋•Œ ์‚ฌ์šฉ์ž์—๊ฒŒ ์•Œ๋ฆฌ๋Š” ์‹ค์‹œ๊ฐ„ ์•Œ๋ฆผ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

CloudWatch Events

  1. ์™ผ์ชฝ ํƒ์ƒ‰ ์ฐฝ์—์„œ Events ์•„๋ž˜์˜ ๊ทœ์น™(Rules)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  2. ๊ทœ์น™ ์ƒ์„ฑ(Create rule)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  3. Define rule detail ํŽ˜์ด์ง€์—์„œ Name์— Instance_Stopped_Terminated์„ ์ž…๋ ฅ ํ›„ Next๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.
    Build event pattern ํŽ˜์ด์ง€์—์„œ Event pattern ์„น์…˜์„ ์ฐพ์Šต๋‹ˆ๋‹ค. AWS service ๋“œ๋กญ๋‹ค์šด ๋ฉ”๋‰ด์—์„œ EC2๋ฅผ ์„ ํƒํ•˜๊ณ  Event type ๋“œ๋กญ๋‹ค์šด ๋ฉ”๋‰ด์—์„œ EC2 Instance State-change Notification์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. Specific state(s)์—์„œ ์ค‘์ง€๋จ(stopped) ๋ฐ ์ข…๋ฃŒ๋จ(terminated)๋ฅผ ์„ ํƒํ•˜๊ณ  Next๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.
  1. Select target(s)์˜ Target 1์—์„œ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์„ค์ •ํ•˜๊ณ  Next๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  1. Confgiure tags - optional์—์„œ Next ์„ ํƒ ํ›„ Create rule์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

 

์‹ค์‹œ๊ฐ„ ์•Œ๋ฆผ ๊ตฌ์„ฑ

Amazon Simple Notification Service(Amazon SNS)๊ฐ€ ํœด๋Œ€์ „ํ™”(SMS) ๋˜๋Š” ์ด๋ฉ”์ผ ์ฃผ์†Œ๋กœ ์‹ค์‹œ๊ฐ„ ์•Œ๋ฆผ์„ ์ „์†กํ•˜๋„๋ก ๊ตฌ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. SMS ๋ฉ”์‹œ์ง•์„ ๊ตฌ์„ฑํ•˜๋ ค๋ฉด AWS Support๋ฅผ ํ†ตํ•ด ํ‹ฐ์ผ“์„ ์—ด์–ด์•ผ ํ•˜๊ณ  ๊ณ„์ • ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ๊ตฌ์„ฑํ•  ์‹œ๊ฐ„๋„ ์žˆ์–ด์•ผ ํ•˜๋ฏ€๋กœ ์•ž์„œ ์ด ์—ฐ์Šต์„ ์™„๋ฃŒํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉํ–ˆ๋˜ ์ด๋ฉ”์ผ ์ฃผ์†Œ๋ฅผ ๋˜‘๊ฐ™์ด ์‚ฌ์šฉํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

Amazon Simple Notification Service ๊ฐœ๋ฐœ์ž ๊ฐ€์ด๋“œ์—์„œ SNS๋กœ SMS ๋ฉ”์‹œ์ง•์„ ๊ตฌ์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์ž์„ธํžˆ ์•Œ์•„๋ณด์‹ญ์‹œ์˜ค.

  1. ์„œ๋น„์Šค(Services) ๋ฉ”๋‰ด์—์„œ ๊ฐ„๋‹จ ์•Œ๋ฆผ ์„œ๋น„์Šค(Simple Notification Service)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  2. ์™ผ์ชฝ ํƒ์ƒ‰ ์ฐฝ์—์„œ ์ฃผ์ œ(Topics)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  3. ์ด๋ฆ„(Name) ์—ด์—์„œ ๋งํฌ๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

์ด๋ฉ”์ผ ์ฃผ์†Œ์— ์—ฐ๊ฒฐ๋œ ๋‹จ์ผ ๊ตฌ๋… 1๊ฐœ๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ์ด๋Š” ๊ณผ์ œ 2์—์„œ ๊ตฌ์„ฑํ•œ ์ฃผ์ œ์ž…๋‹ˆ๋‹ค.

  1. ์„œ๋น„์Šค(Services) ๋ฉ”๋‰ด์—์„œ EC2๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  2. ์™ผ์ชฝ ํƒ์ƒ‰ ์ฐฝ์—์„œ ์ธ์Šคํ„ด์Šค(Instances)๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  3. Web Server ์˜†์— ์žˆ๋Š” ํ™•์ธ๋ž€์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  4. ์ธ์Šคํ„ด์Šค ์ƒํƒœ(Instance state) ๋ฅผ ์„ ํƒํ•˜๊ณ  ์ธ์Šคํ„ด์Šค ์ค‘์ง€(Stop instance) ๋ฐ ์ค‘์ง€(Stop)์„ ์ฐจ๋ก€๋กœ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

์›น ์„œ๋ฒ„ ์ธ์Šคํ„ด์Šค๊ฐ€ ์ค‘์ง€ ์ค‘(Stopping) ์ƒํƒœ๊ฐ€ ๋ฉ๋‹ˆ๋‹ค. 1๋ถ„ ํ›„ ์ค‘์ง€ ๋จ(Stopped) ์ƒํƒœ๊ฐ€ ๋ฉ๋‹ˆ๋‹ค.

์ค‘๋‹จ๋œ ์ธ์Šคํ„ด์Šค์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์„ค๋ช…ํ•˜๋Š” ์ด๋ฉ”์ผ์„ ๋ฐ›๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

์ด ๋ฉ”์‹œ์ง€๋Š” JSON ํ˜•์‹์ž…๋‹ˆ๋‹ค. ๋ณด๋‹ค ์‰ฝ๊ฒŒ ์ฝ์„ ์ˆ˜ ์žˆ๋Š” ๋ฉ”์‹œ์ง€๋ฅผ ์ˆ˜์‹ ํ•˜๊ธฐ ์œ„ํ•ด CloudWatch Events์— ์˜ํ•ด ํŠธ๋ฆฌ๊ฑฐ๋˜๋Š” AWS Lambda ํ•จ์ˆ˜๋ฅผ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋ฉด Lambda ํ•จ์ˆ˜๊ฐ€ ๋ณด๋‹ค ์ฝ๊ธฐ ์‰ฌ์šด ๋ฉ”์‹œ์ง€ ํ˜•์‹์„ ์ง€์ •ํ•ด Amazon SNS๋ฅผ ํ†ตํ•ด ์ „์†กํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ๊ณผ์ œ๋Š” ์ธํ”„๋ผ ๋ณ€๊ฒฝ ์‹œ ์‹ค์‹œ๊ฐ„ ์•Œ๋ฆผ์„ ์ˆ˜์‹ ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

 

๊ณผ์ œ 5: ์ธํ”„๋ผ ๊ทœ์ • ์ค€์ˆ˜ ๋ชจ๋‹ˆํ„ฐ๋ง

AWS Config๋Š” AWS ๋ฆฌ์†Œ์Šค์˜ ๊ตฌ์„ฑ์„ ์ธก์ •, ๊ฐ์‚ฌ ๋ฐ ํ‰๊ฐ€ํ•  ์ˆ˜ ์žˆ๋Š” ์„œ๋น„์Šค์ž…๋‹ˆ๋‹ค. AWS Config๋Š” AWS ๋ฆฌ์†Œ์Šค ๊ตฌ์„ฑ์„ ์ง€์†์ ์œผ๋กœ ๋ชจ๋‹ˆํ„ฐ๋งํ•˜๊ณ  ๊ธฐ๋กํ•˜๋ฉฐ, ์›ํ•˜๋Š” ๊ตฌ์„ฑ์„ ๊ธฐ์ค€์œผ๋กœ ๊ธฐ๋ก๋œ ๊ตฌ์„ฑ์„ ์ž๋™์œผ๋กœ ํ‰๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

AWS Config๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด AWS ๋ฆฌ์†Œ์Šค ๊ฐ„ ๊ตฌ์„ฑ ๋ฐ ๊ด€๊ณ„์˜ ๋ณ€ํ™”๋ฅผ ๊ฒ€ํ† ํ•˜๊ณ , ์ž์„ธํ•œ ๋ฆฌ์†Œ์Šค ๊ตฌ์„ฑ ๊ธฐ๋ก์„ ๋ถ„์„ํ•˜๋ฉฐ, ๋‚ด๋ถ€ ์ง€์นจ์— ์ง€์ •๋˜์–ด ์žˆ๋Š” ๊ตฌ์„ฑ์„ ๊ธฐ์ค€์œผ๋กœ ์ „๋ฐ˜์ ์ธ ๊ทœ์ • ์ค€์ˆ˜ ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. AWS Config๋ฅผ ํ†ตํ•ด ๊ทœ์ • ์ค€์ˆ˜ ๊ฐ์‚ฌ, ๋ณด์•ˆ ๋ถ„์„, ๋ณ€๊ฒฝ ๊ด€๋ฆฌ ๋ฐ ์šด์˜ ๋ฌธ์ œ ํ•ด๊ฒฐ ์ž‘์—…์„ ๊ฐ„์†Œํ™”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด๋ฒˆ ๊ณผ์ œ์—์„œ๋Š” AWS Config ๊ทœ์น™์„ ํ™œ์„ฑํ™”ํ•˜์—ฌ ํƒœ๊น… ๋ฐ Amazon Elastic Block Store(Amazon EBS) ๋ณผ๋ฅจ์˜ ๊ทœ์ • ์ค€์ˆ˜๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

  1. ์„œ๋น„์Šค(Services) ๋ฉ”๋‰ด์—์„œ Config๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  2. ์‹œ์ž‘ํ•˜๊ธฐ(Get started) ๋ฒ„ํŠผ์ด ํ‘œ์‹œ๋˜๋ฉด ๋‹ค์Œ์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ์ดˆ๊ธฐ ์‚ฌ์šฉ์„ ์œ„ํ•ด AWS Config๊ฐ€ ๊ตฌ์„ฑ๋ฉ๋‹ˆ๋‹ค. AWS Config์˜ค์‹  ๊ฒƒ์„ ํ™˜์˜ํ•ฉ๋‹ˆ๋‹ค.(Welcome to AWS Config) ์ฐฝ์ด ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค. ์ด ์ฐฝ์€ ๋‹ซ์•„๋„ ๋ฉ๋‹ˆ๋‹ค.

  1. ์™ผ์ชฝ ํƒ์ƒ‰ ์ฐฝ์—์„œ ์œ„์ชฝ์— ์žˆ๋Š” ๊ทœ์น™(Rules)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  2. ๊ทœ์น™ ์ถ”๊ฐ€(Add Rule)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  3. ๊ฒ€์ƒ‰ ํ•„๋“œ์˜ AWS Managed Rules ์„น์…˜์—์„œ required-tags๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
  4. required-tags ์˜†์— ์žˆ๋Š” ๋ฒ„ํŠผ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  5. ๋‹ค์Œ(Next)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

๋ฆฌ์†Œ์Šค๋งˆ๋‹ค project ์ฝ”๋“œ๋ฅผ ์š”๊ตฌํ•˜๋Š” ๊ทœ์น™์„ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

  1. ๊ทœ์น™ ๊ตฌ์„ฑ(Configure rule) ํŽ˜์ด์ง€์—์„œ ํŒŒ๋ผ๋ฏธํ„ฐ(Parameters)๋กœ ์Šคํฌ๋กคํ•˜๊ณ  ๋‹ค์Œ ์„ค์ •์„ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

์ด ๊ทœ์น™์€ ์ด์ œ project ํƒœ๊ทธ๊ฐ€ ์—†๋Š” ๋ฆฌ์†Œ์Šค๋ฅผ ์ฐพ์Šต๋‹ˆ๋‹ค. ์ž‘์—… ์™„๋ฃŒ์—๋Š” ๋ช‡ ๋ถ„ ์ •๋„ ์†Œ์š”๋˜๋ฏ€๋กœ ๋‹ค์Œ ๋‹จ๊ณ„๋กœ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค. ๊ธฐ๋‹ค๋ฆด ํ•„์š”๋Š” ์—†์Šต๋‹ˆ๋‹ค.

์ด์ œ EC2 ์ธ์Šคํ„ด์Šค์— ์—ฐ๊ฒฐ๋˜์ง€ ์•Š์€ Amazon EBS ๋ณผ๋ฅจ์„ ์ฐพ๋Š” ๊ทœ์น™์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

  1. ๊ทœ์น™ ์ถ”๊ฐ€(Add rule)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  2. ๊ฒ€์ƒ‰ ํ•„๋“œ์˜ AWS Managed Rules ์„น์…˜์—์„œ ec2-volume-inuse-check๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
  3. ec2-volume-inuse-check ์˜†์— ์žˆ๋Š” ๋ฒ„ํŠผ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  4. ๋‹ค์Œ(Next)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  5. ๋‹ค์‹œ ๋‹ค์Œ(Next)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  6. ๊ทœ์น™ ์ถ”๊ฐ€(Add rule)์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  7. ์ ์–ด๋„ ํ•˜๋‚˜์˜ ๊ทœ์น™์ด ํ‰๊ฐ€๋ฅผ ์™„๋ฃŒํ•  ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆฝ๋‹ˆ๋‹ค. ํ•„์š”ํ•œ ๊ฒฝ์šฐ ๋ธŒ๋ผ์šฐ์ € ํŽ˜์ด์ง€๋ฅผ ์ƒˆ๋กœ ๊ณ ์นฉ๋‹ˆ๋‹ค.

๋ฒ”์œ„ ๋‚ด ๋ฆฌ์†Œ์Šค ์—†์Œ(No resources in scope) ๋ฉ”์‹œ์ง€๊ฐ€ ํ‘œ์‹œ๋˜๋ฉด ๋ช‡ ๋ถ„ ๋” ๊ธฐ๋‹ค๋ฆฌ์‹ญ์‹œ์˜ค. ์ด ๋ฉ”์‹œ์ง€๋Š” ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋ฆฌ์†Œ์Šค๋ฅผ AWS Config๊ฐ€ ์—ฌ์ „ํžˆ ํƒ์ƒ‰ ์ค‘์ž„์„ ๋œปํ•ฉ๋‹ˆ๋‹ค. ๋ฉ”์‹œ์ง€๋Š” ์‹œ๊ฐ„์ด ์ง€๋‚˜๋ฉด ์‚ฌ๋ผ์ง‘๋‹ˆ๋‹ค.

  1. ๊ฐ ๊ทœ์น™์„ ์„ ํƒํ•˜์—ฌ ๊ฐ์‚ฌ ๊ฒฐ๊ณผ๋ฅผ ๋ด…๋‹ˆ๋‹ค.

๊ฒฐ๊ณผ์—๋Š” ๋‹ค์Œ์ด ํ‘œ์‹œ๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

AWS Config์—๋Š” ์‚ฌ์ „ ์ •์˜๋œ ๋Œ€๊ทœ๋ชจ ๊ทœ์ • ์ค€์ˆ˜ ๊ฒ€์‚ฌ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์žˆ์œผ๋ฉฐ, AWS Lambda๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ž์ฒด AWS Config ๊ทœ์น™์„ ์ž‘์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ ์ถ”๊ฐ€ ๊ฒ€์‚ฌ๋ฅผ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์‹ค์Šต ์™„๋ฃŒ

์ถ•ํ•˜ํ•ฉ๋‹ˆ๋‹ค. ์‹ค์Šต์„ ๋งˆ์ณค์Šต๋‹ˆ๋‹ค.

  1. ์ด ํŽ˜์ด์ง€์˜ ์ƒ๋‹จ์—์„œ ์‹ค์Šต ์ข…๋ฃŒ๋ฅผ ์„ ํƒํ•˜๊ณ  ์˜ˆ๋ฅผ ์„ ํƒํ•˜์—ฌ ์‹ค์Šต ์ข…๋ฃŒ๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
  1. ์˜ค๋ฅธ์ชฝ ์ƒ๋‹จ ๋ชจ์„œ๋ฆฌ์— ์žˆ๋Š” X๋ฅผ ์„ ํƒํ•˜์—ฌ ํŒจ๋„์„ ๋‹ซ์Šต๋‹ˆ๋‹ค.

 

์ถ”๊ฐ€ ๋ฆฌ์†Œ์Šค

AWS Training and Certification์— ๋Œ€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ https://aws.amazon.com/training/์„ ์ฐธ์กฐํ•˜์‹ญ์‹œ์˜ค.

์—ฌ๋Ÿฌ๋ถ„์˜ ํ”ผ๋“œ๋ฐฑ์„ ํ™˜์˜ํ•ฉ๋‹ˆ๋‹ค.

์ œ์•ˆ์ด๋‚˜ ์ˆ˜์ • ์‚ฌํ•ญ์„ ๊ณต์œ ํ•˜๋ ค๋ฉด AWS Training and Certification ์—ฐ๋ฝ์ฒ˜ ์–‘์‹์—์„œ ์„ธ๋ถ€ ์ •๋ณด๋ฅผ ์ œ๊ณตํ•ด ์ฃผ์‹ญ์‹œ์˜ค.

ยฉ 2021 Amazon Web Services, Inc. and its affiliates. All rights reserved. ๋ณธ ๋‚ด์šฉ์€ Amazon Web Services, Inc.์˜ ์‚ฌ์ „ ์„œ๋ฉด ํ—ˆ๊ฐ€ ์—†์ด ์ „์ฒด ๋˜๋Š” ์ผ๋ถ€๋ฅผ ๋ณต์ œํ•˜๊ฑฐ๋‚˜ ์žฌ๋ฐฐํฌํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ์ƒ์—…์ ์ธ ๋ณต์ œ, ๋Œ€์—ฌ ๋˜๋Š” ํŒ๋งค๋Š” ๊ธˆ์ง€๋ฉ๋‹ˆ๋‹ค.