Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nod 841 fdr sviluppo fase 3 riversamento su event hub per qi #67

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
77e9a6b
NOD-841 ehub wip
mscattarella May 30, 2024
6e18b4c
NOD-841 ehub wip
mscattarella May 31, 2024
db18dd8
NOD-841 ehub wip
mscattarella Jun 4, 2024
0c3fd07
[NOD-905] feat: add OpEx dashboards for internal, psp and organizatio…
andrea-deri Jun 5, 2024
2e89ae5
fix: changes on ApiConfig Cache invocation job (#68)
andrea-deri Jun 7, 2024
6864e11
Bump to version 1.0.17 [skip ci]
pagopa-github-bot Jun 7, 2024
4ab065b
fix: updated Chart.lock
andrea-deri Jun 7, 2024
54b7de3
Bump to version 1.0.18 [skip ci]
pagopa-github-bot Jun 7, 2024
b7e7c98
fix: resolved error on cron
andrea-deri Jun 7, 2024
b79b747
Bump to version 1.0.19 [skip ci]
pagopa-github-bot Jun 7, 2024
2c150a9
refactor eventhub
mscattarella Jun 10, 2024
1f92249
refactor eventhub
mscattarella Jun 10, 2024
644858f
refactor eventhub
mscattarella Jun 10, 2024
d54ae59
refactor eventhub
mscattarella Jun 10, 2024
5aded03
refactor eventhub
mscattarella Jun 10, 2024
3301b24
Bump to version 1.0.16-1-NOD-841-fdr-sviluppo-fase-3-riversamento-su-…
pagopa-github-bot Jun 14, 2024
566cf26
NOD-841 ehub wip
mscattarella May 30, 2024
bc1db42
NOD-841 ehub wip
mscattarella May 31, 2024
6d2eeee
NOD-841 ehub wip
mscattarella Jun 4, 2024
460ac47
refactor eventhub
mscattarella Jun 10, 2024
ecd1d8e
refactor eventhub
mscattarella Jun 10, 2024
96c261e
refactor eventhub
mscattarella Jun 10, 2024
5ee14f4
refactor eventhub
mscattarella Jun 10, 2024
ac11704
refactor eventhub
mscattarella Jun 10, 2024
624298f
fix resources
aomegax Jun 14, 2024
e146ac0
conflict fixed
aomegax Jun 14, 2024
84bbc0a
Bump to version 1.0.19-1-NOD-841-fdr-sviluppo-fase-3-riversamento-su-…
pagopa-github-bot Jun 14, 2024
26909b8
NOD-937
mscattarella Jun 19, 2024
9d599ac
NOD-937: [FDR] Eliminare il campo "password" da get fdr
fparisitas Jun 19, 2024
9d1b5d3
Bump to version 1.0.19-2-NOD-841-fdr-sviluppo-fase-3-riversamento-su-…
pagopa-github-bot Jun 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/04h_deploy_with_github_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
container_app_environment_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_NAME }}
resource_group_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_RESOURCE_GROUP_NAME }} # RG of the runner
pat_token: ${{ secrets.BOT_TOKEN_GITHUB }}
self_hosted_runner_image_tag: "latest"

deploy:
needs: [ create_runner ]
Expand Down
111 changes: 111 additions & 0 deletions .github/workflows/08_create_dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Create Dashboard

# Controls when the workflow will run
on:
push:
branches:
- main
paths:
- 'openapi/**'
- '.github/workflows/08_create_dashboard.yaml'
- '.opex/**'

workflow_dispatch:

permissions:
id-token: write
contents: read
deployments: write

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
dashboard:
# The type of runner that the job will run on
runs-on: ubuntu-22.04

