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

azurerm_sentinel_threat_intelligence_indicator getting plugin issue importing resources #26926

Closed
1 task done
darentwh opened this issue Aug 5, 2024 · 2 comments · Fixed by #26976
Closed
1 task done

Comments

@darentwh
Copy link

darentwh commented Aug 5, 2024

Is there an existing issue for this?

  • I have searched the existing issues

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 comments along the lines of "+1", "me too" or "any updates", 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 and review the contribution guide to help.

Terraform Version

1.6.6

AzureRM Provider Version

3.113.0

Affected Resource(s)/Data Source(s)

"azurerm_sentinel_threat_intelligence_indicator

Terraform Configuration Files

resource "azurerm_sentinel_threat_intelligence_indicator" "url" {
  for_each            = { for ioc in local.threat_indicators: ioc.name => ioc }
  workspace_id        = data.azurerm_log_analytics_workspace.loga_obj.id
  pattern_type        = each.value.parsedPattern[0].patternTypeKey
  pattern             = each.value.pattern
  source              = each.value.source
  display_name        = each.value.displayName
  description         = each.value.description != "" ? each.value.description : "No Description"
  tags                = each.value.threatIntelligenceTags
  revoked             = false 
  validate_from_utc   = each.value.validFrom
}

import {
  for_each = { for ioc in local.threat_indicators: ioc.name => ioc }
  id       = <resource_id>
  to       = azurerm_sentinel_threat_intelligence_indicator.url["each.key"]
}

Debug Output/Panic Output

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x662452f]

goroutine 185 [running]:
github.com/hashicorp/terraform-provider-azurerm/internal/services/sentinel.(*ThreatIntelligenceIndicator).Read.ThreatIntelligenceIndicator.Read.func1({0x8a55968, 0xc001bac460}, {0xc001bf9b00, {0x8a582c0, 0xc000ada108}, 0xc00269b780, 0x0, {0x8a59210, 0xe0c15e0}})
	github.com/hashicorp/terraform-provider-azurerm/internal/services/sentinel/sentinel_threat_intelligence_indicator_resource.go:695 +0x40f
github.com/hashicorp/terraform-provider-azurerm/internal/sdk.(*ResourceWrapper).Resource.func3({0x8a55968, 0xc001bac460}, 0x0?, {0x7245380?, 0xc001bf9b00?})
	github.com/hashicorp/terraform-provider-azurerm/internal/sdk/wrapper_resource.go:68 +0x145
github.com/hashicorp/terraform-provider-azurerm/internal/sdk.(*ResourceWrapper).Resource.(*ResourceWrapper).diagnosticsWrapper.diagnosticsWrapper.func11({0x8a55968?, 0xc001bac460?}, 0x0?, {0x7245380?, 0xc001bf9b00?})
	github.com/hashicorp/terraform-provider-azurerm/internal/sdk/wrapper_resource.go:192 +0x59
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc000acb880, {0x8a558c0, 0xc002810f60}, 0xd?, {0x7245380, 0xc001bf9b00})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:795 +0x11b
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc000acb880, {0x8a558c0, 0xc002810f60}, 0xc001aa8c30, {0x7245380, 0xc001bf9b00})
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:1089 +0x552
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0xc00098cd38, {0x8a558c0?, 0xc002810e70?}, 0xc002695a00)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:649 +0x48a
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0xc000fca640, {0x8a558c0?, 0xc002810480?}, 0xc000305ce0)
	github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:789 +0x48b
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0x7ed90e0?, 0xc000fca640}, {0x8a558c0, 0xc002810480}, 0xc001c3bd50, 0x0)
	github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:431 +0x169
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0004da000, {0x8a805c0, 0xc00176a1a0}, 0xc002111560, 0xc001743dd0, 0xe081468, 0x0)
	google.golang.org/[email protected]/server.go:1374 +0xde7
google.golang.org/grpc.(*Server).handleStream(0xc0004da000, {0x8a805c0, 0xc00176a1a0}, 0xc002111560, 0x0)
	google.golang.org/[email protected]/server.go:1751 +0x9e7
google.golang.org/grpc.(*Server).serveStreams.func1.1()
	google.golang.org/[email protected]/server.go:986 +0xbb
created by google.golang.org/grpc.(*Server).serveStreams.func1 in goroutine 35
	google.golang.org/[email protected]/server.go:997 +0x145

Error: The terraform-provider-azurerm_v3.113.0_x5 plugin crashed!

Expected Behaviour

resources should be imported into state

Actual Behaviour

No response

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@ziyeqf
Copy link
Contributor

ziyeqf commented Aug 9, 2024

Hi @darentwh, thanks for reporting.

I submitted a PR(#26976) to fix t his, once it merged this should be fixed.

For any further questions please leave comments.
Thanks

@github-actions github-actions bot added this to the v3.116.0 milestone Aug 9, 2024
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants