Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

security.tf 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. resource "akamai_appsec_configuration" "sec_config" {
  2. name = "${var.UserID}-cprlab"
  3. description = "Security config for API Security lab hostname"
  4. contract_id = var.contract_id
  5. group_id = var.group_id
  6. host_names = ["${var.UserID}.cpr-akashop.com"]
  7. depends_on = [akamai_property_activation.activation_staging]
  8. }
  9. data "akamai_appsec_configuration" "sec_config" {
  10. name = "${var.UserID}-cprlab"
  11. depends_on = [akamai_appsec_configuration.sec_config]
  12. }
  13. resource "akamai_appsec_security_policy" "CPRLab" {
  14. config_id = akamai_appsec_configuration.sec_config.config_id
  15. default_settings = true
  16. security_policy_name = "${var.UserID}-CPRLab"
  17. security_policy_prefix = "0001"
  18. }
  19. resource "akamai_appsec_match_target" "match_target" {
  20. config_id = akamai_appsec_configuration.sec_config.config_id
  21. depends_on = [akamai_appsec_security_policy.CPRLab]
  22. match_target = <<EOT
  23. {
  24. "defaultFile": "NO_MATCH",
  25. "filePaths": ["/*"],
  26. "hostnames": ["${var.UserID}.cpr-akashop.com"],
  27. "securityPolicy": {
  28. "policyId": "${akamai_appsec_security_policy.CPRLab.security_policy_id}"
  29. },
  30. "type": "website"
  31. }
  32. EOT
  33. }
  34. resource "akamai_appsec_version_notes" "version_notes" {
  35. config_id = akamai_appsec_configuration.sec_config.config_id
  36. version_notes = "Basic security configuration for CPR lab"
  37. depends_on = [akamai_appsec_configuration.sec_config]
  38. }
  39. resource "akamai_appsec_activations" "activation" {
  40. config_id = akamai_appsec_configuration.sec_config.config_id
  41. network = var.network
  42. note = "Security Config for CPR lab"
  43. notification_emails = ["${var.email}"]
  44. version = data.akamai_appsec_configuration.sec_config.latest_version
  45. depends_on = [akamai_appsec_match_target.match_target]
  46. }
  47. output "sec_config_name" {
  48. value = data.akamai_appsec_configuration.sec_config.name
  49. }