Browse Source

Updated CSP to CPC

main
kusum 2 months ago
parent
commit
1f174c8ff9

AUPropertyAutomation/csp-lab/akamai.tf → AUPropertyAutomation/cpc-lab/akamai.tf View File


AUPropertyAutomation/csp-lab/property-snippets/Accelerate_delivery.json → AUPropertyAutomation/cpc-lab/property-snippets/Accelerate_delivery.json View File


AUPropertyAutomation/csp-lab/property-snippets/Augment_insights.json → AUPropertyAutomation/cpc-lab/property-snippets/Augment_insights.json View File


AUPropertyAutomation/csp-lab/property-snippets/Increase_availability.json → AUPropertyAutomation/cpc-lab/property-snippets/Increase_availability.json View File


AUPropertyAutomation/csp-lab/property-snippets/Minimize_payload.json → AUPropertyAutomation/cpc-lab/property-snippets/Minimize_payload.json View File


AUPropertyAutomation/csp-lab/property-snippets/Offload_origin.json → AUPropertyAutomation/cpc-lab/property-snippets/Offload_origin.json View File


AUPropertyAutomation/csp-lab/property-snippets/Strengthen_security.json → AUPropertyAutomation/cpc-lab/property-snippets/Strengthen_security.json View File


AUPropertyAutomation/csp-lab/property-snippets/main.json → AUPropertyAutomation/cpc-lab/property-snippets/main.json View File

{ {
"comments": "CSP Lab property",
"comments": "CPC Lab property",
"rules": { "rules": {
"name": "default", "name": "default",
"behaviors": [ "behaviors": [

AUPropertyAutomation/csp-lab/property.tf → AUPropertyAutomation/cpc-lab/property.tf View File

} }


resource "akamai_property" "lab_property" { resource "akamai_property" "lab_property" {
name = "${var.UserID}-csplab"
name = "${var.UserID}-cpclab"
product_id = "prd_SPM" product_id = "prd_SPM"
contract_id = "ctr_${var.contract_id}" contract_id = "ctr_${var.contract_id}"
group_id = "grp_${var.group_id}" group_id = "grp_${var.group_id}"
version = "${akamai_property.lab_property.latest_version}" version = "${akamai_property.lab_property.latest_version}"
network = "${var.network}" network = "${var.network}"
contact = ["${var.email}"] contact = ["${var.email}"]
note = "CSP Lab"
note = "CPS Lab"
auto_acknowledge_rule_warnings = true auto_acknowledge_rule_warnings = true
timeouts { timeouts {
default = "1h" default = "1h"

AUPropertyAutomation/csp-lab/security.tf → AUPropertyAutomation/cpc-lab/security.tf View File

resource "akamai_appsec_configuration" "sec_config" { 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 contract_id = var.contract_id
group_id = var.group_id group_id = var.group_id
host_names = ["${var.UserID}.fm.akamaiusec.com"] host_names = ["${var.UserID}.fm.akamaiusec.com"]
} }


data "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] 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 config_id = akamai_appsec_configuration.sec_config.config_id
default_settings = true default_settings = true
security_policy_name = "${var.UserID}-CSPLab"
security_policy_name = "${var.UserID}-CPCLab"
security_policy_prefix = "0001" security_policy_prefix = "0001"
} }


resource "akamai_appsec_match_target" "match_target" { resource "akamai_appsec_match_target" "match_target" {
config_id = akamai_appsec_configuration.sec_config.config_id 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 match_target = <<EOT
{ {
"defaultFile": "NO_MATCH", "defaultFile": "NO_MATCH",
"filePaths": ["/*"], "filePaths": ["/*"],
"hostnames": ["${var.UserID}.fm.akamaiusec.com"], "hostnames": ["${var.UserID}.fm.akamaiusec.com"],
"securityPolicy": { "securityPolicy": {
"policyId": "${akamai_appsec_security_policy.CSPLab.security_policy_id}"
"policyId": "${akamai_appsec_security_policy.CPCLab.security_policy_id}"
}, },
"type": "website" "type": "website"
} }
EOT EOT
}
}


resource "akamai_appsec_version_notes" "version_notes" { resource "akamai_appsec_version_notes" "version_notes" {
config_id = akamai_appsec_configuration.sec_config.config_id 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] depends_on = [akamai_appsec_configuration.sec_config]
} }


resource "akamai_appsec_activations" "activation" { resource "akamai_appsec_activations" "activation" {
config_id = akamai_appsec_configuration.sec_config.config_id config_id = akamai_appsec_configuration.sec_config.config_id
network = var.network network = var.network
note = "Security Config for CSP lab"
note = "Security Config for CPC lab"
notification_emails = ["${var.email}"] notification_emails = ["${var.email}"]
version = data.akamai_appsec_configuration.sec_config.latest_version version = data.akamai_appsec_configuration.sec_config.latest_version
depends_on = [akamai_appsec_match_target.match_target] depends_on = [akamai_appsec_match_target.match_target]

AUPropertyAutomation/csp-lab/variables.tf → AUPropertyAutomation/cpc-lab/variables.tf View File


AUPropertyAutomation/scripts/start_csplab.sh → AUPropertyAutomation/scripts/start_cpclab.sh View File

#!/bin/bash #!/bin/bash


echo $PWD && echo $PWD &&
cd csp-lab &&
cd cpc-lab &&
terraform init && terraform init &&
terraform plan -out=.plan && terraform plan -out=.plan &&
terraform apply .plan && terraform apply .plan &&

Loading…
Cancel
Save