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_eventgrid_system_topic doesn't support 'Microsoft.PolicyInsights.PolicyStates' topic type #11523

Closed
matt-ward-airwalk opened this issue Apr 29, 2021 · 4 comments · Fixed by #11746

Comments

@matt-ward-airwalk
Copy link

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 (and AzureRM Provider) Version

Terraform 0.14.10
AzureRM 2.56.0

Affected Resource(s)

azurerm_eventgrid_system_topic

Terraform Configuration Files

resource "azurerm_eventgrid_system_topic" "main" {
  name                   = "example-system-topic"
  location               = "Global"
  resource_group_name    = azurerm_resource_group.main.name
  source_arm_resource_id = data.azurerm_subscription.current.subscription_id
  topic_type             = "Microsoft.PolicyInsights.PolicyStates"
}

Expected Behaviour

System topic should be created with a type of event set as "Microsoft.PolicyInsights.PolicyStates"

Actual Behaviour

Fails with;

Error: expected topic_type to be one of [Microsoft.AppConfiguration.ConfigurationStores Microsoft.Communication.CommunicationServices Microsoft.ContainerRegistry.Registries Microsoft.Devices.IoTHubs Microsoft.EventGrid.Domains Microsoft.EventGrid.Topics Microsoft.Eventhub.Namespaces Microsoft.KeyVault.vaults Microsoft.MachineLearningServices.Workspaces Microsoft.Maps.Accounts Microsoft.Media.MediaServices Microsoft.Resources.ResourceGroups Microsoft.Resources.Subscriptions Microsoft.ServiceBus.Namespaces Microsoft.SignalRService.SignalR Microsoft.Storage.StorageAccounts Microsoft.Web.ServerFarms Microsoft.Web.Sites], got Microsoft.PolicyInsights.PolicyStates

@favoretti
Copy link
Collaborator

Hi there and thank you for reporting this. When I look at the code, the topic type is just a string, which tells me that the error you're getting is coming from the API itself, rather than being a provider limitation. Are you able to create a system topic of that particular type using the portal and if so, can you see which API version does portal use?

@matt-ward-airwalk
Copy link
Author

I've tested this on the most recent provider and it's now working as expected. So assume the changes to System Event Topic that were included, have also resolved this behaviour

@favoretti
Copy link
Collaborator

Interesting. Didn't work for me until I upgraded the API. Oh well, this won't hurt either I suppose :)

favoretti added a commit to gro1m/terraform-provider-azurerm that referenced this issue May 26, 2021
Which inherently introduces `Microsoft.PolicyInsights.PolicyStates`
system topic type.

```
$ TF_ACC=1 go test -v ./azurerm/internal/services/eventgrid -timeout=1000m -run 'TestAccEventGridSystemTopic_policyStates'
2021/05/17 14:03:50 [DEBUG] not using binary driver name, it's no longer needed
2021/05/17 14:03:50 [DEBUG] not using binary driver name, it's no longer needed
=== RUN   TestAccEventGridSystemTopic_policyStates
=== PAUSE TestAccEventGridSystemTopic_policyStates
=== CONT  TestAccEventGridSystemTopic_policyStates
--- PASS: TestAccEventGridSystemTopic_policyStates (141.65s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/eventgrid	143.004s
```

Fixes: hashicorp#11523
@github-actions
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 Jun 17, 2021
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.

2 participants