Skip to content

Commit

Permalink
updates documentation for custom policy resource to add more examples
Browse files Browse the repository at this point in the history
  • Loading branch information
soufi committed Feb 6, 2024
1 parent 36f5733 commit 7c83dab
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/resources/apim_policy_custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,26 @@ resource "anypoint_apim_policy_custom" "policy_custom_05" {
responseExpression = "#[[200, 203, 204, 206, 300, 301, 404, 405, 410, 414, 501] contains attributes.statusCode]"
})
}
#Spike Control Policy Example
resource "anypoint_apim_policy_custom" "policy_custom_05" {
org_id = var.root_org
env_id = var.env_id
apim_id = anypoint_apim_mule4.api.id
disabled = false
asset_group_id="68ef9520-24e9-4cf2-b2f5-620025690913"
asset_id="spike-control"
asset_version = "1.2.1"
configuration_data = jsonencode({
maximumRequests = 1
timePeriodInMilliseconds = 1000
delayTimeInMillis = 1000
delayAttempts = 1
queuingLimit = 5
exposeHeaders = true
})
}
```

<!-- schema generated by tfplugindocs -->
Expand Down
20 changes: 20 additions & 0 deletions examples/resources/anypoint_apim_policy_custom/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,24 @@ resource "anypoint_apim_policy_custom" "policy_custom_05" {
requestExpression = "#[attributes.method == 'GET' or attributes.method == 'HEAD']"
responseExpression = "#[[200, 203, 204, 206, 300, 301, 404, 405, 410, 414, 501] contains attributes.statusCode]"
})
}

#Spike Control Policy Example
resource "anypoint_apim_policy_custom" "policy_custom_05" {
org_id = var.root_org
env_id = var.env_id
apim_id = anypoint_apim_mule4.api.id
disabled = false
asset_group_id="68ef9520-24e9-4cf2-b2f5-620025690913"
asset_id="spike-control"
asset_version = "1.2.1"

configuration_data = jsonencode({
maximumRequests = 1
timePeriodInMilliseconds = 1000
delayTimeInMillis = 1000
delayAttempts = 1
queuingLimit = 5
exposeHeaders = true
})
}

0 comments on commit 7c83dab

Please sign in to comment.