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

[IOPLT-703] Add reference to APIM key and add new variables #1176

Merged
merged 4 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
9 changes: 5 additions & 4 deletions src/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
| [azurerm_key_vault_secret.app_backend_RECEIPT_SERVICE_API_KEY](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/key_vault_secret) | data source |
| [azurerm_key_vault_secret.app_backend_RECEIPT_SERVICE_TEST_API_KEY](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/key_vault_secret) | data source |
| [azurerm_key_vault_secret.app_backend_TEST_CGN_FISCAL_CODES](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/key_vault_secret) | data source |
| [azurerm_key_vault_secret.app_backend_TRIAL_SYSTEM_APIM_KEY](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/key_vault_secret) | data source |
| [azurerm_key_vault_secret.app_backend_TRIAL_SYSTEM_API_KEY](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/key_vault_secret) | data source |
| [azurerm_key_vault_secret.app_backend_UNIQUE_EMAIL_ENFORCEMENT_USER](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/key_vault_secret) | data source |
| [azurerm_key_vault_secret.fn_eucovidcert_API_KEY_APPBACKEND](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/key_vault_secret) | data source |
Expand Down Expand Up @@ -189,7 +190,7 @@
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_apim_alerts_enabled"></a> [apim\_alerts\_enabled](#input\_apim\_alerts\_enabled) | Enable alerts | `bool` | `true` | no |
| <a name="input_apim_autoscale"></a> [apim\_autoscale](#input\_apim\_autoscale) | Configure Apim autoscale on capacity metric | <pre>object(<br> {<br> enabled = bool<br> default_instances = number<br> minimum_instances = number<br> maximum_instances = number<br> scale_out_capacity_percentage = number<br> scale_out_time_window = string<br> scale_out_value = string<br> scale_out_cooldown = string<br> scale_in_capacity_percentage = number<br> scale_in_time_window = string<br> scale_in_value = string<br> scale_in_cooldown = string<br> }<br> )</pre> | n/a | yes |
| <a name="input_apim_autoscale"></a> [apim\_autoscale](#input\_apim\_autoscale) | Configure Apim autoscale on capacity metric | <pre>object(<br/> {<br/> enabled = bool<br/> default_instances = number<br/> minimum_instances = number<br/> maximum_instances = number<br/> scale_out_capacity_percentage = number<br/> scale_out_time_window = string<br/> scale_out_value = string<br/> scale_out_cooldown = string<br/> scale_in_capacity_percentage = number<br/> scale_in_time_window = string<br/> scale_in_value = string<br/> scale_in_cooldown = string<br/> }<br/> )</pre> | n/a | yes |
| <a name="input_apim_publisher_name"></a> [apim\_publisher\_name](#input\_apim\_publisher\_name) | # Apim | `string` | n/a | yes |
| <a name="input_apim_v2_sku"></a> [apim\_v2\_sku](#input\_apim\_v2\_sku) | n/a | `string` | n/a | yes |
| <a name="input_app_backend_autoscale_default"></a> [app\_backend\_autoscale\_default](#input\_app\_backend\_autoscale\_default) | The number of instances that are available for scaling if metrics are not available for evaluation. | `number` | `10` | no |
Expand Down Expand Up @@ -230,7 +231,7 @@
| <a name="input_citizen_auth_product"></a> [citizen\_auth\_product](#input\_citizen\_auth\_product) | Use product name from citizen\_auth domain locals | `string` | `"io-p"` | no |
| <a name="input_citizen_auth_revoke_queue_name"></a> [citizen\_auth\_revoke\_queue\_name](#input\_citizen\_auth\_revoke\_queue\_name) | Use queue storage name from citizen\_auth domain storage | `string` | `"pubkeys-revoke-v2"` | no |
| <a name="input_common_rg"></a> [common\_rg](#input\_common\_rg) | Common Virtual network resource group name. | `string` | `""` | no |
| <a name="input_ddos_protection_plan"></a> [ddos\_protection\_plan](#input\_ddos\_protection\_plan) | n/a | <pre>object({<br> id = string<br> enable = bool<br> })</pre> | `null` | no |
| <a name="input_ddos_protection_plan"></a> [ddos\_protection\_plan](#input\_ddos\_protection\_plan) | n/a | <pre>object({<br/> id = string<br/> enable = bool<br/> })</pre> | `null` | no |
| <a name="input_dns_default_ttl_sec"></a> [dns\_default\_ttl\_sec](#input\_dns\_default\_ttl\_sec) | value | `number` | `3600` | no |
| <a name="input_dns_zone_firmaconio_selfcare"></a> [dns\_zone\_firmaconio\_selfcare](#input\_dns\_zone\_firmaconio\_selfcare) | The dns subdomain. | `string` | `null` | no |
| <a name="input_dns_zone_io"></a> [dns\_zone\_io](#input\_dns\_zone\_io) | The dns subdomain. | `string` | `null` | no |
Expand Down Expand Up @@ -267,12 +268,12 @@
| <a name="input_redis_apim_capacity"></a> [redis\_apim\_capacity](#input\_redis\_apim\_capacity) | # Redis cache | `number` | `1` | no |
| <a name="input_redis_apim_family"></a> [redis\_apim\_family](#input\_redis\_apim\_family) | n/a | `string` | `"C"` | no |
| <a name="input_redis_apim_sku_name"></a> [redis\_apim\_sku\_name](#input\_redis\_apim\_sku\_name) | n/a | `string` | `"Standard"` | no |
| <a name="input_redis_common"></a> [redis\_common](#input\_redis\_common) | Redis Common configuration | <pre>object({<br> capacity = number<br> shard_count = number<br> family = string<br> sku_name = string<br> public_network_access_enabled = bool<br> rdb_backup_enabled = bool<br> rdb_backup_frequency = number<br> rdb_backup_max_snapshot_count = number<br> redis_version = string<br> })</pre> | n/a | yes |
| <a name="input_redis_common"></a> [redis\_common](#input\_redis\_common) | Redis Common configuration | <pre>object({<br/> capacity = number<br/> shard_count = number<br/> family = string<br/> sku_name = string<br/> public_network_access_enabled = bool<br/> rdb_backup_enabled = bool<br/> rdb_backup_frequency = number<br/> rdb_backup_max_snapshot_count = number<br/> redis_version = string<br/> })</pre> | n/a | yes |
| <a name="input_selfcare_external_hostname"></a> [selfcare\_external\_hostname](#input\_selfcare\_external\_hostname) | Selfcare external hostname | `string` | `"selfcare.pagopa.it"` | no |
| <a name="input_selfcare_plan_sku_capacity"></a> [selfcare\_plan\_sku\_capacity](#input\_selfcare\_plan\_sku\_capacity) | Selfcare app plan capacity | `number` | `1` | no |
| <a name="input_selfcare_plan_sku_size"></a> [selfcare\_plan\_sku\_size](#input\_selfcare\_plan\_sku\_size) | Selfcare app plan sku size | `string` | `"P1v3"` | no |
| <a name="input_selfcare_plan_sku_tier"></a> [selfcare\_plan\_sku\_tier](#input\_selfcare\_plan\_sku\_tier) | Selfcare app plan sku tier | `string` | `"PremiumV3"` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | n/a | `map(any)` | <pre>{<br> "CreatedBy": "Terraform"<br>}</pre> | no |
| <a name="input_tags"></a> [tags](#input\_tags) | n/a | `map(any)` | <pre>{<br/> "CreatedBy": "Terraform"<br/>}</pre> | no |
| <a name="input_third_party_mock_remote_config_id"></a> [third\_party\_mock\_remote\_config\_id](#input\_third\_party\_mock\_remote\_config\_id) | The Remote Content Config ID of the Third Party Mock service | `string` | `"01HMVM4N4XFJ8VBR1FXYFZ9QFB"` | no |
| <a name="input_third_party_mock_service_id"></a> [third\_party\_mock\_service\_id](#input\_third\_party\_mock\_service\_id) | The Service ID of the Third Party Mock service | `string` | `"01GQQDPM127KFGG6T3660D5TXD"` | no |
| <a name="input_vnet_name"></a> [vnet\_name](#input\_vnet\_name) | Common Virtual network resource name. | `string` | `""` | no |
Expand Down
8 changes: 8 additions & 0 deletions src/core/app_backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ locals {
LOLLIPOP_API_URL = "https://${data.azurerm_linux_function_app.lollipop_function.default_hostname}"
LOLLIPOP_API_KEY = data.azurerm_key_vault_secret.app_backend_LOLLIPOP_ITN_API_KEY.value
TRIAL_SYSTEM_API_URL = "https://ts-p-itn-api-func-01.azurewebsites.net" # PROD-TRIAL subscription
TRIAL_SYSTEM_APIM_URL = "https://api.trial.pagopa.it" # Add this variable to avoid downtime
TRIAL_SYSTEM_API_KEY = data.azurerm_key_vault_secret.app_backend_TRIAL_SYSTEM_API_KEY.value
TRIAL_SYSTEM_APIM_KEY = data.azurerm_key_vault_secret.app_backend_TRIAL_SYSTEM_APIM_KEY.value
IO_WALLET_API_URL = "https://io-p-itn-wallet-user-func-01.azurewebsites.net"
IO_WALLET_API_KEY = data.azurerm_key_vault_secret.app_backend_IO_WALLET_API_KEY.value

Expand All @@ -64,6 +66,7 @@ locals {
IO_SIGN_API_BASE_PATH = "/api/v1/sign"
LOLLIPOP_API_BASE_PATH = "/api/v1"
TRIAL_SYSTEM_API_BASE_PATH = "/api/v1"
TRIAL_SYSTEM_APIM_BASE_PATH = "/manage/api/v1" # Add this variable to avoid downtime
IO_WALLET_API_BASE_PATH = "/api/v1/wallet"

// REDIS
Expand Down Expand Up @@ -505,6 +508,11 @@ data "azurerm_key_vault_secret" "app_backend_TRIAL_SYSTEM_API_KEY" {
key_vault_id = data.azurerm_key_vault.key_vault_common.id
}

data "azurerm_key_vault_secret" "app_backend_TRIAL_SYSTEM_APIM_KEY" {
name = "appbackend-TRIAL-SYSTEM-APIM-KEY"
key_vault_id = data.azurerm_key_vault.key_vault_common.id
}

data "azurerm_key_vault_secret" "app_backend_UNIQUE_EMAIL_ENFORCEMENT_USER" {
name = "appbackend-UNIQUE-EMAIL-ENFORCEMENT-USER"
key_vault_id = data.azurerm_key_vault.key_vault_common.id
Expand Down
Loading