-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit from
pulumi new
output. Successfully deploys a Googl…
…e Cloud Function.
- Loading branch information
Showing
9 changed files
with
2,817 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"recommendations": [ | ||
"hashicorp.terraform", | ||
"rvest.vs-code-prettier-eslint", | ||
"dbaeumer.vscode-eslint", | ||
"mquandalle.graphql", | ||
"gruntfuggly.todo-tree", | ||
"redhat.vscode-yaml" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"eslint.alwaysShowStatus": true, | ||
"eslint.packageManager": "yarn", | ||
"eslint.format.enable": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
}, | ||
"typescript.format.enable": false, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
config: | ||
gcp:project: utility-descent-365911 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: subgraph-cache | ||
description: Caches records from subgraphs in Google Cloud Storage | ||
runtime: nodejs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import * as pulumi from "@pulumi/pulumi"; | ||
import * as gcp from "@pulumi/gcp"; | ||
import { handler } from "./src"; | ||
|
||
const GCP_REGION = "us-central1"; | ||
const BUCKET_NAME = `olympusdao-subgraph-cache-${pulumi.getStack()}`; | ||
|
||
/** | ||
* Define required resources | ||
*/ | ||
|
||
// Create a bucket to store the cached results | ||
const storageBucket = new gcp.storage.Bucket(BUCKET_NAME, { | ||
location: GCP_REGION, | ||
uniformBucketLevelAccess: true, | ||
versioning: { enabled: false }, | ||
}); | ||
|
||
// Export the DNS name of the bucket | ||
export const storageBucketName = storageBucket.url; | ||
|
||
// Create a function | ||
const tokenHolderFunction = new gcp.cloudfunctions.HttpCallbackFunction("token-holders", { | ||
runtime: "nodejs14", | ||
region: GCP_REGION, | ||
callback: (_req: Express.Request, res: Express.Response) => { | ||
handler(); | ||
}, | ||
}); | ||
|
||
export const functionUrl = tokenHolderFunction.httpsTriggerUrl; |
Oops, something went wrong.