Skip to content

Commit

Permalink
tags added and keycloak related changes added
Browse files Browse the repository at this point in the history
  • Loading branch information
sfdevops committed Oct 16, 2024
1 parent c47abe5 commit fd705aa
Show file tree
Hide file tree
Showing 42 changed files with 563 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ frontend:
enabled: true
repository: public.ecr.aws/p1a1c8p2/sourcefuse-arc-saas-control-plane-ui
pullPolicy: Always
tag: "0.0.9"
tag: "0.0.11"
log_level: "info"
home_path: "/main/home"
replicaCount: 1
Expand Down
2 changes: 1 addition & 1 deletion files/tenant-samples/bridge/buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ phases:
- kubectl apply -f ${TIER}-argo-workflow.yaml --namespace argo-workflows || true
- kubectl apply -f argocd-application.yaml --namespace argocd || true
- sleep 240 # waiting time to spin up tenant pods
- terraform apply -auto-approve --refresh=false # refresh is false to avoid unnecessary API hitting
#- terraform apply -auto-approve --refresh=false # refresh is false to avoid unnecessary API hitting
- kubectl apply -f argo-workflow.yaml --namespace argo-workflows || true


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ spec:
"aws:eks:cluster-name": {{ .Values.eksClusterName }}
tags:
Tenant: "pooled"
Project: {{ .Values.project }}



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ publicKey: ${TENANT_CLIENT_SECRET}

tier: ${TIER}
namespace: ${NAMESPACE}
project: ${PROJECT}
region: ${REGION}
karpenterRoleName: ${KARPENTER_ROLE}
eksClusterName: ${EKS_CLUSTER_NAME}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ spec:
"aws:eks:cluster-name": {{ .Values.eksClusterName }}
tags:
Tenant: "pooled"
Project: {{ .Values.project }}



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ publicKey: ${TENANT_CLIENT_SECRET}

tier: ${TIER}
namespace: ${NAMESPACE}
project: ${PROJECT}
region: ${REGION}
cognitodomain: ${COGNITO_DOMAIN}
cognitoid: ${COGNITO_ID}
Expand Down
1 change: 1 addition & 0 deletions files/tenant-samples/bridge/terraform/canary.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ resource "aws_synthetics_canary" "main" {
schedule {
expression = "rate(6 minutes)"
}
tags = module.tags.tags

}

