1. Docs
  2. @pulumi/awsx
  3. classic
  4. cloudfront

Module classic/cloudfront

    APIs

    APIs

    namespace metrics

    function bytesDownloaded

    bytesDownloaded(change?: CloudfrontMetricChange): Metric

    The number of bytes downloaded by viewers for GET, HEAD, and OPTIONS requests.

    Valid Statistics: Sum Units: None

    function bytesUploaded

    bytesUploaded(change?: CloudfrontMetricChange): Metric

    The number of bytes uploaded to your origin with CloudFront using POST and PUT requests.

    Valid Statistics: Sum Units: None

    interface CloudfrontMetricChange

    interface CloudfrontMetricChange extends MetricChange

    property color

    color?: pulumi.Input<string>;

    The six-digit HTML hex color code to be used for this metric.

    Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

    property dimensions

    dimensions?: pulumi.Input<Record<string, pulumi.Input<string>>>;

    The new dimension for this metric. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be cleared.

    property distribution

    distribution?: aws.cloudfront.Distribution;

    Optional [Distribution] this metric should be filtered down to.

    property extendedStatistic

    extendedStatistic?: pulumi.Input<number>;

    The new percentile statistic for the metric associated with the alarm. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be set to the default.

    property label

    label?: pulumi.Input<string>;

    The label to display for this metric in the graph legend. If this is not specified, the metric is given an autogenerated label that distinguishes it from the other metrics in the widget.

    Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

    property period

    period?: pulumi.Input<number>;

    The new period in seconds over which the specified stat is applied. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be set to the default (300s).

    property region

    region?: undefined | string;

    The region for which you want to display metrics. This value must be Global. The Region dimension is different from the region in which CloudFront metrics are stored, which is US East (N. Virginia).

    property statistic

    statistic?: pulumi.Input<MetricStatistic>;

    The new statistic to apply to the alarm’s associated metric. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be set to the default.

    property unit

    unit?: pulumi.Input<MetricUnit>;

    The new unit for this metric. If this object is missing this property, then no change will be made. However, if the property is there by set to [undefined] then the value will be set to the default.

    property visible

    visible?: pulumi.Input<boolean>;

    Set this to true to have the metric appear in the graph, or false to have it be hidden. The default is true.

    Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

    property yAxis

    yAxis?: pulumi.Input<"left" | "right">;

    Where on the graph to display the y-axis for this metric. The default is left.

    Only used if this metric is displayed in a [Dashboard] with a [MetricWidget].

    type CloudfrontMetricName

    type CloudfrontMetricName = "Requests" | "BytesDownloaded" | "BytesUploaded" | "TotalErrorRate" | "4xxErrorRate" | "5xxErrorRate";

    function errorRate4xx

    errorRate4xx(change?: CloudfrontMetricChange): Metric

    The percentage of all requests for which the HTTP status code is 4xx.

    Valid Statistics: Average Units: Percent

    function errorRate5xx

    errorRate5xx(change?: CloudfrontMetricChange): Metric

    The percentage of all requests for which the HTTP status code is 5xx.

    Valid Statistics: Average Units: Percent

    function metric

    metric(metricName: CloudfrontMetricName, change: CloudfrontMetricChange): Metric

    Creates an AWS/CloudFront metric with the requested [metricName]. See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/monitoring-using-cloudwatch.html for list of all metric-names.

    Note, individual metrics can easily be obtained without supplying the name using the other [metricXXX] functions.

    CloudFront metrics use the CloudFront namespace and provide metrics for two dimensions:

    1. “DistributionId”: The CloudFront ID of the distribution for which you want to display metrics.
    2. “Region”: The region for which you want to display metrics. This value must be Global. The Region dimension is different from the region in which CloudFront metrics are stored, which is US East (N. Virginia).

    function requests

    requests(change?: CloudfrontMetricChange): Metric

    The number of requests for all HTTP methods and for both HTTP and HTTPS requests.

    Valid Statistics: Sum Units: None

    function totalErrorRate

    totalErrorRate(change?: CloudfrontMetricChange): Metric

    The percentage of all requests for which the HTTP status code is 4xx or 5xx.

    Valid Statistics: Average Units: Percent

      Pulumi AI - What cloud infrastructure would you like to build? Generate Program