strategy:
matrix:
environment: [prod]
environment:
name: ${{ matrix.environment }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
id: checkout
# from https://github.com/actions/checkout/commits/main
uses: actions/checkout@1f9a0c22da41e6ebfa534300ef656657ea2c6707
with:
persist-credentials: false

# from https://github.com/pagopa/opex-dashboard-azure-action/
# Internal APIs
- uses: pagopa/[email protected]
with:
environment: ${{ matrix.environment }}
api-name:
config: .opex/env/${{ matrix.environment }}/internal/config.yaml
client-id: ${{ secrets.CLIENT_ID }}
tenant-id: ${{ secrets.TENANT_ID }}
subscription-id: ${{ secrets.INTERNAL_SUBSCRIPTION_ID }}
# from https://github.com/pagopa/opex-dashboard-azure-action/pkgs/container/opex-dashboard-azure-action
docker-version: sha256:e4245954566cd3470e1b5527d33bb58ca132ce7493eac01be9e808fd25a11c8d

# from https://github.com/pagopa/opex-dashboard-azure-action/
# Organizations APIs
- uses: pagopa/[email protected]
with:
environment: ${{ matrix.environment }}
api-name:
config: .opex/env/${{ matrix.environment }}/organization/config.yaml
client-id: ${{ secrets.CLIENT_ID }}
tenant-id: ${{ secrets.TENANT_ID }}
subscription-id: ${{ secrets.ORG_SUBSCRIPTION_ID }}
# from https://github.com/pagopa/opex-dashboard-azure-action/pkgs/container/opex-dashboard-azure-action
docker-version: sha256:e4245954566cd3470e1b5527d33bb58ca132ce7493eac01be9e808fd25a11c8d

# from https://github.com/pagopa/opex-dashboard-azure-action/
# PSPs APIs
- uses: pagopa/[email protected]
with:
environment: ${{ matrix.environment }}
api-name:
config: .opex/env/${{ matrix.environment }}/psp/config.yaml
client-id: ${{ secrets.CLIENT_ID }}
tenant-id: ${{ secrets.TENANT_ID }}
subscription-id: ${{ secrets.PSP_SUBSCRIPTION_ID }}
# from https://github.com/pagopa/opex-dashboard-azure-action/pkgs/container/opex-dashboard-azure-action
docker-version: sha256:e4245954566cd3470e1b5527d33bb58ca132ce7493eac01be9e808fd25a11c8d

delete_github_deployments:
runs-on: ubuntu-latest
needs: dashboard
if: ${{ always() }}
steps:
- name: Delete Previous deployments
uses: actions/github-script@v6
env:
SHA_HEAD: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.sha) || github.sha}}
with:
script: |
const { SHA_HEAD } = process.env

const deployments = await github.rest.repos.listDeployments({
owner: context.repo.owner,
repo: context.repo.repo,
sha: SHA_HEAD
});
await Promise.all(
deployments.data.map(async (deployment) => {
await github.rest.repos.createDeploymentStatus({
owner: context.repo.owner,
repo: context.repo.repo,
deployment_id: deployment.id,
state: 'inactive'
});
return github.rest.repos.deleteDeployment({
owner: context.repo.owner,
repo: context.repo.repo,
deployment_id: deployment.id
});
})
);
62 changes: 52 additions & 10 deletions .identity/00_data.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
data "azurerm_storage_account" "tf_storage_account" {
name = "pagopainfraterraform${var.env}"
resource_group_name = "io-infra-rg"
}

data "azurerm_resource_group" "dashboards" {
name = "dashboards"
}

data "azurerm_resource_group" "apim_resource_group" {
name = "${local.product}-api-rg"
}