Expand Down
2 changes: 2 additions & 0 deletions files/tenant-samples/bridge/terraform/eks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ data "template_file" "cognito_helm_values_template" {
template = file("${path.module}/../tenant-helm-chart/cognito/values.yaml.template")
vars = {
NAMESPACE = local.kubernetes_ns
PROJECT = var.namespace
TENANT_NAME = var.tenant_name
TENANT_KEY = var.tenant
TENANT_EMAIL = var.tenant_email
Expand Down Expand Up @@ -149,6 +150,7 @@ data "template_file" "auth0_helm_values_template" {
template = file("${path.module}/../tenant-helm-chart/auth0/values.yaml.template")
vars = {
NAMESPACE = local.kubernetes_ns
PROJECT = var.namespace
TENANT_NAME = var.tenant_name
TENANT_KEY = var.tenant
TENANT_EMAIL = var.tenant_email
Expand Down
2 changes: 1 addition & 1 deletion files/tenant-samples/pooled/buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ phases:
- kubectl apply -f ${TIER}-argo-workflow.yaml --namespace argo-workflows || true
- kubectl apply -f argocd-application.yaml --namespace argocd || true
- sleep 240 # waiting time to spin up tenant pods
- terraform apply -auto-approve --refresh=false # refresh is false to avoid unnecessary API hitting
#- terraform apply -auto-approve --refresh=false # refresh is false to avoid unnecessary API hitting
- kubectl apply -f argo-workflow.yaml --namespace argo-workflows || true

finally:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ spec:
"aws:eks:cluster-name": {{ .Values.eksClusterName }}
tags:
Tenant: "pooled"
Project: {{ .Values.project }}



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ publicKey: ${TENANT_CLIENT_SECRET}

tier: ${TIER}
namespace: ${NAMESPACE}
project: ${PROJECT}
region: ${REGION}
karpenterRoleName: ${KARPENTER_ROLE}
eksClusterName: ${EKS_CLUSTER_NAME}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ spec:
"aws:eks:cluster-name": {{ .Values.eksClusterName }}
tags:
Tenant: "pooled"
Project: {{ .Values.project }}



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ publicKey: ${TENANT_CLIENT_SECRET}

tier: ${TIER}
namespace: ${NAMESPACE}
project: ${PROJECT}
region: ${REGION}
cognitodomain: ${COGNITO_DOMAIN}
cognitoid: ${COGNITO_ID}
Expand Down
1 change: 1 addition & 0 deletions files/tenant-samples/pooled/terraform/canary.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ resource "aws_synthetics_canary" "main" {
schedule {
expression = "rate(6 minutes)"
}
tags = module.tags.tags

}

Expand Down
2 changes: 2 additions & 0 deletions files/tenant-samples/pooled/terraform/eks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ data "template_file" "cognito_helm_values_template" {
template = file("${path.module}/../tenant-helm-chart/cognito/values.yaml.template")
vars = {
NAMESPACE = local.kubernetes_ns
PROJECT = var.namespace
TENANT_NAME = var.tenant_name
TENANT_KEY = var.tenant
TENANT_EMAIL = var.tenant_email
Expand Down Expand Up @@ -148,6 +149,7 @@ data "template_file" "auth0_helm_values_template" {
template = file("${path.module}/../tenant-helm-chart/auth0/values.yaml.template")
vars = {
NAMESPACE = local.kubernetes_ns
PROJECT = var.namespace
TENANT_NAME = var.tenant_name
TENANT_KEY = var.tenant
TENANT_EMAIL = var.tenant_email
Expand Down
2 changes: 1 addition & 1 deletion files/tenant-samples/silo/buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ phases:
- ./push-values.sh # push values to tenant management gitops repository
- kubectl apply -f argocd-application.yaml --namespace argocd || true
- sleep 240 # waiting time to spin up tenant pods
- terraform apply -auto-approve --refresh=false # refresh is false to avoid API hitting
#- terraform apply -auto-approve --refresh=false # refresh is false to avoid API hitting
- kubectl apply -f argo-workflow.yaml --namespace argo-workflows || true
finally:
- node $WEBHOOK_PATH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ spec:
tags:
Tenant: {{ .Values.tenant }}
Tenant_ID: {{ .Values.tenantID }}
Project: {{ .Values.project }}



Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ publicKey: ${TENANT_CLIENT_SECRET}

tier: ${TIER}
namespace: ${NAMESPACE}
project: ${PROJECT}
region: ${REGION}
karpenterRoleName: ${KARPENTER_ROLE}
eksClusterName: ${EKS_CLUSTER_NAME}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ spec:
tags:
Tenant: {{ .Values.tenant }}
Tenant_ID: {{ .Values.tenantID }}
Project: {{ .Values.project }}



Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ publicKey: ${TENANT_CLIENT_SECRET}

tier: ${TIER}
namespace: ${NAMESPACE}
project: ${PROJECT}
region: ${REGION}
cognitodomain: ${COGNITO_DOMAIN}
cognitoid: ${COGNITO_ID}
Expand Down
2 changes: 1 addition & 1 deletion files/tenant-samples/silo/terraform/canary.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resource "aws_synthetics_canary" "main" {
schedule {
expression = "rate(6 minutes)"
}

tags = module.tags.tags
}

data "archive_file" "canary_zip_inline" {
Expand Down
2 changes: 2 additions & 0 deletions files/tenant-samples/silo/terraform/eks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ data "template_file" "cognito_helm_values_template" {
template = file("${path.module}/../tenant-helm-chart/cognito/values.yaml.template")
vars = {
NAMESPACE = local.kubernetes_ns
PROJECT = var.namespace
TENANT_NAME = var.tenant_name
TENANT_KEY = var.tenant
TENANT_EMAIL = var.tenant_email
Expand Down Expand Up @@ -151,6 +152,7 @@ data "template_file" "auth0_helm_values_template" {
template = file("${path.module}/../tenant-helm-chart/auth0/values.yaml.template")
vars = {
NAMESPACE = local.kubernetes_ns
PROJECT = var.namespace
TENANT_NAME = var.tenant_name
TENANT_KEY = var.tenant
TENANT_EMAIL = var.tenant_email
Expand Down
9 changes: 9 additions & 0 deletions terraform/control-plane-application/buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ phases:
- chmod +x push-helm-values.sh
- ./push-helm-values.sh # push control-plane values yaml to tenant management gitops repository
- kubectl apply -f control-plane-argocd-application.yaml --namespace argocd || true
- cd ..
# To run keycloak
- cd keycloak
- rm config.hcl
- sed -i 's/aws_region/${var.region}/g' config.txt
- envsubst < config.txt > config.${var.environment}.hcl
- terraform init --backend-config=config.${var.environment}.hcl
- terraform plan
- terraform apply --auto-approve

post_build:
commands:
Expand Down
11 changes: 11 additions & 0 deletions terraform/db-ops/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ module "postgresql_provider" {
"feature_db" = {
db_name = var.featuretoggledbdatabase
allow_connections = true
},
"keycloak_db" = {
db_name = var.keycloakdbdatabase
allow_connections = true
}

}
Expand Down Expand Up @@ -147,6 +151,13 @@ module "db_ops_ssm_parameters" {
type = "SecureString"
overwrite = "true"
description = "Feature Toggle Database Name"
},
{
name = "/${var.namespace}/${var.environment}/keycloakdbdatabase"
value = var.keycloakdbdatabase
type = "SecureString"
overwrite = "true"
description = "Keycloak Database Name"
}
]
tags = module.tags.tags
Expand Down
5 changes: 5 additions & 0 deletions terraform/db-ops/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,9 @@ variable "tenantmgmtdbdatabase" {
variable "featuretoggledbdatabase" {
type = string
default = "feature"
}

variable "keycloakdbdatabase" {
type = string
default = "keycloak"
}
1 change: 1 addition & 0 deletions terraform/eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ module "eks_cluster" {
]
map_additional_iam_users = var.map_additional_iam_users
allowed_cidr_blocks = [data.aws_vpc.vpc.cidr_block]
tags = module.tags.tags
}

#################################################################################
Expand Down
1 change: 1 addition & 0 deletions terraform/keycloak/.terraform-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
latest:^1.4
Loading

0 comments on commit fd705aa

Please sign in to comment.