Skip to content

Commit

Permalink
Merge pull request #115 from resource-watch/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
solomon-negusse authored Jul 17, 2023
2 parents d618575 + 745368f commit 560ec9f
Show file tree
Hide file tree
Showing 62 changed files with 152 additions and 123 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ data "aws_iam_policy_document" "eks_oidc_assume_role" {
condition {
test = "StringEquals"
variable = "${replace(data.aws_eks_cluster.selected.identity[0].oidc[0].issuer, "https://", "")}:aud"
values = [
values = [
"sts.amazonaws.com"
]
}
condition {
test = "StringEquals"
variable = "${replace(data.aws_eks_cluster.selected.identity[0].oidc[0].issuer, "https://", "")}:sub"
values = [
values = [
"system:serviceaccount:${var.k8s_namespace}:aws-load-balancer-controller"
]
}
Expand Down Expand Up @@ -83,8 +83,8 @@ resource "aws_iam_role_policy_attachment" "lb-controller-iam-role-policy-attachm
resource "kubernetes_service_account" "this" {
automount_service_account_token = true
metadata {
name = "aws-load-balancer-controller"
namespace = var.k8s_namespace
name = "aws-load-balancer-controller"
namespace = var.k8s_namespace
annotations = {
# This annotation is only used when running on EKS which can
# use IAM roles for service accounts.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ data:
tag *
read_from_head true
<parse>
@type json
@type regexp
time_format %Y-%m-%dT%H:%M:%S.%NZ
expression /^(?<time>.+) (?<stream>stdout|stderr)( (?<logtag>.))? (?<log>.*)$/
</parse>
</source>

Expand Down Expand Up @@ -151,7 +152,7 @@ spec:
labels:
k8s-app: fluentd-cloudwatch
annotations:
configHash: 8915de4cf9c3551a8dc74c0137a3e83569d28c71044b0359c2578d2e0461825
configHash: bfc6b4b2689f21a923bb6cabd61cf32bca3f821110fc966503ac0ec68c7b180d
spec:
serviceAccountName: fluentd
terminationGracePeriodSeconds: 30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ provider "kubectl" {
#// https://docs.aws.amazon.com/eks/latest/userguide/alb-ingress.html
#// ALB Ingress Controller
module "alb" {
source = "./alb_ingress"
aws_region = var.aws_region
source = "./alb_ingress"
aws_region = var.aws_region
cluster_name = var.cluster_name
}

Expand All @@ -22,7 +22,7 @@ module "alb" {
// File has changes - see link above for details
data "kubectl_path_documents" "cluster_autoscaler_manifests" {
pattern = "${path.module}/cluster_autoscaler/cluster-autoscaler-autodiscover.yaml.tmpl"
vars = {
vars = {
cluster_name : var.cluster_name
}
}
Expand All @@ -49,7 +49,7 @@ resource "kubectl_manifest" "metrics_server" {
// File has changes - see link above for details
data "kubectl_path_documents" "container_insights_manifests" {
pattern = "${path.module}/container_insights/container_insights.yaml.tmpl"
vars = {
vars = {
aws_region : var.aws_region,
cluster_name : var.cluster_name
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_aqueduct_analysis" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.aqueduct_analysis_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.aqueduct_analysis_lb_target_group[0].arn
}

// /v1/aqueduct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_arcgis_proxy" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.arcgis_proxy_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.arcgis_proxy_lb_target_group[0].arn
}

// /v1/arcgis-proxy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_arcgis" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.arcgis_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.arcgis_lb_target_group[0].arn
}

// /v1/query/featureservice
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_area" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.area_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.area_lb_target_group[0].arn
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_authorization" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.authorization_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.authorization_lb_target_group[0].arn
}

// /auth
Expand Down Expand Up @@ -96,6 +96,22 @@ module "v1_deletion_proxy_resource" {
path_part = "{proxy+}"
}

// /v1/request
module "v1_request_resource" {
source = "../resource"
rest_api_id = var.api_gateway.id
parent_id = var.v1_resource.id
path_part = "request"
}

// /v1/request/validate
module "v1_request_validate_resource" {
source = "../resource"
rest_api_id = var.api_gateway.id
parent_id = module.v1_request_resource.aws_api_gateway_resource.id
path_part = "validate"
}

// /v1/organization
module "v1_organization_resource" {
source = "../resource"
Expand Down Expand Up @@ -248,3 +264,14 @@ module "authorization_any_v1_application_proxy" {
vpc_link = var.vpc_link
connection_type = var.connection_type
}

module "authorization_post_v1_request_validate" {
source = "../endpoint"
x_rw_domain = var.x_rw_domain
api_gateway = var.api_gateway
api_resource = module.v1_request_validate_resource.aws_api_gateway_resource
method = "POST"
uri = "http://${local.api_gateway_target_url}:30505/api/v1/request/validate"
vpc_link = var.vpc_link
connection_type = var.connection_type
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ output "endpoints" {
module.authorization_any_v1_organization_proxy.endpoint_gateway_integration,
module.authorization_get_v1_application.endpoint_gateway_integration,
module.authorization_post_v1_application.endpoint_gateway_integration,
module.authorization_any_v1_application_proxy.endpoint_gateway_integration
module.authorization_any_v1_application_proxy.endpoint_gateway_integration,
module.authorization_post_v1_request_validate.endpoint_gateway_integration
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_bigquery" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.bigquery_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.bigquery_lb_target_group[0].arn
}

// /v1/query/bigquery
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_biomass" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.biomass_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.biomass_lb_target_group[0].arn
}

// /v1/biomass-loss/admin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_cartodb" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.carto_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.carto_lb_target_group[0].arn
}

// /v1/query/cartodb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_convert" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.converter_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.converter_lb_target_group[0].arn
}

// /v1/convert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_dataset" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.dataset_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.dataset_lb_target_group[0].arn
}

// /v1/dataset
Expand Down Expand Up @@ -184,14 +184,14 @@ module "dataset_post_dataset" {
}

module "dataset_delete_dataset_id_proxy" {
source = "../endpoint"
x_rw_domain = var.x_rw_domain
api_gateway = var.api_gateway
api_resource = module.dataset_by_user_id_resource.aws_api_gateway_resource
method = "DELETE"
uri = "http://${local.api_gateway_target_url}:30516/api/v1/dataset/by-user/{userId}"
vpc_link = var.vpc_link
connection_type = var.connection_type
source = "../endpoint"
x_rw_domain = var.x_rw_domain
api_gateway = var.api_gateway
api_resource = module.dataset_by_user_id_resource.aws_api_gateway_resource
method = "DELETE"
uri = "http://${local.api_gateway_target_url}:30516/api/v1/dataset/by-user/{userId}"
vpc_link = var.vpc_link
connection_type = var.connection_type
}

module "dataset_any_dataset_id_proxy" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_doc_orchestrator" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.doc_orchestrator_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.doc_orchestrator_lb_target_group[0].arn
}

// /v1/doc-importer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_document_adapter" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.document_adapter_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.document_adapter_lb_target_group[0].arn
}

// /v1/query/csv
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "aws_api_gateway_integration" "endpoint_proxy_integration" {
rest_api_id = var.api_gateway.id
resource_id = var.api_resource.id
http_method = var.method
type = "MOCK"
type = "MOCK"

request_templates = {
"application/json" : "{\"statusCode\": 503}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_fires_summary_stats" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.fires_summary_stats_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.fires_summary_stats_lb_target_group[0].arn
}

// /v1/fire-alerts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_forest_change" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.forest_change_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.forest_change_lb_target_group[0].arn
}

// /v1/terrai-alerts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_gee_tiles" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.gee_tiles_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.gee_tiles_lb_target_group[0].arn
}

// /v1/layer/{layerId}/tile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_gee" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.gee_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.gee_lb_target_group[0].arn
}

// /v1/query/gee
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_geostore" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.geostore_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.geostore_lb_target_group[0].arn
}

#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_gfw" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.gfw_adapter_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.gfw_adapter_lb_target_group[0].arn
}

// /v1/query/gfw
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_gfw_contact" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.gfw_contact_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.gfw_contact_lb_target_group[0].arn
}

