From dc3a96381632ccf0fdb057f3b72087e35375915f Mon Sep 17 00:00:00 2001 From: Josh Adams Date: Fri, 26 Jan 2024 14:09:49 -0600 Subject: [PATCH 1/7] Just some TODOs --- infra/files/files.ts | 1 + infra/helpers/runDockerImageBashScript.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/infra/files/files.ts b/infra/files/files.ts index 81737a89e7..fdd0c29a09 100644 --- a/infra/files/files.ts +++ b/infra/files/files.ts @@ -38,6 +38,7 @@ const instance = new aws.ec2.Instance("files-instance", { ) ), }); +// TODO: Give it a public ip and use that for a domain...or don't do a healthcheck over port 80 // const domain = config.require("domain"); // // Get the hosted zone ID for domain diff --git a/infra/helpers/runDockerImageBashScript.ts b/infra/helpers/runDockerImageBashScript.ts index facc61d19f..0a2521ec17 100644 --- a/infra/helpers/runDockerImageBashScript.ts +++ b/infra/helpers/runDockerImageBashScript.ts @@ -82,6 +82,7 @@ sudo docker run -d \ --env-file .env \ ${ecrRegistryUrl}/${imageRepositoryName}:${imageTag} +# TODO: In preview environments we should disable datadog echo 'Setting up Datadog agent' docker run -d --name datadog-agent \ --env-file .env \ From cb936a1cb21f8a42aea134448311d986f05440ab Mon Sep 17 00:00:00 2001 From: Josh Adams Date: Fri, 26 Jan 2024 14:40:02 -0600 Subject: [PATCH 2/7] Fix a typo for the icon alt --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 92f109ac6f..5883825536 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![Twitter Follow](https://img.shields.io/twitter/follow/QuadraticHQ) ![quadraticlogo4 1](https://user-images.githubusercontent.com/3479421/162037216-2fea1620-2310-4cfa-96fb-31299195e3a9.png) -## ![quardatic icon small](https://user-images.githubusercontent.com/3479421/162039117-02f85f2c-e382-4ed8-ac39-64efab17a144.svg) **_The data science spreadsheet_** +## ![quadratic icon small](https://user-images.githubusercontent.com/3479421/162039117-02f85f2c-e382-4ed8-ac39-64efab17a144.svg) **_The data science spreadsheet_** Infinite data grid with Python, JavaScript, and SQL built-in. Data Connectors to pull in your data. From d14999fc65fd1a3428bda996528a70a49060cc40 Mon Sep 17 00:00:00 2001 From: Thomas Miller Date: Sat, 27 Jan 2024 17:43:09 -0600 Subject: [PATCH 3/7] Setup a FDQN for files' health check --- infra/files/files.ts | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/infra/files/files.ts b/infra/files/files.ts index fdd0c29a09..2f426e09e7 100644 --- a/infra/files/files.ts +++ b/infra/files/files.ts @@ -14,6 +14,8 @@ const quadraticApiUri = config.require("quadratic-api-uri"); // Configuration from Pulumi ESC const instanceSize = config.require("files-instance-size"); +const domain = config.require("domain"); + const instance = new aws.ec2.Instance("files-instance", { tags: { @@ -38,31 +40,23 @@ const instance = new aws.ec2.Instance("files-instance", { ) ), }); -// TODO: Give it a public ip and use that for a domain...or don't do a healthcheck over port 80 -// const domain = config.require("domain"); -// // Get the hosted zone ID for domain -// const hostedZone = pulumi.output( -// aws.route53.getZone( -// { -// name: domain, -// }, -// { async: true } -// ) -// ); +// Get the hosted zone ID for domain +const hostedZone = pulumi.output( + aws.route53.getZone( + { + name: domain, + }, + { async: true } + ) +); -// // Create a Route 53 record pointing to EC2 instance -// const dnsRecord = new aws.route53.Record("multiplayer-r53-record", { -// zoneId: hostedZone.id, -// name: `${filesSubdomain}.${domain}`, // subdomain you want to use -// type: "A", -// aliases: [ -// { -// name: instance.arn, -// zoneId: instance.availabilityZone.apply((az) => az), -// evaluateTargetHealth: true, -// }, -// ], -// }); +// Create a Route 53 record pointing to EC2 instance +const dnsRecord = new aws.route53.Record("files-r53-record", { + zoneId: hostedZone.id, + name: `${filesSubdomain}.${domain}`, // subdomain you want to use + type: "A", + records: [instance.publicIp], +}); -export const filesPublicDns = instance.publicDns; +export const filesPublicDns = dnsRecord.fqdn; From 87790ac301542ff1215e1d66471552b029376372 Mon Sep 17 00:00:00 2001 From: Thomas Miller Date: Sat, 27 Jan 2024 17:57:21 -0600 Subject: [PATCH 4/7] Add ttl --- infra/files/files.ts | 1 + infra/shared/securityGroups.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/infra/files/files.ts b/infra/files/files.ts index 2f426e09e7..4e4ae30222 100644 --- a/infra/files/files.ts +++ b/infra/files/files.ts @@ -56,6 +56,7 @@ const dnsRecord = new aws.route53.Record("files-r53-record", { zoneId: hostedZone.id, name: `${filesSubdomain}.${domain}`, // subdomain you want to use type: "A", + ttl: "300", records: [instance.publicIp], }); diff --git a/infra/shared/securityGroups.ts b/infra/shared/securityGroups.ts index 626fd8d378..923fa51a41 100644 --- a/infra/shared/securityGroups.ts +++ b/infra/shared/securityGroups.ts @@ -4,7 +4,7 @@ import * as aws from "@pulumi/aws"; export const filesEc2SecurityGroup = new aws.ec2.SecurityGroup("files-sg", { ingress: [ // TODO: remove SSH Access - { protocol: "tcp", fromPort: 22, toPort: 22, cidrBlocks: ["0.0.0.0/0"] }, + // { protocol: "tcp", fromPort: 22, toPort: 22, cidrBlocks: ["0.0.0.0/0"] }, { protocol: "tcp", fromPort: 80, @@ -41,7 +41,7 @@ export const multiplayerEc2SecurityGroup = new aws.ec2.SecurityGroup( { ingress: [ // TODO: remove SSH Access - { protocol: "tcp", fromPort: 22, toPort: 22, cidrBlocks: ["0.0.0.0/0"] }, + // { protocol: "tcp", fromPort: 22, toPort: 22, cidrBlocks: ["0.0.0.0/0"] }, { protocol: "tcp", fromPort: 80, From bb0b0600dbbbf5134683cd53d4c864b7305cda46 Mon Sep 17 00:00:00 2001 From: Thomas Miller Date: Sat, 27 Jan 2024 18:06:53 -0600 Subject: [PATCH 5/7] Use a number for ttl --- infra/files/files.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra/files/files.ts b/infra/files/files.ts index 4e4ae30222..ae73ac4f91 100644 --- a/infra/files/files.ts +++ b/infra/files/files.ts @@ -56,7 +56,7 @@ const dnsRecord = new aws.route53.Record("files-r53-record", { zoneId: hostedZone.id, name: `${filesSubdomain}.${domain}`, // subdomain you want to use type: "A", - ttl: "300", + ttl: 300, records: [instance.publicIp], }); From bbc92551d9101025c81da3afcc7b55b6c1d6c4c2 Mon Sep 17 00:00:00 2001 From: Thomas Miller Date: Sat, 27 Jan 2024 18:20:23 -0600 Subject: [PATCH 6/7] re-enable ssh --- infra/shared/securityGroups.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infra/shared/securityGroups.ts b/infra/shared/securityGroups.ts index 923fa51a41..626fd8d378 100644 --- a/infra/shared/securityGroups.ts +++ b/infra/shared/securityGroups.ts @@ -4,7 +4,7 @@ import * as aws from "@pulumi/aws"; export const filesEc2SecurityGroup = new aws.ec2.SecurityGroup("files-sg", { ingress: [ // TODO: remove SSH Access - // { protocol: "tcp", fromPort: 22, toPort: 22, cidrBlocks: ["0.0.0.0/0"] }, + { protocol: "tcp", fromPort: 22, toPort: 22, cidrBlocks: ["0.0.0.0/0"] }, { protocol: "tcp", fromPort: 80, @@ -41,7 +41,7 @@ export const multiplayerEc2SecurityGroup = new aws.ec2.SecurityGroup( { ingress: [ // TODO: remove SSH Access - // { protocol: "tcp", fromPort: 22, toPort: 22, cidrBlocks: ["0.0.0.0/0"] }, + { protocol: "tcp", fromPort: 22, toPort: 22, cidrBlocks: ["0.0.0.0/0"] }, { protocol: "tcp", fromPort: 80, From 078fcdc426b6c71d2b2460dcea0406caa783fff2 Mon Sep 17 00:00:00 2001 From: Thomas Miller Date: Sat, 27 Jan 2024 18:27:21 -0600 Subject: [PATCH 7/7] Remove SG again --- infra/shared/securityGroups.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infra/shared/securityGroups.ts b/infra/shared/securityGroups.ts index 626fd8d378..923fa51a41 100644 --- a/infra/shared/securityGroups.ts +++ b/infra/shared/securityGroups.ts @@ -4,7 +4,7 @@ import * as aws from "@pulumi/aws"; export const filesEc2SecurityGroup = new aws.ec2.SecurityGroup("files-sg", { ingress: [ // TODO: remove SSH Access - { protocol: "tcp", fromPort: 22, toPort: 22, cidrBlocks: ["0.0.0.0/0"] }, + // { protocol: "tcp", fromPort: 22, toPort: 22, cidrBlocks: ["0.0.0.0/0"] }, { protocol: "tcp", fromPort: 80, @@ -41,7 +41,7 @@ export const multiplayerEc2SecurityGroup = new aws.ec2.SecurityGroup( { ingress: [ // TODO: remove SSH Access - { protocol: "tcp", fromPort: 22, toPort: 22, cidrBlocks: ["0.0.0.0/0"] }, + // { protocol: "tcp", fromPort: 22, toPort: 22, cidrBlocks: ["0.0.0.0/0"] }, { protocol: "tcp", fromPort: 80,