|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- resource "akamai_appsec_configuration" "sec_config" {
- name = "${var.UserID}-cprlab"
- description = "Security config for API Security lab hostname"
- contract_id = var.contract_id
- group_id = var.group_id
- host_names = ["${var.UserID}.cpr-akashop.com"]
- depends_on = [akamai_property_activation.activation_staging]
- }
-
- data "akamai_appsec_configuration" "sec_config" {
- name = "${var.UserID}-cprlab"
- depends_on = [akamai_appsec_configuration.sec_config]
- }
-
- resource "akamai_appsec_security_policy" "CPRLab" {
- config_id = akamai_appsec_configuration.sec_config.config_id
- default_settings = true
- security_policy_name = "${var.UserID}-CPRLab"
- 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.CPRLab]
- match_target = <<EOT
- {
- "defaultFile": "NO_MATCH",
- "filePaths": ["/*"],
- "hostnames": ["${var.UserID}.cpr-akashop.com"],
- "securityPolicy": {
- "policyId": "${akamai_appsec_security_policy.CPRLab.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 CPR 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 CPR lab"
- notification_emails = ["${var.email}"]
- version = data.akamai_appsec_configuration.sec_config.latest_version
- depends_on = [akamai_appsec_match_target.match_target]
- }
-
- output "sec_config_name" {
- value = data.akamai_appsec_configuration.sec_config.name
- }
|