terraform-provider-ibm icon indicating copy to clipboard operation
terraform-provider-ibm copied to clipboard

ibm_cos_bucket should report an error if the target Monitoring service is not marked "Platform Metrics"

Open l2fprod opened this issue 3 years ago • 1 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform IBM Provider Version

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cos_bucket#metrics_monitoring.metrics_monitoring_crn

Affected Resource(s)

  • ibm_cos_bucket

Terraform Configuration Files

The example in https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/cos_bucket#metrics_monitoring.metrics_monitoring_crn should show the problem.

The monitoring service instance used in metrics_monitoring needs to be set as default_receiver (Platform Metrics) for the monitoring data to be received. This is described in https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-mm-cos-integration#mm-cos-connection-dashboard

resource "ibm_cos_bucket" "standard-ams03-firewall" {
  bucket_name           = "a-standard-bucket-at-ams-firewall"
  resource_instance_id  = ibm_resource_instance.cos_instance.id
  cross_region_location = "us"
  storage_class         = "standard"
  activity_tracking {
    read_data_events     = true
    write_data_events    = true
    activity_tracker_crn = ibm_resource_instance.activity_tracker.id
  }
  metrics_monitoring {
    usage_metrics_enabled  = true
    metrics_monitoring_crn = ibm_resource_instance.metrics_monitor.id
  }
  allowed_ip = ["223.196.168.27", "223.196.161.38", "192.168.0.1"]
}

Expected Behavior

  • provider should raise an error if the target Monitoring instance is not marked as platform metrics
  • example should use parameters = { "default_receiver" = true } on the Monitoring instance

l2fprod avatar Apr 23 '21 19:04 l2fprod

We had released Support request_metrics_enabled for COS Bucket metric monitoring to support platform metrics for request_metrics. https://github.com/IBM-Cloud/terraform-provider-ibm/pull/2530

Priyaranimishra avatar Jun 20 '22 07:06 Priyaranimishra

@l2fprod Is there anything more needed on this else we will be closing the ticket. Thank you.

IBM-diksha avatar Jun 14 '23 05:06 IBM-diksha

@IBM-diksha

  1. The example now uses parameters = { "default_receiver" = true } on the Monitoring instance
  2. However in #2530 I don't see any changes that would raise an error if the target Monitoring instance is not marked as platform metrics

l2fprod avatar Jun 14 '23 13:06 l2fprod