-
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
New Resource: azurerm_eventgrid_event_subscription
#2967
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pr @mbfrahry,
I've left some comments inline, mostly regarding additional validation. Once thats sorted this should be good to merge.
Type: schema.TypeString, | ||
Required: true, | ||
ForceNew: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we get some validation here? at the very least validate.NoEmptyStrings
Type: schema.TypeString, | ||
Required: true, | ||
ForceNew: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we get some validation here? at the very least validate.NoEmptyStrings
"storage_account_id": { | ||
Type: schema.TypeString, | ||
Required: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we validate this resource id? azure.ValidateResourceId
"queue_name": { | ||
Type: schema.TypeString, | ||
Required: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we get some validation here? at the very least validate.NoEmptyStrings
"eventhub_id": { | ||
Type: schema.TypeString, | ||
Required: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COuld we validate this resource id?
"event_time_to_live": { | ||
Type: schema.TypeInt, | ||
Required: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a valid rage we could validate here?
func expandEventGridEventSubscriptionFilter(d *schema.ResourceData) *eventgrid.EventSubscriptionFilter { | ||
filter := &eventgrid.EventSubscriptionFilter{} | ||
|
||
if includedEvents, ok := d.GetOk("included_event_types"); ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be replaced with utils.ExpandeStringArray
?
return nil | ||
} | ||
|
||
func expandEventGridEventSubscriptionLabels(d *schema.ResourceData) *[]string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be replaced with utils.ExpandStringArray
?
|
||
resource "azurerm_eventgrid_event_subscription" "default" { | ||
name = "defaultEventSubscription" | ||
scope = "${azurerm_resource_group.default.id}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we fix the formatting/alignment here?
* `hybrid_connection_endpoint` - (Optional) A `hybrid_connection_endpoint` block as defined below. | ||
|
||
* `webhook_endpoint` - (Optional) A `webhook_endpoint` block as defined below. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a note letting readers know that one of the above blocks is required?
}, | ||
"case_sensitive": { | ||
Type: schema.TypeBool, | ||
Optional: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by being Optional this implicitly has a default of false
, which is may be worth highlighting in the docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
azurerm_eventgrid_subscription
azurerm_eventgrid_subscription
azurerm_eventgrid_event_subscription
Thanks for the review @katbyte and @tombuildsstuff. I believe I've addressed all the comments |
Co-Authored-By: mbfrahry <mbfrahry@gmail.com>
Thanks for the updates! LGTM now 🚀 |
This has been released in version 1.23.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 = "~> 1.23.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 👉 hashibot-feedback@hashicorp.com. Thanks! |
This PR adds eventgrid event subscription to the azure provider. Addresses #1794.