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

chore: Alert OPEX x apim V2 #10

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 4 additions & 36 deletions .github/workflows/create_dashboard.yml
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.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.
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-platform-authorizer-config-apimv2.terraform.tfstate"
13 changes: 13 additions & 0 deletions .opex/apim_v2/env/prod/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
oa3_spec: ./openapi/openapi.json
name: opex_pagopa-platform-authorizer-config-apimv2
location: West Europe
timespan: 5m
# 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:
- 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-platform-authorizer-config"
CostCenter = "TS310 - PAGAMENTI & SERVIZI"
}
Loading