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

Event Grid Trigger #302

Merged
merged 5 commits into from
Jul 15, 2019
Merged

Conversation

mikhailshilkov
Copy link
Member

@mikhailshilkov mikhailshilkov commented Jul 12, 2019

Support Event Grid as Azure Functions trigger, specifically

  • Blob Created/Deleted events
  • Resource Group events

See the new example for API.

Covers most of #295.

opts);

const keys = pulumi.output(this.functionApp.getHostKeys());
const key = keys.apply(keys => keys.systemKeys["eventgrid_extension"]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be able to write this as: keys.systemKeys["eventgrid_extension"] :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does that work? I thought I can't dot into an Output?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return new EventGridCallbackSubscription(
name, { id: this.id, resourceGroupName: this.name },
args, { parent: this, ...opts });
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm on the fence about this. How core do you think this functionality is? Do people listen to resource group events a lot? I ask since i think of ResourceGroup as a very core type, and it feels like a slightly strange one-off coupling between ResourceGroup and EventGrid.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea, probably not too much. I've never used it before, but thought it's a decent use case. What's the alternative?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as an example, for awsx we decided to invert this for things like metrics. Instead of exposing off the resources, you can just go into each package and work with the metrics. I somewhat feel like this should be gotten through the eventgrid module and you can say "i'd like the event grid events for these N different resource types".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give an example of a call that you have in mind? EventGrid.onResouceGroup(resrouceGroup, {...})?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give an example of a call that you have in mind? EventGrid.onResouceGroup(resrouceGroup, {...})?

Right. it could even be a top level module function. like eventGrid.onResourceGroupEvent. It might be in a sub-module. For example, in awsx, we do this:

awsx.cognito.metrics.compromisedCredentialsRisk(...).

So i'd be interested in exploring:

azure.eventhub.onResourceGroupGridEvent(...) or
azure.eventhub.events.onResourceGroupdGridEvent(...).

@@ -635,7 +635,7 @@ export class EventGridCallbackSubscription<T> extends appservice.EventSubscripti
opts);

const keys = pulumi.output(this.functionApp.getHostKeys());
const key = keys.apply(keys => keys.systemKeys["eventgrid_extension"]);
const key = keys.systemKeys["eventgrid_extension"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@CyrusNajmabadi
Copy link
Contributor

Thanks!

@CyrusNajmabadi CyrusNajmabadi merged commit eb0cd00 into master Jul 15, 2019
@pulumi-bot pulumi-bot deleted the mikhailshilkov/event-grid-trigger branch July 15, 2019 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants