diff --git a/.github/workflows/create_dashboard.yml b/.github/workflows/create_dashboard.yml index 1e75865..cc75374 100644 --- a/.github/workflows/create_dashboard.yml +++ b/.github/workflows/create_dashboard.yml @@ -3,35 +3,6 @@ name: Create Dashboard # Controls when the workflow will run on: workflow_dispatch: - # inputs: - # api-name: - # description: 'Api name for which create dashboards and alerts' - # required: true - # type: choice - # options: - # - pdf-engine-service - # environment: - # description: 'Environment for which create dashboards and alerts' - # required: true - # type: choice - # options: - # - uat - # - prod - # config-options: - # description: 'JSON string containing env properties that will be replaced into opex config.yaml file before dashboard generation' - # type: string - # required: false - # config-options-node: - # description: 'JSON string containing env properties that will be replaced into opex config.yaml file before dashboard generation' - # type: string - # required: false - - # repository_dispatch: - # types: - # - create-dashboard - -# env: -# TEMPLATE_DIR: azure-dashboard permissions: id-token: write @@ -43,10 +14,12 @@ jobs: dashboard: # The type of runner that the job will run on runs-on: ubuntu-22.04 + strategy: matrix: - environment: [uat, prod] - product: [pdf-engine-service, pdf-engine-service-node] + environment: [prod] + product: [pdf-engine-service, pdf-engine-service-node, pdf-engine-service-apimv2, pdf-engine-service-node-apimv2] + max-parallel: 1 environment: name: ${{ matrix.environment }} # Steps represent a sequence of tasks that will be executed as part of the job @@ -59,7 +32,7 @@ jobs: persist-credentials: false # from https://github.com/pagopa/opex-dashboard-azure-action/ - - uses: pagopa/opex-dashboard-azure-action@ece3bc2b133be74cabb50aec14cdb9b8051b886f # v1.1.2 + - uses: pagopa/opex-dashboard-azure-action@v1.1.2 with: environment: ${{ matrix.environment }} api-name: ${{ matrix.product }} @@ -69,54 +42,3 @@ jobs: subscription-id: ${{ secrets.SUBSCRIPTION_ID }} # from https://github.com/pagopa/opex-dashboard-azure-action/pkgs/container/opex-dashboard-azure-action docker-version: sha256:e4245954566cd3470e1b5527d33bb58ca132ce7493eac01be9e808fd25a11c8d - - # - name: Read create dashboard parameters - # id: read_parameters - # uses: actions/github-script@v6.3.3 - # env: - # # API_NAME: ${{ github.event.client_payload.api-name || inputs.api-name }} - # api-name: ${{ matrix.product }} - # ENVIRONMENT: ${{ github.event.client_payload.environment || inputs.environment }} - # with: - # script: | - # const { API_NAME, ENVIRONMENT } = process.env - # var apiName = API_NAME.trim(); - # var environment = ENVIRONMENT.trim(); - # core.info(`Api name ${apiName}, environment: ${environment}`); - # if (!apiName || !environment) { - # throw `Could not create dashboard, cannot find parameters for api name and environment...`; - # } - # core.setOutput("apiName", apiName); - # core.setOutput("environment", environment); - - # - name: Replace opex config file parameters java - # id: replace_opex_file_parameters_java - # env: - # CONFIG_FILE: .opex/${{ steps.read_parameters.outputs.apiName }}/env/${{ steps.read_parameters.outputs.environment }}/config.yaml - # CONFIG_OPTIONS: ${{ github.event.client_payload.config-options || inputs.config-options }} - # run: | - # echo "📝 Replacing config yaml placeholders" - # echo "Properties to be set: $CONFIG_OPTIONS into file $CONFIG_FILE" - # for property in $(echo $CONFIG_OPTIONS | yq -o shell); do - # IFS='=' read -r -a split <<< "$property" - # key=${split[0]} - # value=$(echo ${split[1]}|sed "s/'//g") - # echo "Replacing key: [$key] with value: [$value]" - # sed -i "s/\${$key}/$value/" $CONFIG_FILE - # done - # echo "Modified config file" - # cat $CONFIG_FILE - - # # this action create a folder named /azure-dashboard - # # from https://github.com/pagopa/opex-dashboard-azure-action/commits/main - # - name: create-dashboard-java - # uses: pagopa/opex-dashboard-azure-action@3ad80a5e4a2d5a8f342615637072f21b687320ce - # with: - # environment: ${{ steps.read_parameters.outputs.environment }} - # api-name: ${{ steps.read_parameters.outputs.apiName }} - # config: .opex/${{ steps.read_parameters.outputs.apiName }}/env/${{ steps.read_parameters.outputs.environment }}/config.yaml - # client-id: ${{ secrets.CLIENT_ID }} - # tenant-id: ${{ secrets.TENANT_ID }} - # subscription-id: ${{ secrets.SUBSCRIPTION_ID }} - # # from https://github.com/pagopa/opex-dashboard-azure-action/pkgs/container/opex-dashboard-azure-action - # docker-version: sha256:04d8ead53c772d23b094c2a395292dc159e6f2905e1b13b5f828f31eac6eb27f \ No newline at end of file diff --git a/.opex/pdf-engine-service-apimv2/env/prod/backend.ini b/.opex/pdf-engine-service-apimv2/env/prod/backend.ini new file mode 100644 index 0000000..432abea --- /dev/null +++ b/.opex/pdf-engine-service-apimv2/env/prod/backend.ini @@ -0,0 +1 @@ +subscription=PROD-pagoPA \ No newline at end of file diff --git a/.opex/pdf-engine-service-apimv2/env/prod/backend.tfvars b/.opex/pdf-engine-service-apimv2/env/prod/backend.tfvars new file mode 100644 index 0000000..9fcee47 --- /dev/null +++ b/.opex/pdf-engine-service-apimv2/env/prod/backend.tfvars @@ -0,0 +1,4 @@ +resource_group_name = "io-infra-rg" +storage_account_name = "pagopainfraterraformprod" +container_name = "azurermstate" +key = "opex.pagopa-pdf-engine-apimv2.terraform.tfstate" \ No newline at end of file diff --git a/.opex/pdf-engine-service-apimv2/env/prod/config.yaml b/.opex/pdf-engine-service-apimv2/env/prod/config.yaml new file mode 100644 index 0000000..77a73d1 --- /dev/null +++ b/.opex/pdf-engine-service-apimv2/env/prod/config.yaml @@ -0,0 +1,23 @@ +# oa3_spec: https://raw.githubusercontent.com/pagopa/pagopa-infra/main/src/domains/shared-app/api/pdf-engine/v1/_openapi.json.tpl # If start with http the file would be downloaded from the internet +oa3_spec: ./openapi/openapi.json +name: opex_pagopa-pdf-engine-apimv2 +location: West Europe +timespan: 5m +# data_source: /subscriptions/b9fc9419-6097-45fe-9f74-ba0641c91912/resourceGroups/pagopa-p-vnet-rg/providers/Microsoft.Network/applicationGateways/pagopa-p-app-gw +# resource_type: app-gateway +# data_source: /subscriptions/b9fc9419-6097-45fe-9f74-ba0641c91912/resourceGroups/pagopa-p-api-rg/providers/Microsoft.ApiManagement/service/pagopa-p-apim +data_source: /subscriptions/b9fc9419-6097-45fe-9f74-ba0641c91912/resourceGroups/pagopa-p-api-rg/providers/Microsoft.ApiManagement/service/pagopa-p-weu-core-apim-v2 +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 + - /subscriptions/b9fc9419-6097-45fe-9f74-ba0641c91912/resourceGroups/pagopa-p-monitor-rg/providers/microsoft.insights/actionGroups/Opsgenie +overrides: + hosts: + - api.platform.pagopa.it + endpoints: + /shared/pdf-engine/v1/generate-pdf: + response_time_threshold: 8 # Default: 1 + response_time_evaluation_frequency: 10 # Default: 10 + response_time_evaluation_time_window: 30 # Default: 20 + response_time_event_occurrences: 5 # Default: 1 \ No newline at end of file diff --git a/.opex/pdf-engine-service-apimv2/env/prod/terraform.tfvars b/.opex/pdf-engine-service-apimv2/env/prod/terraform.tfvars new file mode 100644 index 0000000..df8d9db --- /dev/null +++ b/.opex/pdf-engine-service-apimv2/env/prod/terraform.tfvars @@ -0,0 +1,11 @@ +prefix = "pagopa" +env_short = "p" + + +tags = { + CreatedBy = "Terraform" + Environment = "Prod" + Owner = "pagoPA" + Source = "https://github.com/pagopa/pagopa-pdf-engine" + CostCenter = "TS310 - PAGAMENTI & SERVIZI" +} \ No newline at end of file diff --git a/.opex/pdf-engine-service-node-apimv2/env/prod/backend.ini b/.opex/pdf-engine-service-node-apimv2/env/prod/backend.ini new file mode 100644 index 0000000..432abea --- /dev/null +++ b/.opex/pdf-engine-service-node-apimv2/env/prod/backend.ini @@ -0,0 +1 @@ +subscription=PROD-pagoPA \ No newline at end of file diff --git a/.opex/pdf-engine-service-node-apimv2/env/prod/backend.tfvars b/.opex/pdf-engine-service-node-apimv2/env/prod/backend.tfvars new file mode 100644 index 0000000..f0c72dd --- /dev/null +++ b/.opex/pdf-engine-service-node-apimv2/env/prod/backend.tfvars @@ -0,0 +1,4 @@ +resource_group_name = "io-infra-rg" +storage_account_name = "pagopainfraterraformprod" +container_name = "azurermstate" +key = "opex.pagopa-pdf-engine-node-apimv2.terraform.tfstate" \ No newline at end of file diff --git a/.opex/pdf-engine-service-node-apimv2/env/prod/config.yaml b/.opex/pdf-engine-service-node-apimv2/env/prod/config.yaml new file mode 100644 index 0000000..1dedeb8 --- /dev/null +++ b/.opex/pdf-engine-service-node-apimv2/env/prod/config.yaml @@ -0,0 +1,23 @@ +# oa3_spec: https://raw.githubusercontent.com/pagopa/pagopa-infra/main/src/domains/shared-app/api/pdf-engine-node/v1/_openapi.json.tpl # If start with http the file would be downloaded from the internet +oa3_spec: ./openapi/openapi_node.json +name: opex_pagopa-pdf-engine-node-apimv2 +location: West Europe +timespan: 5m +# data_source: /subscriptions/b9fc9419-6097-45fe-9f74-ba0641c91912/resourceGroups/pagopa-p-vnet-rg/providers/Microsoft.Network/applicationGateways/pagopa-p-app-gw +# resource_type: app-gateway +# data_source: /subscriptions/b9fc9419-6097-45fe-9f74-ba0641c91912/resourceGroups/pagopa-p-api-rg/providers/Microsoft.ApiManagement/service/pagopa-p-apim +data_source: /subscriptions/b9fc9419-6097-45fe-9f74-ba0641c91912/resourceGroups/pagopa-p-api-rg/providers/Microsoft.ApiManagement/service/pagopa-p-weu-core-apim-v2 +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 + - /subscriptions/b9fc9419-6097-45fe-9f74-ba0641c91912/resourceGroups/pagopa-p-monitor-rg/providers/microsoft.insights/actionGroups/Opsgenie +overrides: + hosts: + - api.platform.pagopa.it + endpoints: + /shared/pdf-engine-node/v1/generate-pdf: + response_time_threshold: 8 # Default: 1 + response_time_evaluation_frequency: 10 # Default: 10 + response_time_evaluation_time_window: 30 # Default: 20 + response_time_event_occurrences: 5 # Default: 1 \ No newline at end of file diff --git a/.opex/pdf-engine-service-node-apimv2/env/prod/terraform.tfvars b/.opex/pdf-engine-service-node-apimv2/env/prod/terraform.tfvars new file mode 100644 index 0000000..df8d9db --- /dev/null +++ b/.opex/pdf-engine-service-node-apimv2/env/prod/terraform.tfvars @@ -0,0 +1,11 @@ +prefix = "pagopa" +env_short = "p" + + +tags = { + CreatedBy = "Terraform" + Environment = "Prod" + Owner = "pagoPA" + Source = "https://github.com/pagopa/pagopa-pdf-engine" + CostCenter = "TS310 - PAGAMENTI & SERVIZI" +} \ No newline at end of file