Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reviewing infra some #1033

Merged
merged 7 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
44 changes: 20 additions & 24 deletions infra/files/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -39,29 +41,23 @@ const instance = new aws.ec2.Instance("files-instance", {
),
});

// 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",
ttl: 300,
records: [instance.publicIp],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this reliable? I've heard this can be flaky because the publicIp can change?

});

export const filesPublicDns = instance.publicDns;
export const filesPublicDns = dnsRecord.fqdn;
1 change: 1 addition & 0 deletions infra/helpers/runDockerImageBashScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions infra/shared/securityGroups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Loading