-
-
Save karlsander/5f78bc114258b9f6d15c225d015a349e to your computer and use it in GitHub Desktop.
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
import * as awsx from "@pulumi/awsx"; | |
const hasuraConfig = [ | |
{ | |
name: "HASURA_GRAPHQL_ADMIN_SECRET", | |
value: "testSecretNotSecure" | |
}, | |
{ | |
name: "HASURA_GRAPHQL_DATABASE_URL", | |
value: `postgres://user:pw@thisisprobablyrequired.com/dbname` | |
}, | |
{ | |
name: "HASURA_GRAPHQL_ENABLE_CONSOLE", | |
value: `true` | |
}, | |
]; | |
const targetGroup = new awsx.lb.ApplicationTargetGroup("hasura-lb-target-group", { | |
port: 8080, | |
protocol: "HTTP", | |
healthCheck: { | |
port: "8080", | |
protocol: "HTTP", | |
path: "/healthz" | |
} | |
}); | |
const hasuraLB = new awsx.lb.ApplicationListener("hasura-lb-https-443", { | |
port: 80, | |
protocol: "HTTP", | |
targetGroup: targetGroup | |
}); | |
const hasura = new awsx.ecs.FargateService("hasura", { | |
taskDefinitionArgs: { | |
containers: { | |
hasura: { | |
image: `hasura/graphql-engine`, | |
memory: 1024, | |
portMappings: [targetGroup], | |
environment: hasuraConfig | |
} | |
} | |
}, | |
desiredCount: 1 | |
}); | |
export const url = hasuraLB.endpoint.hostname; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment