Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing custom metrics using the resource oci_apm_config_config gives 404 error #2245

Open
ritikMahajanOHAI opened this issue Nov 20, 2024 · 7 comments
Labels
bug In-Progress Terraform Team is working on the reproduce & fix

Comments

@ritikMahajanOHAI
Copy link

ritikMahajanOHAI commented Nov 20, 2024

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 "me too" comments, 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 Version and Provider Version

Terraform v1.6.2
on linux_amd64

  • provider registry.terraform.io/hashicorp/oci v6.18.0
  • provider registry.terraform.io/oracle/oci v6.18.0

Affected Resource(s)

Data Source: oci_apm_config_config

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. 
# Please remove any sensitive information from configuration files before sharing them. 

terraform {
  required_providers {
    oci = {
      source  = "oracle/oci"
      version = "~>6.18"
    }
  }
}

resource "oci_apm_config_config" "custom_metrics" {
  for_each       = var.metrics
  apm_domain_id  = var.apm_domain_id
  config_type    = "OPTIONS"
  display_name   = each.key
  group          = "custom-metric"

  options = jsonencode({
    name             = each.key
    spanFilterId     = lookup(each.value, "span_filter_id", null)
    spanFilterText   = lookup(each.value, "span_filter_text", null)
    valueSource      = each.value["value_source"]
    compartment      = var.compartment_id
    anomalyDetection = each.value["anomaly_detection"]
    dimensions       = lookup(each.value, "dimensions", [])
    namespace        = "oracle_apm_custom"
    resourceGroup    = lookup(each.value, "resource_group", null)
    unit             = lookup(each.value, "unit", null)
  })
}

Debug Output

https://gist.github.com/ritikMahajanOHAI/bcbf87c11bf2b4adf0bb86cea5ecc61e

Panic Output

Expected Behavior

The resource should have been updated.

Actual Behavior

Getting 404 error.

Steps to Reproduce

1 - Create a new custom metric using terraform.
2 - Edit the newly created custom metric by updating the tfvars file.
3 - terraform plan creates a valid plan but terraform update gives error.

  1. terraform apply

Important Factoids

References

@ritikMahajanOHAI ritikMahajanOHAI changed the title Editing custom metrics using the resource oci_apm_config_config Editing custom metrics using the resource oci_apm_config_config gives 404 error Nov 20, 2024
@tf-oci-pub tf-oci-pub added the In-Progress Terraform Team is working on the reproduce & fix label Nov 20, 2024
@tf-oci-pub
Copy link
Member

Thank you for reporting the issue. We have raised an internal ticket to track this. Our service engineers will get back to you.

@iliassox
Copy link

Hello @ritikMahajanOHAI ! I want to reproduce your issue so that I can hopefully be able to help, what kind of changes did you make in the tfvars file?

@ritikMahajanOHAI
Copy link
Author

I had just removed one of the dimension from the created custom_metric.

@iliassox
Copy link

There seems to be an issue with how the update works, currently as a workaround you can try to removing and recreating the resource as the create works fine.

@ritikMahajanOHAI
Copy link
Author

@iliassox Thanks for checking and acknowledging the issue.
Kindly let us know when can we expect update functionality to be fixed for oci_apm_config_config resource as our scenario requires that we are able to update this resource.

@iliassox
Copy link

There is no ETA at the moment but I'll update you once we have an idea. 👍

@ritikMahajanOHAI
Copy link
Author

hi @iliassox
Kindly provide an update here.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug In-Progress Terraform Team is working on the reproduce & fix
Projects
None yet
Development

No branches or pull requests

3 participants