AWS.InternetMonitor reference
GetHealthEvent
Section titled “GetHealthEvent”Source:
src/AWS/InternetMonitor/GetHealthEvent.ts
Runtime binding for internetmonitor:GetHealthEvent — read the full
detail (impacted locations, availability/performance measurements, impact
type) of one health event on the bound Monitor; the monitor name
is injected automatically.
Provide InternetMonitor.GetHealthEventHttp on the hosting Lambda
Function to satisfy the requirement.
GetHealthEvent: Reading Health Events
Section titled “GetHealthEvent: Reading Health Events”// init — grants internetmonitor:GetHealthEvent on the monitorconst getHealthEvent = yield* AWS.InternetMonitor.GetHealthEvent(monitor);
// runtimeconst event = yield* getHealthEvent({ EventId: eventId });const locations = event.ImpactedLocations;GetInternetEvent
Section titled “GetInternetEvent”Source:
src/AWS/InternetMonitor/GetInternetEvent.ts
Runtime binding for internetmonitor:GetInternetEvent — read the detail
(impacted client location, start/end time, type, status) of one global
internet event from the outages map Internet Monitor publishes for all
AWS customers. Internet events are account-level; no monitor is required.
Provide InternetMonitor.GetInternetEventHttp on the hosting Lambda
Function to satisfy the requirement.
GetInternetEvent: Reading Internet Events
Section titled “GetInternetEvent: Reading Internet Events”// init — grants internetmonitor:GetInternetEventconst getInternetEvent = yield* AWS.InternetMonitor.GetInternetEvent();
// runtimeconst event = yield* getInternetEvent({ EventId: eventId });const location = event.ClientLocation;GetQueryResults
Section titled “GetQueryResults”Source:
src/AWS/InternetMonitor/GetQueryResults.ts
Runtime binding for internetmonitor:GetQueryResults — fetch the result
rows of a SUCCEEDED query on the bound Monitor; the monitor name
is injected automatically.
Provide InternetMonitor.GetQueryResultsHttp on the hosting Lambda
Function to satisfy the requirement.
GetQueryResults: Querying Measurements
Section titled “GetQueryResults: Querying Measurements”// init — grants internetmonitor:GetQueryResults on the monitorconst getQueryResults = yield* AWS.InternetMonitor.GetQueryResults(monitor);
// runtimeconst { Fields, Data } = yield* getQueryResults({ QueryId: queryId });GetQueryStatus
Section titled “GetQueryStatus”Source:
src/AWS/InternetMonitor/GetQueryStatus.ts
Runtime binding for internetmonitor:GetQueryStatus — check whether a
query started on the bound Monitor is QUEUED, RUNNING,
SUCCEEDED, FAILED, or CANCELED; the monitor name is injected
automatically.
Provide InternetMonitor.GetQueryStatusHttp on the hosting Lambda
Function to satisfy the requirement.
GetQueryStatus: Querying Measurements
Section titled “GetQueryStatus: Querying Measurements”// init — grants internetmonitor:GetQueryStatus on the monitorconst getQueryStatus = yield* AWS.InternetMonitor.GetQueryStatus(monitor);
// runtimeconst { Status } = yield* getQueryStatus({ QueryId: queryId }).pipe( Effect.repeat({ schedule: Schedule.spaced("2 seconds"), until: (r) => r.Status !== "QUEUED" && r.Status !== "RUNNING", times: 10, }),);ListHealthEvents
Section titled “ListHealthEvents”Source:
src/AWS/InternetMonitor/ListHealthEvents.ts
Runtime binding for internetmonitor:ListHealthEvents — list the health
events Internet Monitor created for the bound Monitor; the monitor
name is injected automatically.
Provide InternetMonitor.ListHealthEventsHttp on the hosting Lambda
Function to satisfy the requirement.
ListHealthEvents: Reading Health Events
Section titled “ListHealthEvents: Reading Health Events”// init — grants internetmonitor:ListHealthEvents on the monitorconst listHealthEvents = yield* AWS.InternetMonitor.ListHealthEvents(monitor);
// runtimeconst { HealthEvents } = yield* listHealthEvents({ EventStatus: "ACTIVE" });ListInternetEvents
Section titled “ListInternetEvents”Source:
src/AWS/InternetMonitor/ListInternetEvents.ts
Runtime binding for internetmonitor:ListInternetEvents — list the global
internet events (performance or availability issues at client locations)
from the outages map Internet Monitor publishes for all AWS customers.
Internet events are account-level; no monitor is required.
Provide InternetMonitor.ListInternetEventsHttp on the hosting Lambda
Function to satisfy the requirement.
ListInternetEvents: Reading Internet Events
Section titled “ListInternetEvents: Reading Internet Events”// init — grants internetmonitor:ListInternetEventsconst listInternetEvents = yield* AWS.InternetMonitor.ListInternetEvents();
// runtimeconst { InternetEvents } = yield* listInternetEvents({ EventStatus: "ACTIVE",});Monitor
Section titled “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).
Monitor: Creating a Monitor
Section titled “Monitor: 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,});Monitor: Health Events
Section titled “Monitor: Health Events”const monitor = yield* InternetMonitor.Monitor("AppMonitor", { resources: [vpcArn], maxCityNetworksToMonitor: 100, healthEventsConfig: { AvailabilityScoreThreshold: 90, PerformanceScoreThreshold: 90, },});Monitor: Log Delivery
Section titled “Monitor: Log Delivery”const monitor = yield* InternetMonitor.Monitor("AppMonitor", { resources: [vpcArn], maxCityNetworksToMonitor: 100, internetMeasurementsLogDelivery: { S3Config: { BucketName: bucket.bucketName, LogDeliveryStatus: "ENABLED", }, },});StartQuery
Section titled “StartQuery”Source:
src/AWS/InternetMonitor/StartQuery.ts
Runtime binding for internetmonitor:StartQuery — start a query against
the bound Monitor’s measurement data with the Internet Monitor
query interface; the monitor name is injected automatically.
Provide InternetMonitor.StartQueryHttp on the hosting Lambda Function to
satisfy the requirement.
StartQuery: Querying Measurements
Section titled “StartQuery: Querying Measurements”// init — grants internetmonitor:StartQuery on the monitorconst startQuery = yield* AWS.InternetMonitor.StartQuery(monitor);
// runtimeconst { QueryId } = yield* startQuery({ StartTime: new Date(Date.now() - 3_600_000), EndTime: new Date(), QueryType: "MEASUREMENTS",});StopQuery
Section titled “StopQuery”Source:
src/AWS/InternetMonitor/StopQuery.ts
Runtime binding for internetmonitor:StopQuery — cancel an in-progress
query on the bound Monitor; the monitor name is injected
automatically.
Provide InternetMonitor.StopQueryHttp on the hosting Lambda Function to
satisfy the requirement.
StopQuery: Querying Measurements
Section titled “StopQuery: Querying Measurements”// init — grants internetmonitor:StopQuery on the monitorconst stopQuery = yield* AWS.InternetMonitor.StopQuery(monitor);
// runtimeyield* stopQuery({ QueryId: queryId });