Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
chore: Migration to Container App module with name and workload_profi…
Browse files Browse the repository at this point in the history
…le empty (#464)

* workload_profile_name var

* container_app_environment_name

* fix pr release trigger

* pre commit

* pnpg cae cp url

* fix release ms

* dev and prod new cae url

* Container App Environment name var
  • Loading branch information
manuraf authored Apr 10, 2024
1 parent ab60683 commit 8ccc9cb
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 57 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/pr_ms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ on:
- synchronize
- reopened
- ready_for_review
paths:
- '.github/workflows/pr_ms.yml'
- '.github/workflows/release_ms.yml'
- '.github/workflows/release_ms_pnpg.yml'
- '!.devops/**'
- '!.identity/**'
- '!helm/**'
- '!**.md'
- '!**ignore'
- '!infra/**'
- '!.terraform-version'
- '!CODEOWNERS'

jobs:

Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/release_ms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ on:
push:
branches:
- main
- releases/**
- releases/*
paths:
- '!.devops/**'
- '!.github/**'
- '!.identity/**'
- '!helm/**'
- '!**.md'
- '!.**ignore'
- '!infra/repository/**'
- '!.terraform-version'
- '!CODEOWNERS'
- 'app/**'
- 'connector/**'
- 'connector-api/**'
- 'core/**'
- 'infra/**'
- 'web/**'
- 'pom.xml'

workflow_dispatch:
inputs:
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/release_ms_pnpg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ on:
push:
branches:
- main
- releases/**
- releases/*
paths:
- '!.devops/**'
- '!.github/**'
- '!.identity/**'
- '!helm/**'
- '!**.md'
- '!.**ignore'
- '!infra/repository/**'
- '!.terraform-version'
- '!CODEOWNERS'
- 'app/**'
- 'connector/**'
- 'connector-api/**'
- 'core/**'
- 'infra/**'
- 'web/**'
- 'pom.xml'

workflow_dispatch:
inputs:
Expand Down
6 changes: 3 additions & 3 deletions infra/container_apps/env/dev-pnpg/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@ app_settings = [
},
{
name = "MS_NOTIFICATION_MANAGER_URL"
value = "https://selc-d-pnpg-notification-mngr-ca.yellowdesert-85d3792d.westeurope.azurecontainerapps.io"
value = "https://selc-d-pnpg-notification-mngr-ca.victoriousfield-e39534b8.westeurope.azurecontainerapps.io"
},
{
name = "USERVICE_PARTY_REGISTRY_PROXY_URL"
value = "https://selc-d-pnpg-party-reg-proxy-ca.yellowdesert-85d3792d.westeurope.azurecontainerapps.io"
value = "https://selc-d-pnpg-party-reg-proxy-ca.victoriousfield-e39534b8.westeurope.azurecontainerapps.io"
},
{
name = "MS_PRODUCT_URL"
value = "https://selc-d-pnpg-product-ca.yellowdesert-85d3792d.westeurope.azurecontainerapps.io"
value = "https://selc-d-pnpg-product-ca.victoriousfield-e39534b8.westeurope.azurecontainerapps.io"
},
{
name = "USERVICE_USER_REGISTRY_URL"
Expand Down
6 changes: 3 additions & 3 deletions infra/container_apps/env/dev/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,15 @@ app_settings = [
},
{
name = "MS_NOTIFICATION_MANAGER_URL"
value = "https://selc-d-notification-mngr-ca.livelydesert-633675bb.westeurope.azurecontainerapps.io"
value = "https://selc-d-notification-mngr-ca.politewater-9af33050.westeurope.azurecontainerapps.io"
},
{
name = "USERVICE_PARTY_REGISTRY_PROXY_URL"
value = "https://selc-d-party-reg-proxy-ca.livelydesert-633675bb.westeurope.azurecontainerapps.io"
value = "https://selc-d-party-reg-proxy-ca.politewater-9af33050.westeurope.azurecontainerapps.io"
},
{
name = "MS_PRODUCT_URL"
value = "https://selc-d-product-ca.livelydesert-633675bb.westeurope.azurecontainerapps.io"
value = "https://selc-d-product-ca.politewater-9af33050.westeurope.azurecontainerapps.io"
},
{
name = "USERVICE_USER_REGISTRY_URL"
Expand Down
6 changes: 3 additions & 3 deletions infra/container_apps/env/prod-pnpg/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ app_settings = [
},
{
name = "MS_NOTIFICATION_MANAGER_URL"
value = "https://selc-p-pnpg-notification-mngr-ca.redbeach-5da5166f.westeurope.azurecontainerapps.io"
value = "https://selc-p-pnpg-notification-mngr-ca.calmmoss-0be48755.westeurope.azurecontainerapps.io"
},
{
name = "USERVICE_PARTY_REGISTRY_PROXY_URL"
value = "https://selc-p-pnpg-party-reg-proxy-ca.redbeach-5da5166f.westeurope.azurecontainerapps.io"
value = "https://selc-p-pnpg-party-reg-proxy-ca.calmmoss-0be48755.westeurope.azurecontainerapps.io"
},
{
name = "MS_PRODUCT_URL"
value = "https://selc-p-pnpg-product-ca.redbeach-5da5166f.westeurope.azurecontainerapps.io"
value = "https://selc-p-pnpg-product-ca.calmmoss-0be48755.westeurope.azurecontainerapps.io"
},
{
name = "USERVICE_USER_REGISTRY_URL"
Expand Down
6 changes: 3 additions & 3 deletions infra/container_apps/env/prod/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ app_settings = [
},
{
name = "MS_NOTIFICATION_MANAGER_URL"
value = "https://selc-p-notification-mngr-ca.salmonstone-7f910b8f.westeurope.azurecontainerapps.io"
value = "https://selc-p-notification-mngr-ca.greensand-62fc96da.westeurope.azurecontainerapps.io"
},
{
name = "USERVICE_PARTY_REGISTRY_PROXY_URL"
value = "https://selc-p-party-reg-proxy-ca.salmonstone-7f910b8f.westeurope.azurecontainerapps.io"
value = "https://selc-p-party-reg-proxy-ca.greensand-62fc96da.westeurope.azurecontainerapps.io"
},
{
name = "MS_PRODUCT_URL"
value = "https://selc-p-product-ca.salmonstone-7f910b8f.westeurope.azurecontainerapps.io"
value = "https://selc-p-product-ca.greensand-62fc96da.westeurope.azurecontainerapps.io"
},
{
name = "USERVICE_USER_REGISTRY_URL"
Expand Down
8 changes: 5 additions & 3 deletions infra/container_apps/env/uat-pnpg/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
env_short = "u"
is_pnpg = true
cae_name = "cae"
workload_profile_name = "Consumption"

tags = {
CreatedBy = "Terraform"
Expand All @@ -12,9 +14,9 @@ tags = {
container_app = {
min_replicas = 1
max_replicas = 2
scale_rules = []
cpu = 0.5
memory = "1Gi"
scale_rules = []
cpu = 0.5
memory = "1Gi"
}

app_settings = [
Expand Down
8 changes: 5 additions & 3 deletions infra/container_apps/env/uat/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
env_short = "u"
cae_name = "cae"
workload_profile_name = "Consumption"

tags = {
CreatedBy = "Terraform"
Expand All @@ -11,9 +13,9 @@ tags = {
container_app = {
min_replicas = 1
max_replicas = 2
scale_rules = []
cpu = 0.5
memory = "1Gi"
scale_rules = []
cpu = 0.5
memory = "1Gi"
}


Expand Down
6 changes: 6 additions & 0 deletions infra/container_apps/locals.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
locals {
pnpg_suffix = var.is_pnpg == true ? "-pnpg" : ""
project = "selc-${var.env_short}"

container_app_environment_name = "${local.project}${local.pnpg_suffix}-${var.cae_name}"
}
16 changes: 9 additions & 7 deletions infra/container_apps/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ module "container_app_core" {

is_pnpg = var.is_pnpg

env_short = var.env_short
container_app = var.container_app
container_app_name = "ms-core"
image_name = "selfcare-ms-core"
image_tag = var.image_tag
app_settings = var.app_settings
secrets_names = var.secrets_names
env_short = var.env_short
container_app = var.container_app
container_app_name = "ms-core"
container_app_environment_name = local.container_app_environment_name
image_name = "selfcare-ms-core"
image_tag = var.image_tag
app_settings = var.app_settings
secrets_names = var.secrets_names
workload_profile_name = var.workload_profile_name

tags = var.tags
}
12 changes: 12 additions & 0 deletions infra/container_apps/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,16 @@ variable "app_settings" {
variable "secrets_names" {
type = map(string)
description = "KeyVault secrets to get values from"
}

variable "workload_profile_name" {
type = string
description = "Workload Profile name to use"
default = null
}

variable "cae_name" {
type = string
description = "Container App Environment name"
default = "cae-cp"
}

0 comments on commit 8ccc9cb

Please sign in to comment.