-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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_event_subscription support advanced filtering #3452
Comments
Some examples can be found in the documentation "filter": {
"advancedFilters": [
{
"operatorType": "NumberGreaterThanOrEquals",
"key": "Data.Key1",
"value": 5
},
{
"operatorType": "StringContains",
"key": "Subject",
"values": ["container1", "container2"]
}
]
}
|
This should probably go in a new section as you can have both subject_filter {
subject_begins_with = "xyz"
}
advanced_filter {
operator = "NumberGreaterThanOrEquals"
key = "Data.Key1"
value = 5
}
advanced_filter {
operator = "StringContains"
key = "Subject"
values = [
"xyzcontainer1",
"xyzcontainer2"
]
} |
Is there anyone that could take a look at this? We've had to make do with ARM templates for the past 7 months. |
Hi @BadgerCode your proposed syntax would be really nice and clean, but unfortunately TF schema and state handling would not be that nice. example.tf resource "azurerm_eventgrid_event_subscription" "example" {
[...]
advanced_filter {
key = "subject"
operator = "StringContains"
values = [
"virtualMachines",
"storageAccounts"
]
}
advanced_filter {
key = "Data.AnyNumber"
operator = "NumberGreaterThanOrEquals"
value = 42
}
} terraform.tfstate: {
"version": 4,
"terraform_version": "0.12.21",
"serial": 0,
"lineage": "",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "azurerm_eventgrid_event_subscription",
"name": "example",
"provider": "provider.azurerm",
"instances": [
{
"schema_version": 0,
"attributes": {
"advanced_filter": [
{
"key": "subject",
"operator_type": "StringContains",
"value": null,
"values": [
"virtualMachines",
"storageAccounts"
]
},
{
"key": "Data.AnyNumber",
"operator_type": "NumberGreaterThanOrEquals",
"value": "42",
"values": null
}
],
[...]
}
]
}
]
}
Advantages:
Disadvantages:
Disadvantages to accept if no dedicated scope for each operator type should be implemented:
I've created an implementation providing two: |
This has been released in version 2.13.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.13.0"
}
# ... other configuration ... |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Community Note
Description
Looking for the advanced filtering option. Presently it has subject filtering for beginswith and endswith which is good, but my use-case was to use the advance filter to search the subject for a string that's contained in the subject "i.e. virtualMachines, storageAccounts".
New or Affected Resource(s)
Potential Terraform Configuration
subject_filter {
string_contains = "blah"
}
References
The text was updated successfully, but these errors were encountered: