Переглянути джерело

Updated CPR lab code

main
kusum 2 місяці тому
джерело
коміт
0a20ea67d3

+ 1
- 1
GSAutomation/cpr-lab/akamai.tf Переглянути файл

@@ -2,7 +2,7 @@ terraform {
required_providers {
akamai = {
source = "akamai/akamai"
version = "6.2.0"
version = ">= 6.0.0"
}
}
required_version = ">= 1.0"

+ 171
- 181
GSAutomation/cpr-lab/property-snippets/Accelerate_delivery.json Переглянути файл

@@ -1,196 +1,186 @@
{
"name": "Accelerate delivery",
"children": [
{
"name": "Origin connectivity",
"children": [],
{
"behaviors": [
{
"name": "dnsAsyncRefresh",
"options": {
"enabled": true,
"timeout": "1h"
}
}
],
"comments": "Optimize the connection between edge and origin.",
"name": "Origin connectivity",
"options": {},
"criteriaMustSatisfy": "all"
},
{
"behaviors": [
{
"name": "enhancedAkamaiProtocol",
"options": {
"display": ""
}
},
{
"name": "http3",
"options": {
"enable": true
}
},
{
"name": "http2",
"options": {
"enabled": ""
}
},
{
"name": "allowTransferEncoding",
"options": {
"enabled": true
}
},
{
"name": "sureRoute",
"options": {
"enableCustomKey": false,
"enabled": true,
"forceSslForward": false,
"raceStatTtl": "30m",
"srDownloadLinkTitle": "",
"testObjectUrl": "/akamai/sureroute-test-object.html",
"toHostStatus": "INCOMING_HH",
"type": "PERFORMANCE"
}
}
],
"comments": "Serve your website using modern and fast protocols.",
"name": "Protocol optimizations",
"options": {},
"criteriaMustSatisfy": "all"
},
{
"children": [
{
"behaviors": [
{
"name": "dnsAsyncRefresh",
"options": {
"enabled": true,
"timeout": "1h"
}
},
{
"name": "timeout",
"options": {
"value": "5s"
}
},
{
"name": "readTimeout",
"options": {
"value": "120s"
}
{
"name": "prefetch",
"options": {
"enabled": true
}
}
],
"criteria": [],
"criteriaMustSatisfy": "all",
"comments": "Optimize the connection between edge and origin."
},
{
"name": "Protocol optimizations",
"children": [],
"behaviors": [
{
"name": "enhancedAkamaiProtocol",
"options": {
"display": ""
}
},
{
"name": "http2",
"options": {
"enabled": ""
}
},
{
"name": "allowTransferEncoding",
"children": [
{
"behaviors": [
{
"name": "prefetch",
"options": {
"enabled": true
"enabled": false
}
},
{
"name": "sureRoute",
}
],
"comments": "Disable prefetching for specific clients identifying themselves as bots and crawlers. This avoids requesting unnecessary resources from the origin.",
"criteria": [
{
"name": "userAgent",
"options": {
"enableCustomKey": false,
"enabled": true,
"forceSslForward": false,
"raceStatTtl": "30m",
"srDownloadLinkTitle": "",
"testObjectUrl": "/akamai/sure-route-test-object.html",
"toHostStatus": "INCOMING_HH",
"type": "PERFORMANCE"
"matchCaseSensitive": false,
"matchOperator": "IS_ONE_OF",
"matchWildcard": true,
"values": [
"*bot*",
"*crawl*",
"*spider*"
]
}
}
}
],
"name": "Bots",
"options": {},
"criteriaMustSatisfy": "all"
}
],
"criteria": [],
"criteriaMustSatisfy": "all",
"comments": "Serve your website using modern and fast protocols."
},
{
"name": "Prefetching",
"children": [
{
"name": "Prefetching objects",
"children": [
{
"name": "Bots",
"children": [],
"behaviors": [
{
"name": "prefetch",
"options": {
"enabled": false
}
}
],
"criteria": [
{
"name": "userAgent",
"options": {
"matchCaseSensitive": false,
"matchOperator": "IS_ONE_OF",
"matchWildcard": true,
"values": [
"*bot*",
"*crawl*",
"*spider*"
]
}
}
],
"criteriaMustSatisfy": "all",
"comments": "Disable prefetching for specific clients identifying themselves as bots and crawlers. This avoids requesting unnecessary resources from the origin."
}
],
"behaviors": [
{
"name": "prefetch",
"options": {
"enabled": true
}
}
],
"criteria": [],
"criteriaMustSatisfy": "all",
"comments": "Define for which HTML pages prefetching should be enabled."
},
{
"name": "Prefetchable objects",
"children": [],
"behaviors": [
{
"name": "prefetchable",
"options": {
"enabled": true
}
}
],
"criteria": [
{
"name": "fileExtension",
"options": {
"matchCaseSensitive": false,
"matchOperator": "IS_ONE_OF",
"values": [
"css",
"js",
"jpg",
"jpeg",
"jp2",
"png",
"gif",
"svg",
"svgz",
"webp",
"eot",
"woff",
"woff2",
"otf",
"ttf"
]
}
}
],
"criteriaMustSatisfy": "all",
"comments": "Define which resources should be prefetched."
"comments": "Define for which HTML pages prefetching should be enabled.",
"name": "Prefetching objects",
"options": {},
"criteriaMustSatisfy": "all"
},
{
"behaviors": [
{
"name": "prefetchable",
"options": {
"enabled": true
}
}
],
"behaviors": [],
"criteria": [],
"criteriaMustSatisfy": "all",
"comments": "Instruct edge servers to retrieve embedded resources before the browser requests them."
},
{
"name": "Adaptive acceleration",
"children": [],
"behaviors": [
{
"name": "adaptiveAcceleration",
"options": {
"abLogic": "DISABLED",
"enableBrotliCompression": false,
"enablePreconnect": true,
"enablePush": true,
"enableRo": false,
"preloadEnable": true,
"source": "mPulse",
"titleHttp2ServerPush": "",
"titlePreconnect": "",
"titlePreload": "",
"titleRo": ""
}
"comments": "Define which resources should be prefetched.",
"criteria": [
{
"name": "fileExtension",
"options": {
"matchCaseSensitive": false,
"matchOperator": "IS_ONE_OF",
"values": [
"css",
"js",
"jpg",
"jpeg",
"jp2",
"png",
"gif",
"svg",
"svgz",
"webp",
"eot",
"woff",
"woff2",
"otf",
"ttf"
]
}
}
],
"criteria": [],
"criteriaMustSatisfy": "all",
"comments": "Automatically and continuously apply performance optimizations to your website using machine learning."
}
"name": "Prefetchable objects",
"options": {},
"criteriaMustSatisfy": "all"
}
],
"comments": "Instruct edge servers to retrieve embedded resources before the browser requests them.",
"name": "Prefetching",
"options": {},
"criteriaMustSatisfy": "all"
},
{
"behaviors": [
{
"name": "adaptiveAcceleration",
"options": {
"abLogic": "DISABLED",
"enableBrotliCompression": true,
"enableForNoncacheable": false,
"enablePreconnect": true,
"enablePush": true,
"enableRo": false,
"preloadEnable": true,
"source": "mPulse",
"titleHttp2ServerPush": "",
"titlePreconnect": "",
"titlePreload": "",
"titleRo": ""
}
}
],
"comments": "Automatically and continuously apply performance optimizations to your website using machine learning.",
"name": "Adaptive acceleration",
"options": {},
"criteriaMustSatisfy": "all"
}
],
"behaviors": [],
"criteria": [],
"criteriaMustSatisfy": "all",
"comments": "Control the settings related to improving the performance of delivering objects to your users."
}
"comments": "Control the settings related to improving the performance of delivering objects to your users.",
"name": "Accelerate delivery",
"options": {},
"criteriaMustSatisfy": "all"
}

+ 4
- 1
GSAutomation/cpr-lab/property.tf Переглянути файл

@@ -32,7 +32,7 @@ resource "akamai_property" "lab_property" {
cname_to = var.edge_hostname
cert_provisioning_type = "CPS_MANAGED"
}
rule_format = "latest"
rule_format = "v2024-08-13"
rules = data.akamai_property_rules_template.rules-template.json
}

@@ -43,6 +43,9 @@ resource "akamai_property_activation" "activation_staging" {
contact = ["${var.email}"]
note = "Content Protector Lab"
auto_acknowledge_rule_warnings = true
timeouts {
default = "1h"
}
}

data "akamai_property_hostnames" "property_hostnames" {

Завантаження…
Відмінити
Зберегти