Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit 19d4383

Browse files
authored
Multiple envs (#4)
1 parent 3912cf5 commit 19d4383

File tree

19 files changed

+605
-148
lines changed

19 files changed

+605
-148
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ jobs:
5656
with:
5757
task-definition: ${{ steps.cube-api-task-def.outputs.task-definition }}
5858
service: cube_api
59-
cluster: prod-sync_cluster
59+
cluster: prod-sync-cluster
6060
wait-for-service-stability: true
6161

6262
- name: Deploy cube-refresh-worker task definition
6363
uses: aws-actions/[email protected]
6464
with:
6565
task-definition: ${{ steps.cube-refresh-worker-task-def.outputs.task-definition }}
6666
service: cube_refresh_worker
67-
cluster: prod-sync_cluster
67+
cluster: prod-sync-cluster
6868
wait-for-service-stability: true

terraform/environments/development/.terraform.lock.hcl

Lines changed: 44 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
terraform {
2+
required_providers {
3+
aws = {
4+
source = "hashicorp/aws"
5+
}
6+
}
7+
8+
required_version = ">= 1.2.0"
9+
10+
backend "s3" {
11+
bucket = "synccomputing-terraform-state"
12+
key = "sync-svc-cube/development/terraform.tfstate"
13+
region = "us-east-1"
14+
shared_credentials_file = "~/.aws/credentials"
15+
}
16+
}
17+
18+
module "sync" {
19+
source = "../../modules/sync"
20+
21+
env = var.env
22+
api_domain = var.api_domain
23+
vpc_cidr = var.vpc_cidr
24+
azs = var.azs
25+
private_subnets = var.private_subnets
26+
public_subnets = var.public_subnets
27+
cube_api_env_vars = var.cube_api_env_vars
28+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
env = "development"
2+
api_domain = "dev-cube-api.synccomputing.com"
3+
vpc_cidr = "10.2.0.0/16"
4+
cube_api_env_vars = [
5+
{
6+
name = "CUBEJS_DB_SSL"
7+
value = "true"
8+
},
9+
{
10+
name = "CUBEJS_DB_TYPE"
11+
value = "postgres"
12+
},
13+
{
14+
name = "CUBEJS_DB_HOST"
15+
value = "ec2-44-207-193-114.compute-1.amazonaws.com"
16+
},
17+
{
18+
name = "CUBEJS_DB_PORT"
19+
value = "5432"
20+
},
21+
{
22+
name = "CUBEJS_DB_USER"
23+
value = "u7vu2evfrjdrgd"
24+
},
25+
{
26+
name = "CUBEJS_DB_NAME"
27+
value = "d1rctqha6bn9ns"
28+
},
29+
{
30+
name = "CUBEJS_SCHEMA_PATH"
31+
value = "model"
32+
},
33+
{
34+
name = "CUBEJS_DEV_MODE"
35+
value = "true"
36+
},
37+
{
38+
name = "NODE_ENV",
39+
value = "production"
40+
},
41+
{
42+
name = "CUBEJS_JWK_URL"
43+
value = "https://dev-sxu89-37.us.auth0.com/.well-known/jwks.json"
44+
},
45+
{
46+
name = "CUBEJS_JWT_AUDIENCE"
47+
value = "https://dev-api.synccomputing.com"
48+
},
49+
{
50+
name = "CUBEJS_JWT_ISSUER"
51+
value = "https://login.dev.synccomputing.com/"
52+
},
53+
{
54+
name = "CUBEJS_JWT_ALGS"
55+
value = "RS256"
56+
},
57+
{
58+
name = "CUBEJS_JWT_CLAIMS_NAMESPACE"
59+
value = "https://synccomputing.com/"
60+
},
61+
{
62+
name = "CUBEJS_CACHE_AND_QUEUE_DRIVER"
63+
value = "cubestore"
64+
}
65+
]
66+
azs = ["us-east-1a", "us-east-1b", "us-east-1d", "us-east-1c"]
67+
private_subnets = ["10.2.1.0/24", "10.2.2.0/24", "10.2.3.0/24", "10.2.4.0/24"]
68+
public_subnets = ["10.2.101.0/24", "10.2.102.0/24", "10.2.103.0/24", "10.2.104.0/24"]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
variable "env" {
2+
type = string
3+
}
4+
5+
variable "api_domain" {
6+
type = string
7+
}
8+
9+
variable "vpc_cidr" {
10+
type = string
11+
}
12+
13+
variable "cube_api_env_vars" {
14+
type = list(object({
15+
name = string
16+
value = string
17+
}))
18+
}
19+
20+
variable "azs" {
21+
type = list(string)
22+
}
23+
24+
variable "private_subnets" {
25+
type = list(string)
26+
}
27+
28+
variable "public_subnets" {
29+
type = list(string)
30+
}

terraform/environments/production/.terraform.lock.hcl

Lines changed: 44 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
terraform {
2+
required_providers {
3+
aws = {
4+
source = "hashicorp/aws"
5+
}
6+
}
7+
8+
required_version = ">= 1.2.0"
9+
10+
backend "s3" {
11+
bucket = "synccomputing-terraform-state"
12+
key = "sync-svc-cube/production/terraform.tfstate"
13+
region = "us-east-1"
14+
shared_credentials_file = "~/.aws/credentials"
15+
}
16+
}
17+
18+
module "sync" {
19+
source = "../../modules/sync"
20+
21+
env = var.env
22+
api_domain = var.api_domain
23+
vpc_cidr = var.vpc_cidr
24+
azs = var.azs
25+
private_subnets = var.private_subnets
26+
public_subnets = var.public_subnets
27+
cube_api_env_vars = var.cube_api_env_vars
28+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
env = "production"
2+
api_domain = "cube-api.synccomputing.com"
3+
vpc_cidr = "10.0.0.0/16"
4+
cube_api_env_vars = [
5+
{
6+
name = "CUBEJS_DB_SSL"
7+
value = "true"
8+
},
9+
{
10+
name = "CUBEJS_DB_TYPE"
11+
value = "postgres"
12+
},
13+
{
14+
name = "CUBEJS_DB_HOST"
15+
value = "ec2-3-221-59-105.compute-1.amazonaws.com"
16+
},
17+
{
18+
name = "CUBEJS_DB_PORT"
19+
value = "5432"
20+
},
21+
{
22+
name = "CUBEJS_DB_USER"
23+
value = "cube"
24+
},
25+
{
26+
name = "CUBEJS_DB_NAME"
27+
value = "d20nhfliefb6aa"
28+
},
29+
{
30+
name = "CUBEJS_SCHEMA_PATH"
31+
value = "model"
32+
},
33+
{
34+
name = "CUBEJS_DEV_MODE"
35+
value = "false"
36+
},
37+
{
38+
name = "NODE_ENV",
39+
value = "production"
40+
},
41+
{
42+
name = "CUBEJS_JWK_URL"
43+
value = "https://sync-prod.us.auth0.com/.well-known/jwks.json"
44+
},
45+
{
46+
name = "CUBEJS_JWT_AUDIENCE"
47+
value = "https://api.synccomputing.com"
48+
},
49+
{
50+
name = "CUBEJS_JWT_ISSUER"
51+
value = "https://login.app.synccomputing.com/"
52+
},
53+
{
54+
name = "CUBEJS_JWT_ALGS"
55+
value = "RS256"
56+
},
57+
{
58+
name = "CUBEJS_JWT_CLAIMS_NAMESPACE"
59+
value = "https://synccomputing.com/"
60+
},
61+
{
62+
name = "CUBEJS_CACHE_AND_QUEUE_DRIVER"
63+
value = "cubestore"
64+
}
65+
]
66+
azs = ["us-east-1a", "us-east-1b", "us-east-1d", "us-east-1c"]
67+
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24", "10.0.4.0/24"]
68+
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24", "10.0.104.0/24"]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
variable "env" {
2+
type = string
3+
}
4+
5+
variable "api_domain" {
6+
type = string
7+
}
8+
9+
variable "vpc_cidr" {
10+
type = string
11+
}
12+
13+
variable "cube_api_env_vars" {
14+
type = list(object({
15+
name = string
16+
value = string
17+
}))
18+
}
19+
20+
variable "azs" {
21+
type = list(string)
22+
}
23+
24+
variable "private_subnets" {
25+
type = list(string)
26+
}
27+
28+
variable "public_subnets" {
29+
type = list(string)
30+
}

0 commit comments

Comments
 (0)