-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding frontend deployment infrastructure (#75)
Relates to: #51 ### Changes introduced: Adding happy infrastructure to deploy front end application. Demo: https://frontend-test.cryoet.dev.si.czi.technology/
- Loading branch information
Showing
18 changed files
with
485 additions
and
4 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"default_env": "dev", | ||
"app": "cryoet-frontend", | ||
"default_compose_env_file": ".env.ecr", | ||
"environments": { | ||
"dev": { | ||
"aws_profile": "cryoet-dev", | ||
"aws_region": "us-west-2", | ||
"k8s": { | ||
"namespace": "cryoet-dev-happy-happy-env", | ||
"cluster_id": "cryoet-dev-eks", | ||
"auth_method": "eks" | ||
}, | ||
"terraform_directory": ".happy/terraform/envs/dev", | ||
"task_launch_type": "k8s" | ||
}, | ||
"prod": { | ||
"aws_profile": "cryoet-prod", | ||
"aws_region": "us-west-2", | ||
"k8s": { | ||
"namespace": "cryoet-prod-happy-happy-env", | ||
"cluster_id": "cryoet-prod-eks", | ||
"auth_method": "eks" | ||
}, | ||
"terraform_directory": ".happy/terraform/envs/prod", | ||
"task_launch_type": "k8s" | ||
}, | ||
"staging": { | ||
"aws_profile": "cryoet-dev", | ||
"aws_region": "us-west-2", | ||
"k8s": { | ||
"namespace": "cryoet-staging-happy-happy-env", | ||
"cluster_id": "cryoet-staging-eks", | ||
"auth_method": "eks" | ||
}, | ||
"terraform_directory": ".happy/terraform/envs/staging", | ||
"task_launch_type": "k8s" | ||
} | ||
}, | ||
"services": [ | ||
"frontend" | ||
], | ||
"features": { | ||
"enable_dynamo_locking": true, | ||
"enable_happy_api_usage": true, | ||
"enable_ecr_auto_creation": true | ||
}, | ||
"api": {}, | ||
"stack_defaults": { | ||
"create_dashboard": false, | ||
"routing_method": "CONTEXT", | ||
"services": { | ||
"frontend": { | ||
"build": { | ||
"context": "packages/data-portal", | ||
"dockerfile": "Dockerfile" | ||
}, | ||
"health_check_path": "/", | ||
"name": "frontend", | ||
"path": "/*", | ||
"port": 8080, | ||
"priority": 0, | ||
"service_type": "EXTERNAL", | ||
"success_codes": "200-499", | ||
"platform_architecture": "amd64" | ||
} | ||
}, | ||
"stack_defaults": "[email protected]:chanzuckerberg/happy//terraform/modules/happy-stack-eks?ref=main" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Auto-generated by 'happy infra'. Do not edit | ||
# Make improvements in happy, so that everyone can benefit. | ||
module "stack" { | ||
source = "[email protected]:chanzuckerberg/happy//terraform/modules/happy-stack-eks?ref=jgadling/optional-datadog" | ||
image_tag = var.image_tag | ||
stack_name = var.stack_name | ||
k8s_namespace = var.k8s_namespace | ||
image_tags = jsondecode(var.image_tags) | ||
stack_prefix = "/${var.stack_name}" | ||
app_name = var.app | ||
deployment_stage = "dev" | ||
services = { | ||
frontend = { | ||
health_check_path = "/" | ||
name = "frontend" | ||
path = "/*" | ||
port = 8080 | ||
desired_count = 1 | ||
priority = 0 | ||
service_type = "EXTERNAL" | ||
success_codes = "200-499" | ||
memory = "1500Mi" | ||
cpu = "1500m" | ||
} | ||
} | ||
create_dashboard = false | ||
routing_method = "CONTEXT" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Auto-generated by 'happy infra'. Do not edit | ||
# Make improvements in happy, so that everyone can benefit. | ||
output "dashboard" { | ||
sensitive = false | ||
value = module.stack.dashboard | ||
} | ||
output "service_ecrs" { | ||
sensitive = false | ||
value = module.stack.service_ecrs | ||
} | ||
output "service_endpoints" { | ||
description = "The URL endpoints for services" | ||
sensitive = false | ||
value = module.stack.service_endpoints | ||
} | ||
output "task_arns" { | ||
description = "ARNs for all the tasks" | ||
sensitive = false | ||
value = module.stack.task_arns | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Auto-generated by 'happy infra'. Do not edit | ||
# Make improvements in happy, so that everyone can benefit. | ||
provider "aws" { | ||
region = "us-west-2" | ||
assume_role { | ||
role_arn = "arn:aws:iam::${var.aws_account_id}:role/${var.aws_role}" | ||
} | ||
allowed_account_ids = ["${var.aws_account_id}"] | ||
} | ||
data "aws_eks_cluster" "cluster" { | ||
name = var.k8s_cluster_id | ||
} | ||
data "aws_eks_cluster_auth" "cluster" { | ||
name = var.k8s_cluster_id | ||
} | ||
provider "kubernetes" { | ||
host = data.aws_eks_cluster.cluster.endpoint | ||
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority.0.data) | ||
token = data.aws_eks_cluster_auth.cluster.token | ||
} | ||
data "kubernetes_namespace" "happy-namespace" { | ||
metadata { | ||
name = var.k8s_namespace | ||
} | ||
} | ||
provider "datadog" { | ||
validate = false | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Auto-generated by 'happy infra'. Do not edit | ||
# Make improvements in happy, so that everyone can benefit. | ||
variable "aws_account_id" { | ||
type = string | ||
description = "AWS account ID to apply changes to" | ||
} | ||
variable "k8s_cluster_id" { | ||
type = string | ||
description = "EKS K8S Cluster ID" | ||
} | ||
variable "k8s_namespace" { | ||
type = string | ||
description = "K8S namespace for this stack" | ||
} | ||
variable "aws_role" { | ||
type = string | ||
description = "Name of the AWS role to assume to apply changes" | ||
} | ||
variable "image_tag" { | ||
type = string | ||
description = "Please provide an image tag" | ||
} | ||
variable "image_tags" { | ||
type = string | ||
description = "Override the default image tags (json-encoded map)" | ||
default = "{}" | ||
} | ||
variable "stack_name" { | ||
type = string | ||
description = "Happy Path stack name" | ||
} | ||
variable "app" { | ||
type = string | ||
description = "Happy App Name" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Auto-generated by 'happy infra'. Do not edit | ||
# Make improvements in happy, so that everyone can benefit. | ||
terraform { | ||
required_version = ">= 1.3" | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = ">= 5.14" | ||
} | ||
kubernetes = { | ||
source = "hashicorp/kubernetes" | ||
version = ">= 2.20" | ||
} | ||
datadog = { | ||
source = "datadog/datadog" | ||
version = ">= 3.25.0" | ||
} | ||
happy = { | ||
source = "chanzuckerberg/happy" | ||
version = ">= 0.82.1" | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Auto-generated by 'happy infra'. Do not edit | ||
# Make improvements in happy, so that everyone can benefit. | ||
module "stack" { | ||
source = "[email protected]:chanzuckerberg/happy//terraform/modules/happy-stack-eks?ref=jgadling/optional-datadog" | ||
image_tag = var.image_tag | ||
stack_name = var.stack_name | ||
k8s_namespace = var.k8s_namespace | ||
image_tags = jsondecode(var.image_tags) | ||
stack_prefix = "/${var.stack_name}" | ||
app_name = var.app | ||
deployment_stage = "prod" | ||
services = { | ||
frontend = { | ||
health_check_path = "/" | ||
name = "frontend" | ||
path = "/*" | ||
port = 8080 | ||
priority = 0 | ||
service_type = "EXTERNAL" | ||
success_codes = "200-499" | ||
memory = "1500Mi" | ||
cpu = "1500m" | ||
} | ||
} | ||
create_dashboard = false | ||
routing_method = "CONTEXT" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Auto-generated by 'happy infra'. Do not edit | ||
# Make improvements in happy, so that everyone can benefit. | ||
output "dashboard" { | ||
sensitive = false | ||
value = module.stack.dashboard | ||
} | ||
output "service_ecrs" { | ||
sensitive = false | ||
value = module.stack.service_ecrs | ||
} | ||
output "service_endpoints" { | ||
description = "The URL endpoints for services" | ||
sensitive = false | ||
value = module.stack.service_endpoints | ||
} | ||
output "task_arns" { | ||
description = "ARNs for all the tasks" | ||
sensitive = false | ||
value = module.stack.task_arns | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Auto-generated by 'happy infra'. Do not edit | ||
# Make improvements in happy, so that everyone can benefit. | ||
provider "aws" { | ||
region = "us-west-2" | ||
assume_role { | ||
role_arn = "arn:aws:iam::${var.aws_account_id}:role/${var.aws_role}" | ||
} | ||
allowed_account_ids = ["${var.aws_account_id}"] | ||
} | ||
data "aws_eks_cluster" "cluster" { | ||
name = var.k8s_cluster_id | ||
} | ||
data "aws_eks_cluster_auth" "cluster" { | ||
name = var.k8s_cluster_id | ||
} | ||
provider "kubernetes" { | ||
host = data.aws_eks_cluster.cluster.endpoint | ||
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority.0.data) | ||
token = data.aws_eks_cluster_auth.cluster.token | ||
} | ||
data "kubernetes_namespace" "happy-namespace" { | ||
metadata { | ||
name = var.k8s_namespace | ||
} | ||
} | ||
provider "datadog" { | ||
app_key = "FAKE_APP_KEY" | ||
api_key = "FAKE_API_KEY" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Auto-generated by 'happy infra'. Do not edit | ||
# Make improvements in happy, so that everyone can benefit. | ||
variable "aws_account_id" { | ||
type = string | ||
description = "AWS account ID to apply changes to" | ||
} | ||
variable "k8s_cluster_id" { | ||
type = string | ||
description = "EKS K8S Cluster ID" | ||
} | ||
variable "k8s_namespace" { | ||
type = string | ||
description = "K8S namespace for this stack" | ||
} | ||
variable "aws_role" { | ||
type = string | ||
description = "Name of the AWS role to assume to apply changes" | ||
} | ||
variable "image_tag" { | ||
type = string | ||
description = "Please provide an image tag" | ||
} | ||
variable "image_tags" { | ||
type = string | ||
description = "Override the default image tags (json-encoded map)" | ||
default = "{}" | ||
} | ||
variable "stack_name" { | ||
type = string | ||
description = "Happy Path stack name" | ||
} | ||
variable "app" { | ||
type = string | ||
description = "Happy App Name" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Auto-generated by 'happy infra'. Do not edit | ||
# Make improvements in happy, so that everyone can benefit. | ||
terraform { | ||
required_version = ">= 1.3" | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = ">= 5.14" | ||
} | ||
kubernetes = { | ||
source = "hashicorp/kubernetes" | ||
version = ">= 2.20" | ||
} | ||
datadog = { | ||
source = "datadog/datadog" | ||
version = ">= 3.25.0" | ||
} | ||
happy = { | ||
source = "chanzuckerberg/happy" | ||
version = ">= 0.82.1" | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Auto-generated by 'happy infra'. Do not edit | ||
# Make improvements in happy, so that everyone can benefit. | ||
module "stack" { | ||
source = "[email protected]:chanzuckerberg/happy//terraform/modules/happy-stack-eks?ref=jgadling/optional-datadog" | ||
image_tag = var.image_tag | ||
stack_name = var.stack_name | ||
k8s_namespace = var.k8s_namespace | ||
image_tags = jsondecode(var.image_tags) | ||
stack_prefix = "/${var.stack_name}" | ||
app_name = var.app | ||
deployment_stage = "staging" | ||
services = { | ||
frontend = { | ||
health_check_path = "/" | ||
name = "frontend" | ||
path = "/*" | ||
port = 8080 | ||
desired_count = 1 | ||
priority = 0 | ||
service_type = "EXTERNAL" | ||
success_codes = "200-499" | ||
memory = "1500Mi" | ||
cpu = "1500m" | ||
} | ||
} | ||
create_dashboard = false | ||
routing_method = "CONTEXT" | ||
} |
Oops, something went wrong.