Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AWS Cloudwatch Dashboard
#5
Thanks for the above...Below is what i've tried something similar and get this working..Posting it here

Code:
AWSTemplateFormatVersion: '2010-09-09'
Description: AWS CloudFormation Template  Dashboard Creation
Resources:
CloudwatchDashboard:
 Type: AWS::CloudWatch::Dashboard
 Properties:
   DashboardName: EC2-Sample-Dashboard
   DashboardBody: { "Fn::Join": [ "", ['{
                     "widgets":[
                       {
                         "type":"metric",
                         "x":0,
                         "y":0,
                         "width":12,
                         "height":6,                              
                         "properties":{
                             "metrics":[
                               [ "AWS/EC2", "CPUUtilization", "InstanceId", "', { Ref: Ec2Instance1 }, '" ],
                               [ "AWS/EC2", "CPUUtilization", "InstanceId", "', { Ref: Ec2Instance2 }, '" ]
                             ],
                             "period":300,
                             "stat":"Average",
                             "region":"us-east-1",
                             "title":"EC2 Instances CPU Details"
                         }
                       },
                       {
                         "type":"metric",
                         "x":0,
                         "y":0,
                         "width":12,
                         "height":6,
                         "properties":{
                             "metrics":[
                               [ "AWS/EBS", "VolumeReadOps", "VolumeId", "vol-0e7060d9" ],
                               [ "AWS/EBS", "VolumeReadOps", "VolumeId", "vol-023c57f" ]
                             ],
                             "period":300,
                             "stat":"Average",
                             "region":"us-east-1",
                             "title":"EBS Details"
                         }
                       },
                       {
                         "type":"metric",
                         "x":0,
                         "y":0,
                         "width":12,
                         "height":6,
                         "properties":{
                             "metrics":[
                               [ "AWS/S3", "BucketSizeBytes", "BucketName", "bucket1" ],
                               [ "AWS/S3", "BucketSizeBytes", "BucketName", "bucket2" ]
                             ],
                             "period":300,
                             "stat":"Average",
                             "region":"us-east-1",
                             "title":"S3 Buckets Details"
                         }
                       },
                       {
                         "type":"metric",
                         "x":0,
                         "y":0,
                         "width":12,
                         "height":6,
                         "properties":{
                             "metrics":[
                               [ "AWS/EFS", "PermittedThroughput", "FileSystemId", "fs-f29a1" ],
                               [ "AWS/EFS", "PermittedThroughput", "FileSystemId", "fs-db382" ]
                             ],
                             "period":300,
                             "stat":"Average",
                             "region":"us-east-1",
                             "title":"EFS Details"
                         }
                       },
                       {
                         "type":"metric",
                         "x":0,
                         "y":0,
                         "width":12,
                         "height":6,
                         "properties":{
                             "metrics":[
                               [ "AWS/EC2", "DiskReadOps", "InstanceId", "', { Ref: Ec2Instance1 }, '" ],
                               [ "AWS/EC2", "DiskReadOps", "InstanceId", "', { Ref: Ec2Instance2 }, '" ]
                             ],
                             "period":300,
                             "stat":"Average",
                             "region":"us-east-1",
                             "title":"EC2 Disk Readops Details"
                         }
                       }
                     ]
                   }'
                   ] ]  }
                 
Ec2Instance1:
  Type: AWS::EC2::Instance
  Properties:
    ImageId: ami-04a5ff1d83d13aa06
    InstanceType: t2.micro
    AvailabilityZone: ap-southeast-1a
Ec2Instance2:
  Type: AWS::EC2::Instance
  Properties:
    ImageId: ami-04a5ff1d83d13aa06
    InstanceType: t2.micro
    AvailabilityZone: ap-southeast-1a
Reply


Messages In This Thread
AWS Cloudwatch Dashboard - by subham - 19-02-2019, 12:46 PM
RE: AWS Cloudwatch Dashboard - by fzs - 19-02-2019, 01:40 PM
RE: AWS Cloudwatch Dashboard - by subham - 20-02-2019, 06:16 AM
RE: AWS Cloudwatch Dashboard - by fzs - 20-02-2019, 02:03 PM
RE: AWS Cloudwatch Dashboard - by subham - 21-02-2019, 11:23 AM
RE: AWS Cloudwatch Dashboard - by ananyagupta - 18-09-2019, 06:45 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)