123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- data "akamai_property_rules_template" "rules-template" {
- template_file = abspath("${path.root}/property-snippets/main.json")
- variables {
- name = "secure"
- value = "${var.secure}"
- type = "bool"
- }
- variables {
- name = "cp_code_id"
- value = "${var.cp_code_id}"
- type = "number"
- }
- variables {
- name = "UserID"
- value = "${var.UserID}"
- type = "string"
- }
- variables {
- name = "origin_hostname"
- value = "${var.origin_hostname}"
- type = "string"
- }
- }
-
- resource "akamai_property" "lab_property" {
- name = "${var.UserID}-cprlab"
- product_id = "prd_SPM"
- contract_id = "ctr_${var.contract_id}"
- group_id = "grp_${var.group_id}"
- hostnames {
- cname_from = "${var.UserID}.cpr-akashop.com"
- cname_to = var.edge_hostname
- cert_provisioning_type = "CPS_MANAGED"
- }
- rule_format = "v2024-08-13"
- rules = data.akamai_property_rules_template.rules-template.json
- }
-
- resource "akamai_property_activation" "activation_staging" {
- property_id = "${akamai_property.lab_property.id}"
- version = "${akamai_property.lab_property.latest_version}"
- network = "${var.network}"
- contact = ["${var.email}"]
- note = "Content Protector Lab"
- auto_acknowledge_rule_warnings = true
- timeouts {
- default = "1h"
- }
- }
-
- data "akamai_property_hostnames" "property_hostnames" {
- contract_id = "ctr_${var.contract_id}"
- group_id = "grp_${var.group_id}"
- property_id = "${akamai_property.lab_property.id}"
- }
-
- output "property_id" {
- value = "${akamai_property.lab_property.id}"
- }
-
- output "property_hostnames" {
- value = data.akamai_property_hostnames.property_hostnames.hostnames
- }
|