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

New Resource: EventGrid Subscriptions #1794

Closed
gregjhogan opened this issue Aug 19, 2018 · 7 comments
Closed

New Resource: EventGrid Subscriptions #1794

gregjhogan opened this issue Aug 19, 2018 · 7 comments
Assignees
Milestone

Comments

@gregjhogan
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

Description

There appears to currently be no support for creating azure event grid subscriptions (e.g. subscribing to storage account blob create/delete events)

New or Affected Resource(s)

  • azurerm_eventgrid_subscription (new)

Potential Terraform Configuration

resource "azurerm_eventgrid_subscription" "test" {
    name = "test"
    resource_group_name = "${azurerm_resource_group.test.name}"
    location = "${azurerm_resource_group.test.location}"
    topic = "${azurerm_storage_account.test.id}" # resource id
    destination = {
        endpointType = "WebHook"
        endpointUrl = "https://<webhook-url>"
        # or the following for event hub subscriptions
        #endpointType = "EventHub"
        #resourceId = ""
    }
    # filter should be optional
    filter = {
        includedEventTypes = [ "all" ] # default
        subjectBeginsWith = "" # default
        subjectEndsWith = "" # default
        isSubjectCaseSensitive = true # applies to subject begins/ends with
    }
    # labels should be optional
    labels = [ "label1", "label2" ]
}

References

@tombuildsstuff tombuildsstuff changed the title add azure event grid subscription resource support New Resource: EventGrid Subscriptions Aug 21, 2018
@LaurentLesle
Copy link
Contributor

I need it and link it to route Azure activity logs to an enventhub sitting in another subscription.

In the EventSubscription details I want to be able to specify the Event Schema to "Same as Input Schema"

@zgqallen
Copy link

I need the similar resource, but with the end point is queue.

@timmyreilly
Copy link

timmyreilly commented Dec 4, 2018

As a workaround I created the Event Grid Subscription using the 'azurerm_template_deployment' resource. My use case was from Azure Storage to Event Hub. I've generalized it and uploaded a gist here: https://gist.github.com/timmyreilly/6839d0e6014167ecf68f720cb0f7794f

@phosphre is right! Check his reply below before continuing with this approach.

@ghost
Copy link

ghost commented Feb 1, 2019

@timmyreilly an interesting sojourn, but for other readers finding themselves here, we are wise to note the warning on the HashiCorp doc on azurerm_template_deployment resources in respect of resources unmanaged by TF being left behind and requiring separate clean up.

@mbfrahry
Copy link
Member

Hey all, thanks for opening this issue. Event subscriptions for EventGrid has been merged via #2967 and will make it into the next release.

@ghost
Copy link

ghost commented Mar 8, 2019

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 ...

@ghost
Copy link

ghost commented Mar 31, 2019

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!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants