generated from pagopa/template-java-spring-microservice
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NOD-905] feat: add OpEx dashboards for internal, psp and organizatio…
…n APIs (#64) * [NOD-905] feat: add OpEx dashboards for internal, psp and organization APIs * [NOD-905] fix: updated secrets * [NOD-905] fix: removed storage account * [NOD-905] fix: updated identity folder --------- Co-authored-by: Francesco Cesareo <[email protected]>
- Loading branch information
1 parent
b8d9272
commit 0c3fd07
Showing
18 changed files
with
256 additions
and
18 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
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 | ||
}); | ||
}) | ||
); |
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 was deleted.
Oops, something went wrong.
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
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 @@ | ||
subscription=PROD-pagoPA |
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,4 @@ | ||
resource_group_name = "io-infra-rg" | ||
storage_account_name = "pagopainfraterraformprod" | ||
container_name = "azurermstate" | ||
key = "opex.pagopa-fdr.terraform.tfstate" |
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,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 |
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,11 @@ | ||
prefix = "pagopa" | ||
env_short = "p" | ||
|
||
|
||
tags = { | ||
CreatedBy = "Terraform" | ||
Environment = "Prod" | ||
Owner = "pagoPA" | ||
Source = "https://github.com/pagopa/pagopa-fdr" | ||
CostCenter = "TS310 - PAGAMENTI & SERVIZI" | ||
} |
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 @@ | ||
subscription=PROD-pagoPA |
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,4 @@ | ||
resource_group_name = "io-infra-rg" | ||
storage_account_name = "pagopainfraterraformprod" | ||
container_name = "azurermstate" | ||
key = "opex.pagopa-fdr.terraform.tfstate" |
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,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 |
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,11 @@ | ||
prefix = "pagopa" | ||
env_short = "p" | ||
|
||
|
||
tags = { | ||
CreatedBy = "Terraform" | ||
Environment = "Prod" | ||
Owner = "pagoPA" | ||
Source = "https://github.com/pagopa/pagopa-fdr" | ||
CostCenter = "TS310 - PAGAMENTI & SERVIZI" | ||
} |
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 @@ | ||
subscription=PROD-pagoPA |
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,4 @@ | ||
resource_group_name = "io-infra-rg" | ||
storage_account_name = "pagopainfraterraformprod" | ||
container_name = "azurermstate" | ||
key = "opex.pagopa-fdr.terraform.tfstate" |
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,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 |
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,11 @@ | ||
prefix = "pagopa" | ||
env_short = "p" | ||
|
||
|
||
tags = { | ||
CreatedBy = "Terraform" | ||
Environment = "Prod" | ||
Owner = "pagoPA" | ||
Source = "https://github.com/pagopa/pagopa-fdr" | ||
CostCenter = "TS310 - PAGAMENTI & SERVIZI" | ||
} |
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,6 @@ | ||
dependencies: | ||
- name: microservice-chart | ||
repository: https://pagopa.github.io/aks-microservice-chart-blueprint | ||
version: 3.0.0 | ||
digest: sha256:fbefefd4270c2f7fdaf9bc98b73465b58db72bdfeafcbb607c2736ba5fe67a5e | ||
generated: "2023-07-11T17:02:31.30818+02:00" |