-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [SRTP-72] add activation api draft (#5)
- Loading branch information
1 parent
22e6712
commit 0e1cdbf
Showing
2 changed files
with
77 additions
and
0 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,54 @@ | ||
## RTP Activation API ## | ||
resource "azurerm_api_management_api_version_set" "rtp_activation_api" { | ||
name = "${var.env_short}-rtp-activation-api" | ||
api_management_name = data.azurerm_api_management.this.name | ||
resource_group_name = data.azurerm_api_management.this.resource_group_name | ||
|
||
display_name = "RTP Activation API" | ||
versioning_scheme = "Header" | ||
version_header_name = "Version" | ||
} | ||
|
||
|
||
resource "azurerm_api_management_api" "rtp_activation_api" { | ||
name = "${var.env_short}-rtp-activation-api" | ||
api_management_name = data.azurerm_api_management.this.name | ||
resource_group_name = data.azurerm_api_management.this.resource_group_name | ||
|
||
version_set_id = azurerm_api_management_api_version_set.rtp_activation_api.id | ||
|
||
revision = "1" | ||
version = "v1" | ||
description = "RTP Activation API" | ||
display_name = "RTP Activation API" | ||
path = "rtp/activation" | ||
protocols = ["https"] | ||
subscription_required = false | ||
|
||
depends_on = [azurerm_api_management_product.rtp] | ||
|
||
import { | ||
content_format = "openapi" | ||
content_value = templatefile("./api/pagopa/activation.yaml", {}) | ||
} | ||
} | ||
|
||
resource "azurerm_api_management_product_api" "rtp_activation_product_api" { | ||
api_management_name = data.azurerm_api_management.this.name | ||
resource_group_name = data.azurerm_api_management.this.resource_group_name | ||
api_name = azurerm_api_management_api.rtp_activation_api.name | ||
product_id = azurerm_api_management_product.rtp.product_id | ||
depends_on = [azurerm_api_management_product.rtp, azurerm_api_management_api.rtp_activation_api] | ||
} | ||
|
||
## Override API Operations Policies ## | ||
resource "azurerm_api_management_api_operation_policy" "rtp_activate_policy" { | ||
api_name = azurerm_api_management_api.rtp_activation_api.name | ||
api_management_name = data.azurerm_api_management.this.name | ||
resource_group_name = data.azurerm_api_management.this.resource_group_name | ||
operation_id = "activate" | ||
|
||
xml_content = templatefile("./api/pagopa/activation_policy.xml", { | ||
base_url : "${local.rtp_base_url}/${azurerm_api_management_api.rtp_activation_api.path}/${azurerm_api_management_api.rtp_activation_api.version}/rtps" | ||
}) | ||
} |
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,23 @@ | ||
<!-- | ||
IMPORTANT: | ||
- Policy elements can appear only within the <inbound>, <outbound>, <backend> section elements. | ||
- To apply a policy to the incoming request (before it is forwarded to the backend service), place a corresponding policy element within the <inbound> section element. | ||
- To apply a policy to the outgoing response (before it is sent back to the caller), place a corresponding policy element within the <outbound> section element. | ||
- To add a policy, place the cursor at the desired insertion point and select a policy from the sidebar. | ||
- To remove a policy, delete the corresponding policy statement from the policy document. | ||
- Position the <base> element within a section element to inherit all policies from the corresponding section element in the enclosing scope. | ||
- Remove the <base> element to prevent inheriting policies from the corresponding section element in the enclosing scope. | ||
- Policies are applied in the order of their appearance, from the top down. | ||
- Comments within policy elements are not supported and may disappear. Place your comments between policy elements or at a higher level scope. | ||
--> | ||
<policies> | ||
<backend> | ||
<base /> | ||
</backend> | ||
<outbound> | ||
<base /> | ||
</outbound> | ||
<on-error> | ||
<base /> | ||
</on-error> | ||
</policies> |