Skip to content

Instantly share code, notes, and snippets.

@karlsander
Created October 9, 2020 08:37
Show Gist options
  • Save karlsander/5f78bc114258b9f6d15c225d015a349e to your computer and use it in GitHub Desktop.
Save karlsander/5f78bc114258b9f6d15c225d015a349e to your computer and use it in GitHub Desktop.
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