Skip to content

AWS.InternetMonitor reference

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.

// init — grants internetmonitor:GetHealthEvent on the monitor
const getHealthEvent = yield* AWS.InternetMonitor.GetHealthEvent(monitor);
// runtime
const event = yield* getHealthEvent({ EventId: eventId });
const locations = event.ImpactedLocations;

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.

// init — grants internetmonitor:GetInternetEvent
const getInternetEvent = yield* AWS.InternetMonitor.GetInternetEvent();
// runtime
const event = yield* getInternetEvent({ EventId: eventId });
const location = event.ClientLocation;

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.

// init — grants internetmonitor:GetQueryResults on the monitor
const getQueryResults = yield* AWS.InternetMonitor.GetQueryResults(monitor);
// runtime
const { Fields, Data } = yield* getQueryResults({ QueryId: queryId });

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.

// init — grants internetmonitor:GetQueryStatus on the monitor
const getQueryStatus = yield* AWS.InternetMonitor.GetQueryStatus(monitor);
// runtime
const { Status } = yield* getQueryStatus({ QueryId: queryId }).pipe(
Effect.repeat({
schedule: Schedule.spaced("2 seconds"),
until: (r) => r.Status !== "QUEUED" && r.Status !== "RUNNING",
times: 10,
}),
);

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.

// init — grants internetmonitor:ListHealthEvents on the monitor
const listHealthEvents = yield* AWS.InternetMonitor.ListHealthEvents(monitor);
// runtime
const { HealthEvents } = yield* listHealthEvents({ EventStatus: "ACTIVE" });

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:ListInternetEvents
const listInternetEvents = yield* AWS.InternetMonitor.ListInternetEvents();
// runtime
const { InternetEvents } = yield* listInternetEvents({
EventStatus: "ACTIVE",
});

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 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,
});
const monitor = yield* InternetMonitor.Monitor("AppMonitor", {
resources: [vpcArn],
maxCityNetworksToMonitor: 100,
healthEventsConfig: {
AvailabilityScoreThreshold: 90,
PerformanceScoreThreshold: 90,
},
});
const monitor = yield* InternetMonitor.Monitor("AppMonitor", {
resources: [vpcArn],
maxCityNetworksToMonitor: 100,
internetMeasurementsLogDelivery: {
S3Config: {
BucketName: bucket.bucketName,
LogDeliveryStatus: "ENABLED",
},
},
});

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.

// init — grants internetmonitor:StartQuery on the monitor
const startQuery = yield* AWS.InternetMonitor.StartQuery(monitor);
// runtime
const { QueryId } = yield* startQuery({
StartTime: new Date(Date.now() - 3_600_000),
EndTime: new Date(),
QueryType: "MEASUREMENTS",
});

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.

// init — grants internetmonitor:StopQuery on the monitor
const stopQuery = yield* AWS.InternetMonitor.StopQuery(monitor);
// runtime
yield* stopQuery({ QueryId: queryId });