// /v1/form
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_gfw_forma" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.gfw_forma_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.gfw_forma_lb_target_group[0].arn
}

// /v1/forma-alerts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_gfw_guira" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.gfw_guira_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.gfw_guira_lb_target_group[0].arn
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_gfw_ogr_gfw_pro" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.gfw_ogr_gfw_pro_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.gfw_ogr_gfw_pro_lb_target_group[0].arn
}

// /v1/gfw-pro
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_gfw_ogr" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.gfw_ogr_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.gfw_ogr_lb_target_group[0].arn
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_gfw_prodes" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.gfw_prodes_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.gfw_prodes_lb_target_group[0].arn
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_gfw_umd" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.gfw_umd_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.gfw_umd_lb_target_group[0].arn
}

// /v1/umd-loss-gain/admin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_gfw_user" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.gfw_user_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.gfw_user_lb_target_group[0].arn
}

// /v1/user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_glad_analysis_tiled" {
count = var.connection_type == "VPC_LINK" ? length(var.eks_asg_names) : 0

autoscaling_group_name = var.eks_asg_names[count.index]
lb_target_group_arn = aws_lb_target_group.glad_analysis_tiled_lb_target_group[0].arn
lb_target_group_arn = aws_lb_target_group.glad_analysis_tiled_lb_target_group[0].arn
}

// /v1/glad-alerts/admin
Expand Down
Loading

0 comments on commit 560ec9f

Please sign in to comment.