You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

property.tf 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. data "akamai_property_rules_template" "rules-template" {
  2. template_file = abspath("${path.root}/property-snippets/main.json")
  3. variables {
  4. name = "secure"
  5. value = "${var.secure}"
  6. type = "bool"
  7. }
  8. variables {
  9. name = "cp_code_id"
  10. value = "${var.cp_code_id}"
  11. type = "number"
  12. }
  13. variables {
  14. name = "UserID"
  15. value = "${var.UserID}"
  16. type = "string"
  17. }
  18. variables {
  19. name = "origin_hostname"
  20. value = "${var.origin_hostname}"
  21. type = "string"
  22. }
  23. }
  24. resource "akamai_property" "lab_property" {
  25. name = "${var.UserID}-cpclab"
  26. product_id = "prd_SPM"
  27. contract_id = "ctr_${var.contract_id}"
  28. group_id = "grp_${var.group_id}"
  29. hostnames {
  30. cname_from = "${var.UserID}.fm.akamaiusec.com"
  31. cname_to = var.edge_hostname
  32. cert_provisioning_type = "CPS_MANAGED"
  33. }
  34. rule_format = "v2024-08-13"
  35. rules = data.akamai_property_rules_template.rules-template.json
  36. }
  37. resource "akamai_property_activation" "activation_staging" {
  38. property_id = "${akamai_property.lab_property.id}"
  39. version = "${akamai_property.lab_property.latest_version}"
  40. network = "${var.network}"
  41. contact = ["${var.email}"]
  42. note = "CPS Lab"
  43. auto_acknowledge_rule_warnings = true
  44. timeouts {
  45. default = "1h"
  46. }
  47. }
  48. data "akamai_property_hostnames" "property_hostnames" {
  49. contract_id = "ctr_${var.contract_id}"
  50. group_id = "grp_${var.group_id}"
  51. property_id = "${akamai_property.lab_property.id}"
  52. }
  53. output "property_id" {
  54. value = "${akamai_property.lab_property.id}"
  55. }
  56. output "property_hostnames" {
  57. value = data.akamai_property_hostnames.property_hostnames.hostnames
  58. }