Skip to content

Commit

Permalink
chore: Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
simenandre committed Sep 2, 2021
1 parent e38a259 commit 7eccaaa
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions examples/pulumi.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import * as gcp from "@pulumi/gcp";
import * as pulumi from "@pulumi/pulumi";
import { makeHandler } from "gcl-slack";
import { handlePubSubMessage } from "pubsub-http-handler";
import * as gcp from '@pulumi/gcp';
import * as pulumi from '@pulumi/pulumi';
import { makeHandler } from 'gcl-slack';
import { handlePubSubMessage } from 'pubsub-http-handler';

const name = "slack";
const name = 'slack';

export const topic = new gcp.pubsub.Topic(name, {}, { provider });

const config = new pulumi.Config(name);

topic.onMessagePublished(name, {
region: "europe-west1",
runtime: "nodejs14",
region: 'europe-west1',
runtime: 'nodejs14',
environmentVariables: {
WEBHOOK_URL: config.require("webhook-url"),
WEBHOOK_URL: config.require('webhook-url'),
},
callback: async (message) => {
const handler = makeHandler({
type: "webhook",
webhookOptions: { url: process.env.WEBHOOK_URL ?? "" },
type: 'webhook',
webhookOptions: { url: process.env.WEBHOOK_URL ?? '' },
});

await handlePubSubMessage({
Expand All @@ -36,6 +36,6 @@ const logSink = new gcp.logging.ProjectSink(name, {

new gcp.pubsub.TopicIAMMember(name, {
topic: topic.name,
role: "roles/pubsub.publisher",
role: 'roles/pubsub.publisher',
member: logSink.writerIdentity,
});

0 comments on commit 7eccaaa

Please sign in to comment.