Skip to main content

fleet_metrics

Creates, updates, deletes or gets a fleet_metric resource or lists fleet_metrics in a region

Overview

Namefleet_metrics
TypeResource
DescriptionAn aggregated metric of certain devices in your fleet
Idaws.iot.fleet_metrics

Fields

NameDatatypeDescription
metric_namestringThe name of the fleet metric
descriptionstringThe description of a fleet metric
query_stringstringThe Fleet Indexing query used by a fleet metric
periodintegerThe period of metric emission in seconds
aggregation_fieldstringThe aggregation field to perform aggregation and metric emission
query_versionstringThe version of a Fleet Indexing query used by a fleet metric
index_namestringThe index name of a fleet metric
unitstringThe unit of data points emitted by a fleet metric
aggregation_typeobjectAggregation types supported by Fleet Indexing
metric_arnstringThe Amazon Resource Number (ARN) of a fleet metric metric
creation_datestringThe creation date of a fleet metric
last_modified_datestringThe last modified date of a fleet metric
versionnumberThe version of a fleet metric
tagsarrayAn array of key-value pairs to apply to this resource
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTMetricName, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all fleet_metrics in a region.

SELECT
region,
metric_name,
description,
query_string,
period,
aggregation_field,
query_version,
index_name,
unit,
aggregation_type,
metric_arn,
creation_date,
last_modified_date,
version,
tags
FROM aws.iot.fleet_metrics
WHERE region = 'us-east-1';

Gets all properties from an individual fleet_metric.

SELECT
region,
metric_name,
description,
query_string,
period,
aggregation_field,
query_version,
index_name,
unit,
aggregation_type,
metric_arn,
creation_date,
last_modified_date,
version,
tags
FROM aws.iot.fleet_metrics
WHERE region = 'us-east-1' AND data__Identifier = '<MetricName>';

INSERT example

Use the following StackQL query and manifest file to create a new fleet_metric resource, using stack-deploy.

/*+ create */
INSERT INTO aws.iot.fleet_metrics (
MetricName,
region
)
SELECT
'{{ MetricName }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.iot.fleet_metrics
WHERE data__Identifier = '<MetricName>'
AND region = 'us-east-1';

Permissions

To operate on the fleet_metrics resource, the following permissions are required:

Create

iot:CreateFleetMetric,
iot:DescribeFleetMetric,
iot:TagResource

Read

iot:DescribeFleetMetric,
iot:ListTagsForResource

Update

iot:UpdateFleetMetric,
iot:DescribeFleetMetric,
iot:ListTagsForResource,
iot:UntagResource,
iot:TagResource

Delete

iot:DeleteFleetMetric,
iot:DescribeFleetMetric

List

iot:ListFleetMetrics