Monitor
Source:
src/AWS/InternetMonitor/Monitor.ts
An Amazon CloudWatch Internet Monitor monitor — measures internet availability and performance between your AWS-hosted application and your end users’ city-networks (client locations and ASNs, typically ISPs).
A monitor is built from the application resources you add to it: VPCs,
Network Load Balancers, CloudFront distributions, or WorkSpaces
directories. Cost is controlled by capping the number of monitored
city-networks (maxCityNetworksToMonitor) or the percentage of traffic
monitored (trafficPercentageToMonitor).
Creating a Monitor
Section titled “Creating a Monitor”Monitor for a VPC
import * as InternetMonitor from "alchemy/AWS/InternetMonitor";
const monitor = yield* InternetMonitor.Monitor("AppMonitor", { resources: [`arn:aws:ec2:us-east-1:123456789012:vpc/${vpc.vpcId}`], maxCityNetworksToMonitor: 100,});Monitor a percentage of traffic
const monitor = yield* InternetMonitor.Monitor("AppMonitor", { resources: [cloudfrontDistributionArn], trafficPercentageToMonitor: 50,});Health Events
Section titled “Health Events”const monitor = yield* InternetMonitor.Monitor("AppMonitor", { resources: [vpcArn], maxCityNetworksToMonitor: 100, healthEventsConfig: { AvailabilityScoreThreshold: 90, PerformanceScoreThreshold: 90, },});Log Delivery
Section titled “Log Delivery”const monitor = yield* InternetMonitor.Monitor("AppMonitor", { resources: [vpcArn], maxCityNetworksToMonitor: 100, internetMeasurementsLogDelivery: { S3Config: { BucketName: bucket.bucketName, LogDeliveryStatus: "ENABLED", }, },});