Skip to content

Commit

Permalink
Merge pull request #40 from pagopa/PAGOPA-1857-infra-ri-creazione-ale…
Browse files Browse the repository at this point in the history
…rt-opex-x-apim-v-2

Alert OPEX x apim V2
  • Loading branch information
pasqualespica authored Jun 17, 2024
2 parents f3c0840 + 9c86e45 commit da8c42d
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 36 deletions.
40 changes: 4 additions & 36 deletions .github/workflows/create_dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
strategy:
matrix:
environment: [prod]
product: [apim_v1, apim_v2]
max-parallel: 1
environment:
name: ${{ matrix.environment }}
# Steps represent a sequence of tasks that will be executed as part of the job
Expand All @@ -41,44 +43,10 @@ jobs:
- uses: pagopa/[email protected]
with:
environment: ${{ matrix.environment }}
api-name:
config: .opex/env/${{ matrix.environment }}/config.yaml
api-name: ${{ matrix.product }}
config: .opex/${{ matrix.product }}/env/${{ matrix.environment }}/config.yaml
client-id: ${{ secrets.CD_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: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
});
})
);
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions .opex/apim_v2/env/prod/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/apim_v2/env/prod/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-afm-utils-apimv2.terraform.tfstate"
14 changes: 14 additions & 0 deletions .opex/apim_v2/env/prod/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
oa3_spec: ./openapi/openapi.json # If start with http the file would be downloaded from the internet
name: opex_pagopa-afm-utils-apimv2
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-vnet-rg/providers/Microsoft.Network/applicationGateways/pagopa-p-app-gw
# 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
overrides:
hosts: # Use these hosts instead of those inside the OpenApi spec
- api.platform.pagopa.it
11 changes: 11 additions & 0 deletions .opex/apim_v2/env/prod/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-afm-utils"
CostCenter = "TS310 - PAGAMENTI & SERVIZI"
}

0 comments on commit da8c42d

Please sign in to comment.