Currently there is no way to create/lookup AWS IoT Defender metrics with the AWS Terraform provider. This functionality is supported both by the AWS CLI and the awscc provider technical preview.
Requested Resource(s) and/or Data Source(s)
aws_iot_custom_metric resource
aws_iot_custom_metric data source
aws_iot_custom_metrics data source
Potential Terraform Configuration
resource "aws_iot_custom_metric" "heap_space" {
metric_name = "Heap_AvailableSpaceInBytes"
display_name = "Heap / Available Space in Bytes"
metric_type = "number"
tags = {
Name = "Heap_AvailableSpaceInBytes"
Service = "IoT Core"
}
}
data "aws_iot_custom_metric" "heap_space" {
metric_name = "Heap_AvailableSpaceInBytes"
}
data "aws_iot_custom_metrics" "all_metrics" {}
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Description
Currently there is no way to create/lookup AWS IoT Defender metrics with the AWS Terraform provider. This functionality is supported both by the AWS CLI and the awscc provider technical preview.
Requested Resource(s) and/or Data Source(s)
aws_iot_custom_metric
resourceaws_iot_custom_metric
data sourceaws_iot_custom_metrics
data sourcePotential Terraform Configuration
References
https://docs.aws.amazon.com/iot/latest/apireference/API_CreateCustomMetric.html
https://docs.aws.amazon.com/iot/latest/apireference/API_DescribeCustomMetric.html
https://docs.aws.amazon.com/iot/latest/apireference/API_UpdateCustomMetric.html
https://docs.aws.amazon.com/iot/latest/apireference/API_DeleteCustomMetric.html
https://docs.aws.amazon.com/iot/latest/apireference/API_ListCustomMetrics.html
https://registry.terraform.io/providers/hashicorp/awscc/latest/docs/resources/iot_custom_metric
https://registry.terraform.io/providers/hashicorp/awscc/latest/docs/data-sources/iot_custom_metric
https://registry.terraform.io/providers/hashicorp/awscc/latest/docs/data-sources/iot_custom_metrics
Would you like to implement a fix?
No