API endpoints
akamai_appsec_api_endpoints
Get details about all of the API endpoints associated with a given configuration or add a filter to limit what comes back to a particular security policy or API name.
data "akamai_appsec_api_endpoints" "my_endpoints" {
config_id = 12345
}
output "my_endpoints" {
value = data.akamai_appsec_api_endpoints.my_endpoints
}
Changes to Outputs:
+ my_endpoints = {
+ api_name = null
+ config_id = 12345
+ id = "12345"
+ id_list = [
+ 987654,
+ 876543,
]
+ json = jsonencode(
{
+ apiEndpoints = [
+ {
+ apiEndPointHosts = [
+ "*example.com",
]
+ basePath = "/my/api/1"
+ id = 987654
+ name = "My API 1"
+ productionVersion = {
+ status = "ACTIVATED"
+ versionNumber = 2
}
+ requestConstraintsEnabled = false
+ stagingVersion = {
+ status = "DEACTIVATED"
+ versionNumber = 1
}
},
+ {
+ apiEndPointHosts = [
+ "www.my-example.com",
+ "my-other-example.com",
]
+ basePath = "/my/other/api"
+ id = 876543
+ name = "My API 2"
+ productionVersion = {
+ status = "ACTIVE"
+ versionNumber = 1
}
+ requestConstraintsEnabled = false
+ stagingVersion = {
+ status = "ACTIVE"
+ versionNumber = 1
}
},
]
}
)
+ output_text = <<-EOT
+-------------------------------------------------------+
| apiEndpointsDS |
+---------+---------------------------------------------+
| ID | ENDPOINT NAME |
+---------+---------------------------------------------+
| 987654 | My API 1 |
| 876543 | My API 2 |
+---------+---------------------------------------------+
EOT
+ security_policy_id = null
}
variable "endpoint_id" {
type = integer
description = "My endpoint ID"
default = 12345
// local
api_endpoint_id = data.akamai_appsec_api_endpoints.my_endpoints.id
// tvars
api_endpoint_id = var.endpoint_id
Once you have your endpoint(s) ID, use it to update your API's request constraint trigger in the API request constraints resource.
Arguments
Argument | Required | Description |
---|---|---|
config_id | ✔️ | Your security configuration's identifier. |
security_policy_id | A security policy identifier. Using this argument filters the response details to the endpoints associated with the given policy. | |
api_name | The name of an API endpoint. Using this argument filters the response details to only those of the given endpoint. |
Attributes
Returned to you is a computed, JSON-encoded object listing your API endpoints and their IDs, names, network activation status, and version numbers.
The default output is to the command line, but you can change the delivery method of the output by adding an option to your output block's value argument.
Option | Description |
---|---|
id_list | A list of API endpoint IDs. |
json | A JSON-encoded list of information about the API endpoints. |
output_text | A tabular report listing the name and ID of your endpoints. |
Updated over 1 year ago