|
|
@@ -1,6 +1,6 @@ |
|
|
|
resource "akamai_appsec_configuration" "sec_config" { |
|
|
|
name = "${var.UserID}-csplab" |
|
|
|
description = "Security config for CSP lab hostname" |
|
|
|
name = "${var.UserID}-cpclab" |
|
|
|
description = "Security config for CPC lab hostname" |
|
|
|
contract_id = var.contract_id |
|
|
|
group_id = var.group_id |
|
|
|
host_names = ["${var.UserID}.fm.akamaiusec.com"] |
|
|
@@ -8,43 +8,43 @@ resource "akamai_appsec_configuration" "sec_config" { |
|
|
|
} |
|
|
|
|
|
|
|
data "akamai_appsec_configuration" "sec_config" { |
|
|
|
name = "${var.UserID}-csplab" |
|
|
|
name = "${var.UserID}-cpclab" |
|
|
|
depends_on = [akamai_appsec_configuration.sec_config] |
|
|
|
} |
|
|
|
|
|
|
|
resource "akamai_appsec_security_policy" "CSPLab" { |
|
|
|
resource "akamai_appsec_security_policy" "CPCLab" { |
|
|
|
config_id = akamai_appsec_configuration.sec_config.config_id |
|
|
|
default_settings = true |
|
|
|
security_policy_name = "${var.UserID}-CSPLab" |
|
|
|
security_policy_name = "${var.UserID}-CPCLab" |
|
|
|
security_policy_prefix = "0001" |
|
|
|
} |
|
|
|
|
|
|
|
resource "akamai_appsec_match_target" "match_target" { |
|
|
|
config_id = akamai_appsec_configuration.sec_config.config_id |
|
|
|
depends_on = [akamai_appsec_security_policy.CSPLab] |
|
|
|
depends_on = [akamai_appsec_security_policy.CPCLab] |
|
|
|
match_target = <<EOT |
|
|
|
{ |
|
|
|
"defaultFile": "NO_MATCH", |
|
|
|
"filePaths": ["/*"], |
|
|
|
"hostnames": ["${var.UserID}.fm.akamaiusec.com"], |
|
|
|
"securityPolicy": { |
|
|
|
"policyId": "${akamai_appsec_security_policy.CSPLab.security_policy_id}" |
|
|
|
"policyId": "${akamai_appsec_security_policy.CPCLab.security_policy_id}" |
|
|
|
}, |
|
|
|
"type": "website" |
|
|
|
} |
|
|
|
EOT |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
resource "akamai_appsec_version_notes" "version_notes" { |
|
|
|
config_id = akamai_appsec_configuration.sec_config.config_id |
|
|
|
version_notes = "Basic security configuration for CSP lab" |
|
|
|
version_notes = "Basic security configuration for CPC lab" |
|
|
|
depends_on = [akamai_appsec_configuration.sec_config] |
|
|
|
} |
|
|
|
|
|
|
|
resource "akamai_appsec_activations" "activation" { |
|
|
|
config_id = akamai_appsec_configuration.sec_config.config_id |
|
|
|
network = var.network |
|
|
|
note = "Security Config for CSP lab" |
|
|
|
note = "Security Config for CPC lab" |
|
|
|
notification_emails = ["${var.email}"] |
|
|
|
version = data.akamai_appsec_configuration.sec_config.latest_version |
|
|
|
depends_on = [akamai_appsec_match_target.match_target] |