data "azurerm_kubernetes_cluster" "aks" {
name = local.aks_cluster.name
resource_group_name = local.aks_cluster.resource_group_name
Expand Down Expand Up @@ -41,6 +50,22 @@ data "azurerm_key_vault_secret" "key_vault_bot_token" {
key_vault_id = data.azurerm_key_vault.key_vault.id
}

data "azurerm_key_vault_secret" "key_vault_cucumber_token" {
name = "cucumber-token"
key_vault_id = data.azurerm_key_vault.key_vault.id
}

data "azurerm_key_vault_secret" "key_vault_slack_webhook_url" {
name = "slack-webhook-url"
key_vault_id = data.azurerm_key_vault.domain_key_vault.id
}

data "azurerm_key_vault_secret" "integration_test_internal_subscription_key" {
count = var.env_short == "p" ? 0 : 1
name = "integration-test-internal-subscription-key"
key_vault_id = data.azurerm_key_vault.domain_key_vault.id
}

data "azurerm_key_vault_secret" "integration_test_psp_subscription_key" {
count = var.env_short == "p" ? 0 : 1
name = "integration-test-psp-subscription-key"
Expand All @@ -53,26 +78,43 @@ data "azurerm_key_vault_secret" "integration_test_org_subscription_key" {
key_vault_id = data.azurerm_key_vault.domain_key_vault.id
}

data "azurerm_key_vault_secret" "opex_internal_subscription_key" {
count = var.env_short == "p" ? 1 : 0
name = "opex-internal-subscription-key"
key_vault_id = data.azurerm_key_vault.domain_key_vault.id
}

data "azurerm_key_vault_secret" "opex_psp_subscription_key" {
count = var.env_short == "p" ? 1 : 0
name = "opex-psp-subscription-key"
key_vault_id = data.azurerm_key_vault.domain_key_vault.id
}

data "azurerm_key_vault_secret" "opex_org_subscription_key" {
count = var.env_short == "p" ? 1 : 0
name = "opex-org-subscription-key"
key_vault_id = data.azurerm_key_vault.domain_key_vault.id
}

data "azurerm_key_vault_secret" "key_vault_slack_webhook_url" {
name = "slack-webhook-url"
key_vault_id = data.azurerm_key_vault.domain_key_vault.id
}

data "azurerm_key_vault_secret" "key_vault_integration_test_slack_webhook_url" {
name = "integrationtest-slack-webhook-url"
key_vault_id = data.azurerm_key_vault.nodo_key_vault.id
}
#data "azurerm_resource_group" "app_rg" {
# name = "${local.prefix}-${var.env_short}-${local.location_short}-${local.domain}-rg"
#}
#
#data "azurerm_storage_account" "integration_test_storage_account" {
# name = local.integration_test.storage_account_name
# resource_group_name = local.integration_test.storage_account_rg
#}

data "azurerm_user_assigned_identity" "identity_cd" {
name = "${local.product}-${local.domain}-01-github-cd-identity"
name = "${local.product}-${local.domain}-01-github-cd-identity"
resource_group_name = "${local.product}-identity-rg"
}

data "azurerm_storage_account" "integration_test_storage_account" {
name = local.integration_test.storage_account_name
resource_group_name = local.integration_test.storage_account_rg
}

data "azurerm_user_assigned_identity" "identity_ci" {
name = "${local.product}-${local.domain}-01-github-ci-identity"
resource_group_name = "${local.product}-identity-rg"
Expand Down
6 changes: 0 additions & 6 deletions .identity/02_application_action.tf

This file was deleted.

1 change: 1 addition & 0 deletions .identity/03_github_environment.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ locals {
"CD_CLIENT_ID" : data.azurerm_user_assigned_identity.identity_cd.client_id,
"CI_CLIENT_ID" : data.azurerm_user_assigned_identity.identity_ci.client_id,
"TENANT_ID" : data.azurerm_client_config.current.tenant_id,
"INTERNAL_SUBSCRIPTION_KEY": var.env_short != "p" ? data.azurerm_key_vault_secret.integration_test_internal_subscription_key[0].value : data.azurerm_key_vault_secret.opex_internal_subscription_key[0].value,
"SUBSCRIPTION_ID" : data.azurerm_subscription.current.subscription_id,
"PSP_SUBSCRIPTION_KEY": var.env_short != "p" ? data.azurerm_key_vault_secret.integration_test_psp_subscription_key[0].value : ""
"ORG_SUBSCRIPTION_KEY": var.env_short != "p" ? data.azurerm_key_vault_secret.integration_test_org_subscription_key[0].value : ""
Expand Down
4 changes: 2 additions & 2 deletions .identity/99_variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ locals {

integration_test = {
storage_account_name = "${local.prefix}${var.env_short}${local.location_short}sharedtstdtsa"
storage_account_rg = "${local.prefix}-${var.env_short}-${local.location_short}-shared-tst-dt-rg"
reports_folder = local.github.repository
storage_account_rg = "${local.prefix}-${var.env_short}-${local.location_short}-shared-tst-dt-rg"
reports_folder = local.github.repository
}

aks_cluster = {
Expand Down
1 change: 1 addition & 0 deletions .opex/env/prod/internal/backend.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
subscription=PROD-pagoPA
4 changes: 4 additions & 0 deletions .opex/env/prod/internal/backend.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource_group_name = "io-infra-rg"
storage_account_name = "pagopainfraterraformprod"
container_name = "azurermstate"
key = "opex.pagopa-fdr.terraform.tfstate"
12 changes: 12 additions & 0 deletions .opex/env/prod/internal/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
oa3_spec: ./openapi/openapi_internal.json # If start with http the file would be downloaded from the internet
name: opex_pagopa-fdr-internal
location: West Europe
timespan: 5m # Default, a number or a timespan https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/scalar-data-types/timespan
data_source: /subscriptions/b9fc9419-6097-45fe-9f74-ba0641c91912/resourceGroups/pagopa-p-api-rg/providers/Microsoft.ApiManagement/service/pagopa-p-apim
resource_type: api-management
action_groups:
- /subscriptions/b9fc9419-6097-45fe-9f74-ba0641c91912/resourceGroups/pagopa-p-monitor-rg/providers/microsoft.insights/actionGroups/PagoPA
- /subscriptions/b9fc9419-6097-45fe-9f74-ba0641c91912/resourceGroups/pagopa-p-monitor-rg/providers/microsoft.insights/actionGroups/SlackPagoPA
overrides:
hosts: # Use these hosts instead of those inside the OpenApi spec
- api.platform.pagopa.it
11 changes: 11 additions & 0 deletions .opex/env/prod/internal/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prefix = "pagopa"
env_short = "p"


tags = {
CreatedBy = "Terraform"
Environment = "Prod"
Owner = "pagoPA"
Source = "https://github.com/pagopa/pagopa-fdr"
CostCenter = "TS310 - PAGAMENTI & SERVIZI"
}
1 change: 1 addition & 0 deletions .opex/env/prod/organization/backend.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
subscription=PROD-pagoPA
4 changes: 4 additions & 0 deletions .opex/env/prod/organization/backend.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource_group_name = "io-infra-rg"
storage_account_name = "pagopainfraterraformprod"
container_name = "azurermstate"
key = "opex.pagopa-fdr.terraform.tfstate"
12 changes: 12 additions & 0 deletions .opex/env/prod/organization/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
oa3_spec: ./openapi/openapi_organization.json # If start with http the file would be downloaded from the internet
name: opex_pagopa-fdr-organization
location: West Europe
timespan: 5m # Default, a number or a timespan https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/scalar-data-types/timespan
data_source: /subscriptions/b9fc9419-6097-45fe-9f74-ba0641c91912/resourceGroups/pagopa-p-api-rg/providers/Microsoft.ApiManagement/service/pagopa-p-apim
resource_type: api-management
action_groups:
- /subscriptions/b9fc9419-6097-45fe-9f74-ba0641c91912/resourceGroups/pagopa-p-monitor-rg/providers/microsoft.insights/actionGroups/PagoPA
- /subscriptions/b9fc9419-6097-45fe-9f74-ba0641c91912/resourceGroups/pagopa-p-monitor-rg/providers/microsoft.insights/actionGroups/SlackPagoPA
overrides:
hosts: # Use these hosts instead of those inside the OpenApi spec
- api.platform.pagopa.it
11 changes: 11 additions & 0 deletions .opex/env/prod/organization/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prefix = "pagopa"
env_short = "p"


tags = {
CreatedBy = "Terraform"
Environment = "Prod"
Owner = "pagoPA"
Source = "https://github.com/pagopa/pagopa-fdr"
CostCenter = "TS310 - PAGAMENTI & SERVIZI"
}
1 change: 1 addition & 0 deletions .opex/env/prod/psp/backend.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
subscription=PROD-pagoPA
4 changes: 4 additions & 0 deletions .opex/env/prod/psp/backend.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource_group_name = "io-infra-rg"
storage_account_name = "pagopainfraterraformprod"
container_name = "azurermstate"
key = "opex.pagopa-fdr.terraform.tfstate"
12 changes: 12 additions & 0 deletions .opex/env/prod/psp/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
oa3_spec: ./openapi/openapi_psp.json # If start with http the file would be downloaded from the internet
name: opex_pagopa-fdr-psp
location: West Europe
timespan: 5m # Default, a number or a timespan https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/scalar-data-types/timespan
data_source: /subscriptions/b9fc9419-6097-45fe-9f74-ba0641c91912/resourceGroups/pagopa-p-api-rg/providers/Microsoft.ApiManagement/service/pagopa-p-apim
resource_type: api-management
action_groups:
- /subscriptions/b9fc9419-6097-45fe-9f74-ba0641c91912/resourceGroups/pagopa-p-monitor-rg/providers/microsoft.insights/actionGroups/PagoPA
- /subscriptions/b9fc9419-6097-45fe-9f74-ba0641c91912/resourceGroups/pagopa-p-monitor-rg/providers/microsoft.insights/actionGroups/SlackPagoPA
overrides:
hosts: # Use these hosts instead of those inside the OpenApi spec
- api.platform.pagopa.it
11 changes: 11 additions & 0 deletions .opex/env/prod/psp/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prefix = "pagopa"
env_short = "p"


tags = {
CreatedBy = "Terraform"
Environment = "Prod"
Owner = "pagoPA"
Source = "https://github.com/pagopa/pagopa-fdr"
CostCenter = "TS310 - PAGAMENTI & SERVIZI"
}
6 changes: 6 additions & 0 deletions helm/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: microservice-chart
repository: https://pagopa.github.io/aks-microservice-chart-blueprint
version: 3.0.0
digest: sha256:47c6b74ce3ca60c2d4eee8e65c65597e5f62fb420653fcaec310eaa51b472413
generated: "2024-06-07T10:36:14.009226+02:00"
4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: pagopa-fdr-chart
description: Flussi di rendicontazioni
type: application
version: "1.19.0"
appVersion: "1.0.16"
version: "1.24.0"
appVersion: "1.0.19-2-NOD-841-fdr-sviluppo-fase-3-riversamento-su-event-hub-per-qi"
dependencies:
- name: microservice-chart
version: 3.0.0
Expand Down
Loading
Loading