ãããã«ã¡ã¯ããã¯ãã«ã«ãµãã¼ã課ã®åæ¬ï¼@t_sakamï¼ã§ããä»åã¯ãAmazon Managed Grafana ã«é¢ããããã°ã§ãã
ã
ã1 ã¤ã® Amazon Managed Grafana ã®ã¯ã¼ã¯ã¹ãã¼ã¹ã§è¤æ°ã®ã¢ã«ã¦ã³ãã®æ
å ±ãã¾ã¨ãã¦ç¢ºèªããããã¿ã¼ã³ãããã¨æãã¾ãã管çã¢ã«ã¦ã³ãã®æ¨©éããã£ã¦ããå ´åã¯å¥ã®æ¹æ³ãããã¾ãããä»åã¯ã管çã¢ã«ã¦ã³ããå©ç¨ã§ããªãç°å¢ã§ãè¤æ°ã®ã¡ã³ãã¼ã¢ã«ã¦ã³ãã® CloudWatch ã®ã¡ããªã¯ã¹ã®æ
å ±ã表示ããæ¹æ³ã確èªãã¦ããã¾ãã
ãå®ç¾ããããã®ãã¤ã³ãã¯ä»¥ä¸ã® 2 ã¤ã«ãªãã¾ãã
ã
- CloudWatch ã®ã¯ãã¹ã¢ã«ã¦ã³ããªãã¶ã¼ãããªãã£æ©è½ãå©ç¨ãã
- Grafana ã®ã¯ã¼ã¯ã¹ãã¼ã¹ã¸ã®ãã°ã¤ã³ã¯ SAML èªè¨¼ãå©ç¨ãã
Point 1 CloudWatch ã®ã¯ãã¹ã¢ã«ã¦ã³ããªãã¶ã¼ãããªãã£æ©è½ãå©ç¨ãã
ãã¾ãã¯ãCloudWatch ã®ã¯ãã¹ã¢ã«ã¦ã³ããªãã¶ã¼ãããªãã£æ©è½ãå©ç¨ããã¢ãã¿ãªã³ã°ç¨ã®ã¢ã«ã¦ã³ãã§ãä»ã®ã¢ã«ã¦ã³ãã® CloudWatch ã®ã¡ããªã¯ã¹ã®æ å ±ãè¦ãããããã«ãã¾ãã
Point 2 Grafana ã®ã¯ã¼ã¯ã¹ãã¼ã¹ã¸ã®ãã°ã¤ã³ã¯ SAML èªè¨¼ãå©ç¨ãã
ãSAML ã®ä»ã« IAM Identity Center ãå©ç¨ããæ¹æ³ãããã¾ããããã®å ´åã¯ã管çã¢ã«ã¦ã³ããå¿ è¦ã«ãªãã¾ãã®ã§ãã¡ã³ãã¼ã¢ã«ã¦ã³ãããå©ç¨ã§ããªãç°å¢ã®å ´åã¯ãSAML èªè¨¼ãé¸æãããã¨ã«ãªãã¾ãã
ãããã§ã¯ãæ©éæé ã確èªãã¦ããã¾ããä»åãæé ãé·ããããããã°ã 2 ã¤ã«åãããã¨æãã¾ããä»åã®ããã°ã§ã¯ã主㫠Point 1 ã®ãCloudWatch ã®ã¯ãã¹ã¢ã«ã¦ã³ããªãã¶ã¼ãããªãã£æ©è½ãå©ç¨ãããã®æé ã¾ã§ã確èªãããã¨æãã¾ãã
- Point 1 CloudWatch ã®ã¯ãã¹ã¢ã«ã¦ã³ããªãã¶ã¼ãããªãã£æ©è½ãå©ç¨ãã
- Point 2 Grafana ã®ã¯ã¼ã¯ã¹ãã¼ã¹ã¸ã®ãã°ã¤ã³ã¯ SAML èªè¨¼ãå©ç¨ãã
- CloudWatch ã®ã¯ãã¹ã¢ã«ã¦ã³ããªãã¶ã¼ãããªãã£ã®è¨å®
- ã¢ãã¿ãªã³ã°ç¨ã®ã¢ã«ã¦ã³ãã® CloudWatch ã®è¨å®
- ã¢ãã¿ãªã³ã°ã¢ã«ã¦ã³ãè¨å®
- ãã¼ã¿ãé¸æ
- ã½ã¼ã¹ã¢ã«ã¦ã³ããä¸è¦§è¡¨ç¤º
- ã½ã¼ã¹ã¢ã«ã¦ã³ããèå¥ããã®ã«å½¹ç«ã¤ã©ãã«ãå®ç¾©ãã
- ã¢ã«ã¦ã³ãããªã³ã¯ããããã®ãªã½ã¼ã¹
- ã½ã¼ã¹ã¢ã«ã¦ã³ãããªã³ã¯ããæ¹æ³ã決å®
- ãã¦ã³ãã¼ããã CloudFormation ã®ãã³ãã¬ã¼ã
- ã½ã¼ã¹ã¢ã«ã¦ã³ãã® CloudWatch ã®è¨å®
- CloudFormation ã使ã IAM ãã¼ã«ã®ä½æ
- ã½ã¼ã¹ã¢ã«ã¦ã³ãã® CloudWatch ã®è¨å®ï¼ç¶ãï¼
- ã¢ãã¿ãªã³ã°ç¨ã®ã¢ã«ã¦ã³ãã® CloudWatch ã®è¨å®
- ã¢ãã¿ãªã³ã°ã¢ã«ã¦ã³ã㧠CloudWatch ã®ã¡ããªã¯ã¹ã確èªãã
- ã¾ã¨ã
CloudWatch ã®ã¯ãã¹ã¢ã«ã¦ã³ããªãã¶ã¼ãããªãã£ã®è¨å®
ãã¾ãã¯ãCloudWatch ã®ã¯ãã¹ã¢ã«ã¦ã³ããªãã¶ã¼ãããªãã£ã®è¨å®ããã¦ããã¾ããæé ãé·ããªã£ã¦ãã¾ãã®ã§ãä»åã¯ãã¢ãã¿ãªã³ã°ç¨ã®ã¡ã³ãã¼ã¢ã«ã¦ã³ã A ã¨ããä¸ã¤ã®ã¡ã³ãã¼ã¢ã«ã¦ã³ãã§ããã¢ã«ã¦ã³ã Bãã® 2 ã¤ã®ã¢ã«ã¦ã³ãã®ã¿è¨å®ããããªãã¾ãã確èªããã¢ã«ã¦ã³ãã追å ãããå ´åã¯ãåãæé ã§è¿½å ããæµãã«ãªãã¾ãã
ã¢ãã¿ãªã³ã°ç¨ã®ã¢ã«ã¦ã³ãã® CloudWatch ã®è¨å®
ãã¾ãã¯ãã¢ãã¿ãªã³ã°ç¨ã®ã¢ã«ã¦ã³ã㧠CloudWatch ã®è¨å®ããããªã£ã¦ããã¾ãã
ãããã¸ã¡ã³ãã³ã³ã½ã¼ã«ã® CloudWatch ã®ç»é¢å·¦ã¡ãã¥ã¼ä¸ã®ãè¨å®ããé¸æãã¾ãã
ã¢ãã¿ãªã³ã°ã¢ã«ã¦ã³ãè¨å®
ãç»é¢ä¸å¤®ã®ãã¢ãã¿ãªã³ã°ã¢ã«ã¦ã³ãè¨å®ãé ç®ã®ãè¨å®ããé¸æãã¾ãã
ãã¼ã¿ãé¸æ
ãä»åã¯ãEC2 ã® CloudWatch ã®ã¡ããªã¯ã¹ã Grafana ã§ç¢ºèªã§ããããã«ãã¦ããããã®ã§ããã¡ããªã¯ã¹ãã«ãã§ãã¯ãå ¥ãã¾ãã
ã½ã¼ã¹ã¢ã«ã¦ã³ããä¸è¦§è¡¨ç¤º
ãã½ã¼ã¹ã¢ã«ã¦ã³ã B ã® 12 æ¡ ã® AWS ã®ã¢ã«ã¦ã³ã ID ãå ¥åãã¾ããä»åã¯ã1 ã¤ã®ã½ã¼ã¹ã¢ã«ã¦ã³ãã®ã¿è¨å®ãã¾ããã追å ã§ä»ã®ã¢ã«ã¦ã³ããè¨å®ãããå ´åã¯ãã«ã³ãåºåãã§è¿½å ãã¦ããã¾ããã½ã¼ã¹ã¢ã«ã¦ã³ã B ã® 12 æ¡ ã® AWS ã®ã¢ã«ã¦ã³ã ID ã仮㫠YYYYYYYYYYYY ã¨ãã¦ã追å ã§è¨å®ãããã¢ã«ã¦ã³ãããZZZZZZZZZZZZ ã ã¨ããã¨ããYYYYYYYYYYYY, ZZZZZZZZZZZZãã¨è¨å®ãã¾ãã
ã½ã¼ã¹ã¢ã«ã¦ã³ããèå¥ããã®ã«å½¹ç«ã¤ã©ãã«ãå®ç¾©ãã
ãã¢ãã¿ãªã³ã°ç¨ã®ã¢ã«ã¦ã³ãã® CloudWatch ã§ã¡ããªã¯ã¹ã確èªããéã«ãã½ã¼ã¹ã¢ã«ã¦ã³ããè¦åããããã«ä½ãå©ç¨ããããé¸æãã¾ããã¢ã«ã¦ã³ãåãã°ãã¼ãã«ã«ä¸æã® E ã¡ã¼ã«ããã¡ã¤ã³ãªãã® E ã¡ã¼ã«ãã«ã¹ã¿ã ã©ãã«ããé¸æã§ãã¾ããä»åã¯ãã°ãã¼ãã«ã«ä¸æã® E ã¡ã¼ã«ãé¸æãã¾ãããæå¾ã«ãè¨å®ããã¿ã³ãæ¼ãã¾ãã
ã¢ã«ã¦ã³ãããªã³ã¯ããããã®ãªã½ã¼ã¹
ãããã§ãã¢ãã¿ãªã³ã°ã¢ã«ã¦ã³ããæå¹ã«ãªãã¾ãããä»åº¦ã¯ãã½ã¼ã¹ã¢ã«ã¦ã³ããè¨å®ããããã®æºåããã¦ããã¾ããç»é¢ä¸å¤®å·¦ã®ãã¢ã«ã¦ã³ãããªã³ã¯ããããã®ãªã½ã¼ã¹ããé¸æãã¾ãã
ã½ã¼ã¹ã¢ã«ã¦ã³ãããªã³ã¯ããæ¹æ³ã決å®
ã次ã¯ãã½ã¼ã¹ã¢ã«ã¦ã³ããè¨å®ããæ¹æ³ãé¸æãã¾ããä»åã¯ã管çã¢ã«ã¦ã³ãã®æ¨©éããªãã¨ãããã¿ã¼ã³ãæ³å®ãã¦ããã®ã§ãä»»æã®ã¢ã«ã¦ã³ãããé¸æãã¾ãããã®å¾ããCloudFormation ã®ãã³ãã¬ã¼ãããã¦ã³ãã¼ãããã¿ã³ãæ¼ãã¾ãã
ãã¦ã³ãã¼ããã CloudFormation ã®ãã³ãã¬ã¼ã
ãCloudFormation ã®ãã³ãã¬ã¼ãã¯ä»¥ä¸ã®ããã«ãªã£ã¦ãã¾ããã¢ãã¿ãªã³ã°ã¢ã«ã¦ã³ãã®ã¢ã«ã¦ã³ã ID 㯠XXXXXXXXXXXX ã§ç½®ãæãã¦ãã¾ãã
link_to_XXXXXXXXXXXX_cloudformation_template.yaml
AWSTemplateFormatVersion: 2010-09-09 Conditions: SkipMonitoringAccount: !Not - !Equals - !Ref AWS::AccountId - "XXXXXXXXXXXX" Resources: Link: Type: AWS::Oam::Link Condition: SkipMonitoringAccount Properties: LabelTemplate: "$AccountEmail" ResourceTypes: - "AWS::CloudWatch::Metric" SinkIdentifier: "arn:aws:oam:ap-northeast-1:XXXXXXXXXXXX:sink/11111111-1111-1111-1111-111111111111"
ããã³ãã¬ã¼ãå
ã« Sink ã Link ã¨ããè¨è¼ãããã¾ãããSink ã¯ã¢ãã¿ãªã³ã°ã¢ã«ã¦ã³ãå´ã®ã¢ã¿ããã¡ã³ããã¤ã³ãã«ãªãã¾ããLink ãã½ã¼ã¹ã¢ã«ã¦ã³ãå´ã«è¨å®ãããã¨ã§ãã¢ãã¿ãªã³ã°ã¢ã«ã¦ã³ãã¨ã®æ¥ç¶ã確ç«ããã¾ãã
ãã½ã¼ã¹ã¢ã«ã¦ã³ãã§ããã®ãã³ãã¬ã¼ãã使ç¨ãã¦ãCloudFormation ã§è¨å®ãããã¨ã§ãã½ã¼ã¹ã¢ã«ã¦ã³ãã« Link ãä½æããã¾ãã
⻠以ä¸ãã¯ãã¹ã¢ã«ã¦ã³ããªãã¶ã¼ãããªãã£ã® AWS ã®ããã¥ã¡ã³ã æç²ã
ã·ã³ã¯ã¯ãã¢ãã¿ã¼ãªã³ã°ã¢ã«ã¦ã³ãã®ã¢ã¿ããã¡ã³ããã¤ã³ãã表ããªã½ã¼ã¹ã§ããã½ã¼ã¹ã¢ã«ã¦ã³ãã¯ãã·ã³ã¯ã«ãªã³ã¯ãããã¨ã§ãªãã¶ã¼ãããªãã£ãã¼ã¿ãå ±æã§ãã¾ããåã¢ã«ã¦ã³ãã«ãªã¼ã¸ã§ã³ããã 1 ã¤ã®ã·ã³ã¯ãè¨å®ã§ãã¾ããåã·ã³ã¯ã¯ããã®ã·ã³ã¯ãããã¢ãã¿ã¼ãªã³ã°ã¢ã«ã¦ã³ãã«ãã£ã¦ç®¡çããã¾ãããªãã¶ã¼ãããªãã£ãªã³ã¯ã¯ãã½ã¼ã¹ã¢ã«ã¦ã³ãã¨ã¢ãã¿ã¼ãªã³ã°ã¢ã«ã¦ã³ãã®éã«ç¢ºç«ããããªã³ã¯ã表ããªã½ã¼ã¹ã§ãããªã³ã¯ã¯ã½ã¼ã¹ã¢ã«ã¦ã³ãã«ãã£ã¦ç®¡çããã¾ãã
ã½ã¼ã¹ã¢ã«ã¦ã³ãã® CloudWatch ã®è¨å®
ãCloudFormation ã®ãã³ãã¬ã¼ãããã¦ã³ãã¼ãã§ããã®ã§ãä»åº¦ã¯ãã®ãã³ãã¬ã¼ã使ã£ã¦ãã½ã¼ã¹ã¢ã«ã¦ã³ã㧠CloudWatch ã®è¨å®ããããªã£ã¦ããã¾ãã
CloudFormation ã§ã¹ã¿ãã¯ãä½æ
ãCloudFormation ã®ããã¸ã¡ã³ãã³ã³ã½ã¼ã«ã®å·¦ã¡ãã¥ã¼ã§ãã¹ã¿ãã¯ããé¸æãã¾ããç»é¢å³ä¸ã®ãã¹ã¿ãã¯ã®ä½æããé¸æããæ°ãããªã½ã¼ã¹ã使ç¨ï¼æ¨æºï¼ããé¸æãã¾ãã
ã¹ã¿ãã¯ãä½æ
ãããã³ãã¬ã¼ãã®æºåãã¯ãæ¢åã®ãã³ãã¬ã¼ããé¸æããé¸æãã¾ãã次ã®ããã³ãã¬ã¼ãã®æå®ãã§ããã³ãã¬ã¼ããã¡ã¤ã«ã®ã¢ãããã¼ãããé¸æãã¾ããããã¡ã¤ã«ã®é¸æãã§ãå ã»ã©ã¢ãã¿ãªã³ã°ã¢ã«ã¦ã³ãã§ãã¦ã³ãã¼ãããããã³ãã¬ã¼ããã¢ãããã¼ããã¾ãã
ã¹ã¿ãã¯ã®è©³ç´°ãè¨å®ãã¹ã¿ãã¯åãæä¾
ãé©å®ãã¹ã¿ãã¯åãå ¥åãã¾ããä»åã¯ãCrossAccountObservabilityãã¨ãã¦ããã¾ããã
ã¹ã¿ãã¯ãªãã·ã§ã³ã®è¨å®ãã¢ã¯ã»ã¹è¨±å¯
ãCloudFormation ã使ã IAM ãã¼ã«ãè¨å®ãã¾ããããã§ã¯ãäºåã«ä½æãã¦ããããCloudFormationRoleããé¸æãã¦ãã¾ãããCloudFormationRoleãã®ä½æã¯ã次ã®æé ã§èª¬æãã¾ãã
CloudFormation ã使ã IAM ãã¼ã«ã®ä½æ
ãIAM ã®ããã¸ã¡ã³ãã³ã³ã½ã¼ã«ã®å·¦ã¡ãã¥ã¼ã§ãã¢ã¯ã»ã¹ç®¡çã-ããã¼ã«ããé¸æããç»é¢å³ä¸ã®ããã¼ã«ãä½æããã¿ã³ãæ¼ãã¾ãã
ä¿¡é ¼ãããã¨ã³ãã£ãã£ãé¸æ
ããä¿¡é ¼ãããã¨ã³ãã£ãã£ã¿ã¤ããã§ãAWS ã®ãµã¼ãã¹ããé¸æãããã¦ã¼ã¹ã±ã¼ã¹ãã§ãCloudFormationããé¸æãã¾ãã
許å¯ã追å
ãããã§ã¯ãäºåã«ä½æãã¦ããããCloudFormationPolicyããé¸æãã¦ãã¾ãããäºåã«ä½æãã¦ããã IAM ããªã·ã¼ã®å 容ã以ä¸ã«è¨è¼ãã¦ããã¾ãã
CloudFormationPolicy
{ "Version": "2012-10-17", "Statement": [ { "Sid": "001", "Effect": "Allow", "Action": [ "oam:CreateLink", "cloudwatch:Link" ], "Resource": "*" } ] }
ããã®ã¹ã¿ãã¯ã§ä½æãããã®ã¯ãå
ã»ã©ã® Link ã®ã¿ã®ããããoam:CreateLinkãã¨ãcloudwatch:Linkãã®ã¿æ¨©éãããã°åé¡ããã¾ããã
ãâ» oam ã¯ããAmazon CloudWatch Observability Access Managerããç¥ã㦠OAM ã¨ã®ãã¨ã§ãã
ååã確èªãããã³ä½æ
ã確èªç»é¢ã§ç¢ºèªãããåé¡ããªããã°ç»é¢ä¸ã®ããã¼ã«ãä½æããã¿ã³ãæ¼ãã¦å®äºã§ãã
ã½ã¼ã¹ã¢ã«ã¦ã³ãã® CloudWatch ã®è¨å®ï¼ç¶ãï¼
ãã§ã¯ãã½ã¼ã¹ã¢ã«ã¦ã³ãã® CloudWatch ã®è¨å®ã«æ»ãã¾ããã確èªãã¦ä½æãç»é¢ã§ç¢ºèªãããåé¡ããªããã°ç»é¢ä¸ã®ãéä¿¡ããã¿ã³ãæ¼ãã¦å®äºã§ãã
CloudFormation ã®ç»é¢ã§ç¢ºèª
ãCloudFormation ã®ããã¸ã¡ã³ãã³ã³ã½ã¼ã«ã¸ç§»åããå ã»ã©ã®ã¹ã¿ãã¯ãCrossAccountObservabilityããé¸æãã¾ããç»é¢å³ã®ããªã½ã¼ã¹ãã¿ãã確èªããã¨ãLink ãä½æããã¦ãããã¨ããããã¾ããããã§ãã¯ãã¹ã¢ã«ã¦ã³ããªãã¶ã¼ãããªãã£ã®è¨å®ã¯å®äºã§ãã
ã¢ãã¿ãªã³ã°ã¢ã«ã¦ã³ã㧠CloudWatch ã®ã¡ããªã¯ã¹ã確èªãã
ãè¨å®ãå®äºããã®ã§ãã¢ãã¿ãªã³ã°ã¢ã«ã¦ã³ãã«æ»ããã¡ããã¨è¨å®ã§ãã¦ãããã確èªãã¾ãã
CloudWatch ã®ããã¸ã¡ã³ãã³ã³ã½ã¼ã«ã§ EC2 ã® CPUUtilization ã確èª
ãCloudWatch ã®ããã¸ã¡ã³ãã³ã³ã½ã¼ã«ã§ããããã®ã¢ã«ã¦ã³ãã«ãã EC2 ã® CPUUtilization ã確èªãã¦ã¿ã¾ããç»é¢å³ä¸ã®ãã¢ã«ã¦ã³ãã©ãã«ãã§ãã¢ãã¿ãªã³ã°ã¢ã«ã¦ã³ããã¨ãã以å¤ãè¦åããããããã«ãªã£ã¦ãã¾ãã
ãä»åã¯ãæé ã®ãã½ã¼ã¹ã¢ã«ã¦ã³ããèå¥ããã®ã«å½¹ç«ã¤ã©ãã«ãå®ç¾©ãããã®ç®æã§ãã°ãã¼ãã«ã«ä¸æã® E ã¡ã¼ã«ããé¸æãã¦ããã®ã§ã½ã¼ã¹ã¢ã«ã¦ã³ãã®ãã¢ã«ã¦ã³ãã©ãã«ã㯠E ã¡ã¼ã«ã«ãªã£ã¦ãã¾ãã
ãã¾ããç»é¢å³ä¸ã§ãã¢ãã¿ãªã³ã°ã¢ã«ã¦ã³ããã¨è¡¨ç¤ºãããããã«ãªã£ã¦ãã¾ãã
ã¾ã¨ã
ãä»åã¯ããAmazon Managed GrafanaãCloudWatch ã® ã¯ãã¹ã¢ã«ã¦ã³ããªãã¶ã¼ãããªãã£ã¨ SAML èªè¨¼ã§è¤æ°ã¡ã³ãã¼ã¢ã«ã¦ã³ããä¸æ¬ã¢ãã¿ãªã³ã°ããæ¹æ³ãå
¨ 2 åï¼äºå®ï¼ã®ç¬¬ 1 åã¨ãã¦ããCloudWatch ã®ã¯ãã¹ã¢ã«ã¦ã³ããªãã¶ã¼ãããªãã£æ©è½ãå©ç¨ãããã®æé ã¾ã§ã確èªãã¾ããã
ã
ãAmazon Managed Grafana ã®ããã°ã§ãããæé ãé·ã Amazon Managed Grafana ãã¾ã åºã¦ãã¦ããããæãå
¥ãã¾ãâ¦ããã ãä»åã®è¨å®ã§æ¢ã«ä»ã®ã¢ã«ã¦ã³ãã®æ
å ±ãã¢ãã¿ãªã³ã°ã¢ã«ã¦ã³ãã§åå¾ã§ãã¦ããã®ã§ãAmazon Managed Grafana ã§ã表示ã§ãããã¨ãã¤ã¡ã¼ã¸ãã¦ããã ããã®ã§ã¯ãªããã¨æãã¾ãã
ã
ã第 2 åã¯ãOneLogin ã使ç¨ã㦠Amazon Managed Grafana ã§ã¦ã¼ã¶ã¼èªè¨¼ãããããã®è¨å®ã¨ Amazon Managed Grafana ã§ä»åã¨åã EC2 ã® CPUUtilization ã®ã°ã©ãã表示ããè¨å®ããããªã£ã¦ããããã¨æãã¾ãã
ã
ãããããCloudWatch ã®ã¯ãã¹ã¢ã«ã¦ã³ããªãã¶ã¼ãããªãã£æ©è½ã£ã¦æ¬å½ã«ãããã®ã§ããï¼
ã
åæ¬ ç¥å(è¨äºä¸è¦§)
ãµã¼ãã¼ã¯ã¼ã¯ã¹ã®ãããã®äººï¼@t_sakamï¼ã2024 Japan AWS Ambassadorsã2020 APN AWS Top Engineersã