選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

rules.tf 28KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878
  1. data "akamai_property_rules_builder" "template-tflab_rule_default" {
  2. rules_v2024_10_21 {
  3. name = "default"
  4. is_secure = var.secure
  5. comments = "The Default Rule template contains all the necessary and recommended behaviors. Rules are evaluated from top to bottom and the last matching rule wins."
  6. behavior {
  7. origin {
  8. cache_key_hostname = "REQUEST_HOST_HEADER"
  9. compress = true
  10. enable_true_client_ip = true
  11. forward_host_header = "REQUEST_HOST_HEADER"
  12. hostname = var.origin_hostname
  13. http_port = 80
  14. https_port = 443
  15. ip_version = "IPV4"
  16. min_tls_version = "DYNAMIC"
  17. origin_certificate = ""
  18. origin_sni = true
  19. origin_type = "CUSTOMER"
  20. ports = ""
  21. tls_version_title = ""
  22. true_client_ip_client_setting = false
  23. true_client_ip_header = "True-Client-IP"
  24. verification_mode = "PLATFORM_SETTINGS"
  25. }
  26. }
  27. children = [
  28. data.akamai_property_rules_builder.template-tflab_rule_augment_insights.json,
  29. data.akamai_property_rules_builder.template-tflab_rule_accelerate_delivery.json,
  30. data.akamai_property_rules_builder.template-tflab_rule_offload_origin.json,
  31. data.akamai_property_rules_builder.template-tflab_rule_strengthen_security.json,
  32. data.akamai_property_rules_builder.template-tflab_rule_increase_availability.json,
  33. data.akamai_property_rules_builder.template-tflab_rule_minimize_payload.json,
  34. data.akamai_property_rules_builder.template-tflab_rule_add_test_header.json,
  35. ]
  36. }
  37. }
  38. data "akamai_property_rules_builder" "template-tflab_rule_augment_insights" {
  39. rules_v2024_10_21 {
  40. name = "Augment insights"
  41. comments = "Control the settings related to monitoring and reporting. This gives you additional visibility into your traffic and audiences."
  42. criteria_must_satisfy = "all"
  43. children = [
  44. data.akamai_property_rules_builder.template-tflab_rule_traffic_reporting.json,
  45. data.akamai_property_rules_builder.template-tflab_rule_m_pulse_rum.json,
  46. data.akamai_property_rules_builder.template-tflab_rule_geolocation.json,
  47. data.akamai_property_rules_builder.template-tflab_rule_log_delivery.json,
  48. ]
  49. }
  50. }
  51. data "akamai_property_rules_builder" "template-tflab_rule_accelerate_delivery" {
  52. rules_v2024_10_21 {
  53. name = "Accelerate delivery"
  54. comments = "Control the settings related to improving the performance of delivering objects to your users."
  55. criteria_must_satisfy = "all"
  56. children = [
  57. data.akamai_property_rules_builder.template-tflab_rule_origin_connectivity.json,
  58. data.akamai_property_rules_builder.template-tflab_rule_protocol_optimizations.json,
  59. data.akamai_property_rules_builder.template-tflab_rule_prefetching.json,
  60. data.akamai_property_rules_builder.template-tflab_rule_adaptive_acceleration.json,
  61. ]
  62. }
  63. }
  64. data "akamai_property_rules_builder" "template-tflab_rule_offload_origin" {
  65. rules_v2024_10_21 {
  66. name = "Offload origin"
  67. comments = "Control the settings related to caching content at the edge and in the browser. As a result, fewer requests go to your origin, fewer bytes leave your data centers, and your assets are closer to your users."
  68. criteria_must_satisfy = "all"
  69. behavior {
  70. caching {
  71. behavior = "NO_STORE"
  72. }
  73. }
  74. behavior {
  75. tiered_distribution {
  76. enabled = true
  77. }
  78. }
  79. behavior {
  80. validate_entity_tag {
  81. enabled = false
  82. }
  83. }
  84. behavior {
  85. remove_vary {
  86. enabled = false
  87. }
  88. }
  89. behavior {
  90. cache_error {
  91. enabled = true
  92. preserve_stale = true
  93. ttl = "10s"
  94. }
  95. }
  96. behavior {
  97. cache_key_query_params {
  98. behavior = "INCLUDE_ALL_ALPHABETIZE_ORDER"
  99. }
  100. }
  101. behavior {
  102. prefresh_cache {
  103. enabled = true
  104. prefreshval = 90
  105. }
  106. }
  107. behavior {
  108. downstream_cache {
  109. allow_behavior = "LESSER"
  110. behavior = "ALLOW"
  111. send_headers = "CACHE_CONTROL"
  112. send_private = false
  113. }
  114. }
  115. children = [
  116. data.akamai_property_rules_builder.template-tflab_rule_css_and_java_script.json,
  117. data.akamai_property_rules_builder.template-tflab_rule_fonts.json,
  118. data.akamai_property_rules_builder.template-tflab_rule_images.json,
  119. data.akamai_property_rules_builder.template-tflab_rule_files.json,
  120. data.akamai_property_rules_builder.template-tflab_rule_other_static_objects.json,
  121. data.akamai_property_rules_builder.template-tflab_rule_html_pages.json,
  122. data.akamai_property_rules_builder.template-tflab_rule_redirects.json,
  123. data.akamai_property_rules_builder.template-tflab_rule_post_responses.json,
  124. data.akamai_property_rules_builder.template-tflab_rule_graph_ql.json,
  125. data.akamai_property_rules_builder.template-tflab_rule_uncacheable_objects.json,
  126. ]
  127. }
  128. }
  129. data "akamai_property_rules_builder" "template-tflab_rule_strengthen_security" {
  130. rules_v2024_10_21 {
  131. name = "Strengthen security"
  132. comments = "Control the settings that minimize the information your website shares with clients and malicious entities to reduce your exposure to threats."
  133. criteria_must_satisfy = "all"
  134. children = [
  135. data.akamai_property_rules_builder.template-tflab_rule_allowed_methods.json,
  136. data.akamai_property_rules_builder.template-tflab_rule_obfuscate_debug_info.json,
  137. data.akamai_property_rules_builder.template-tflab_rule_obfuscate_backend_info.json,
  138. data.akamai_property_rules_builder.template-tflab_rule_hsts.json,
  139. ]
  140. }
  141. }
  142. data "akamai_property_rules_builder" "template-tflab_rule_increase_availability" {
  143. rules_v2024_10_21 {
  144. name = "Increase availability"
  145. comments = "Control how to respond when your origin or third parties are slow or even down to minimize the negative impact on user experience."
  146. criteria_must_satisfy = "all"
  147. children = [
  148. data.akamai_property_rules_builder.template-tflab_rule_simulate_failover.json,
  149. data.akamai_property_rules_builder.template-tflab_rule_site_failover.json,
  150. data.akamai_property_rules_builder.template-tflab_rule_origin_health.json,
  151. data.akamai_property_rules_builder.template-tflab_rule_script_management.json,
  152. ]
  153. }
  154. }
  155. data "akamai_property_rules_builder" "template-tflab_rule_minimize_payload" {
  156. rules_v2024_10_21 {
  157. name = "Minimize payload"
  158. comments = "Control the settings that reduce the size of the delivered content and decrease the number of bytes sent by your properties. This allows you to cut down the network overhead of your website or API."
  159. criteria_must_satisfy = "all"
  160. children = [
  161. data.akamai_property_rules_builder.template-tflab_rule_compressible_objects.json,
  162. ]
  163. }
  164. }
  165. data "akamai_property_rules_builder" "template-tflab_rule_add_test_header" {
  166. rules_v2024_10_21 {
  167. name = "Add test header"
  168. criteria_must_satisfy = "all"
  169. criterion {
  170. hostname {
  171. match_operator = "IS_ONE_OF"
  172. values = ["${var.UserID}${var.labname}-test.${var.hostname}", ]
  173. }
  174. }
  175. behavior {
  176. modify_outgoing_response_header {
  177. action = "ADD"
  178. custom_header_name = "X-Test-Environment"
  179. header_value = "true"
  180. standard_add_header_name = "OTHER"
  181. }
  182. }
  183. }
  184. }
  185. data "akamai_property_rules_builder" "template-tflab_rule_traffic_reporting" {
  186. rules_v2024_10_21 {
  187. name = "Traffic reporting"
  188. comments = "Identify your main traffic segments so you can granularly zoom in your traffic statistics like hits, bandwidth, offload, response codes, and errors."
  189. criteria_must_satisfy = "all"
  190. behavior {
  191. cp_code {
  192. value {
  193. id = var.cp_code_id
  194. name = var.cp_code_name
  195. products = ["SPM", ]
  196. }
  197. }
  198. }
  199. }
  200. }
  201. data "akamai_property_rules_builder" "template-tflab_rule_m_pulse_rum" {
  202. rules_v2024_10_21 {
  203. name = "mPulse RUM"
  204. comments = "Collect and analyze real-user data to monitor the performance of your website."
  205. criteria_must_satisfy = "all"
  206. behavior {
  207. m_pulse {
  208. api_key = ""
  209. buffer_size = ""
  210. config_override = ""
  211. enabled = true
  212. loader_version = "V12"
  213. require_pci = false
  214. title_optional = ""
  215. }
  216. }
  217. }
  218. }
  219. data "akamai_property_rules_builder" "template-tflab_rule_geolocation" {
  220. rules_v2024_10_21 {
  221. name = "Geolocation"
  222. comments = "Receive data about a user's geolocation and connection speed in a request header. If you change cached content based on the values of the X-Akamai-Edgescape request header, contact your account representative."
  223. criteria_must_satisfy = "all"
  224. criterion {
  225. request_type {
  226. match_operator = "IS"
  227. value = "CLIENT_REQ"
  228. }
  229. }
  230. behavior {
  231. edge_scape {
  232. enabled = false
  233. }
  234. }
  235. }
  236. }
  237. data "akamai_property_rules_builder" "template-tflab_rule_log_delivery" {
  238. rules_v2024_10_21 {
  239. name = "Log delivery"
  240. comments = "Specify the level of detail you want to be logged in your Log Delivery Service reports. Log User-Agent Header to obtain detailed information in the Traffic by Browser and OS report."
  241. criteria_must_satisfy = "all"
  242. behavior {
  243. report {
  244. log_accept_language = false
  245. log_cookies = "OFF"
  246. log_custom_log_field = false
  247. log_edge_ip = false
  248. log_host = false
  249. log_referer = false
  250. log_user_agent = false
  251. log_x_forwarded_for = false
  252. }
  253. }
  254. }
  255. }
  256. data "akamai_property_rules_builder" "template-tflab_rule_origin_connectivity" {
  257. rules_v2024_10_21 {
  258. name = "Origin connectivity"
  259. comments = "Optimize the connection between edge and origin."
  260. criteria_must_satisfy = "all"
  261. behavior {
  262. dns_async_refresh {
  263. enabled = true
  264. timeout = "1h"
  265. }
  266. }
  267. behavior {
  268. timeout {
  269. value = "5s"
  270. }
  271. }
  272. behavior {
  273. read_timeout {
  274. first_byte_timeout = "20s"
  275. value = "120s"
  276. }
  277. }
  278. }
  279. }
  280. data "akamai_property_rules_builder" "template-tflab_rule_protocol_optimizations" {
  281. rules_v2024_10_21 {
  282. name = "Protocol optimizations"
  283. comments = "Serve your website using modern and fast protocols."
  284. criteria_must_satisfy = "all"
  285. behavior {
  286. enhanced_akamai_protocol {
  287. display = ""
  288. }
  289. }
  290. behavior {
  291. http3 {
  292. enable = true
  293. }
  294. }
  295. behavior {
  296. http2 {
  297. enabled = ""
  298. }
  299. }
  300. behavior {
  301. allow_transfer_encoding {
  302. enabled = true
  303. }
  304. }
  305. behavior {
  306. sure_route {
  307. enable_custom_key = false
  308. enabled = true
  309. force_ssl_forward = false
  310. race_stat_ttl = "30m"
  311. sr_download_link_title = ""
  312. test_object_url = "/akamai/sureroute-test-object.html"
  313. to_host_status = "INCOMING_HH"
  314. type = "PERFORMANCE"
  315. }
  316. }
  317. }
  318. }
  319. data "akamai_property_rules_builder" "template-tflab_rule_prefetching" {
  320. rules_v2024_10_21 {
  321. name = "Prefetching"
  322. comments = "Instruct edge servers to retrieve embedded resources before the browser requests them."
  323. criteria_must_satisfy = "all"
  324. children = [
  325. data.akamai_property_rules_builder.template-tflab_rule_prefetching_objects.json,
  326. data.akamai_property_rules_builder.template-tflab_rule_prefetchable_objects.json,
  327. ]
  328. }
  329. }
  330. data "akamai_property_rules_builder" "template-tflab_rule_adaptive_acceleration" {
  331. rules_v2024_10_21 {
  332. name = "Adaptive acceleration"
  333. comments = "Automatically and continuously apply performance optimizations to your website using machine learning."
  334. criteria_must_satisfy = "all"
  335. behavior {
  336. adaptive_acceleration {
  337. ab_logic = "DISABLED"
  338. enable_brotli_compression = true
  339. enable_for_noncacheable = false
  340. enable_preconnect = true
  341. enable_push = true
  342. enable_ro = false
  343. preload_enable = true
  344. source = "mPulse"
  345. title_http2_server_push = ""
  346. title_preconnect = ""
  347. title_preload = ""
  348. title_ro = ""
  349. }
  350. }
  351. }
  352. }
  353. data "akamai_property_rules_builder" "template-tflab_rule_prefetching_objects" {
  354. rules_v2024_10_21 {
  355. name = "Prefetching objects"
  356. comments = "Define for which HTML pages prefetching should be enabled."
  357. criteria_must_satisfy = "all"
  358. behavior {
  359. prefetch {
  360. enabled = true
  361. }
  362. }
  363. children = [
  364. data.akamai_property_rules_builder.template-tflab_rule_bots.json,
  365. ]
  366. }
  367. }
  368. data "akamai_property_rules_builder" "template-tflab_rule_prefetchable_objects" {
  369. rules_v2024_10_21 {
  370. name = "Prefetchable objects"
  371. comments = "Define which resources should be prefetched."
  372. criteria_must_satisfy = "all"
  373. criterion {
  374. file_extension {
  375. match_case_sensitive = false
  376. match_operator = "IS_ONE_OF"
  377. values = ["css", "js", "jpg", "jpeg", "jp2", "png", "gif", "svg", "svgz", "webp", "eot", "woff", "woff2", "otf", "ttf", ]
  378. }
  379. }
  380. behavior {
  381. prefetchable {
  382. enabled = true
  383. }
  384. }
  385. }
  386. }
  387. data "akamai_property_rules_builder" "template-tflab_rule_bots" {
  388. rules_v2024_10_21 {
  389. name = "Bots"
  390. comments = "Disable prefetching for specific clients identifying themselves as bots and crawlers. This avoids requesting unnecessary resources from the origin."
  391. criteria_must_satisfy = "all"
  392. criterion {
  393. user_agent {
  394. match_case_sensitive = false
  395. match_operator = "IS_ONE_OF"
  396. match_wildcard = true
  397. values = ["*bot*", "*crawl*", "*spider*", ]
  398. }
  399. }
  400. behavior {
  401. prefetch {
  402. enabled = false
  403. }
  404. }
  405. }
  406. }
  407. data "akamai_property_rules_builder" "template-tflab_rule_css_and_java_script" {
  408. rules_v2024_10_21 {
  409. name = "CSS and JavaScript"
  410. comments = "Override the default caching behavior for CSS and JavaScript"
  411. criteria_must_satisfy = "any"
  412. criterion {
  413. file_extension {
  414. match_case_sensitive = false
  415. match_operator = "IS_ONE_OF"
  416. values = ["css", "js", ]
  417. }
  418. }
  419. behavior {
  420. caching {
  421. behavior = "MAX_AGE"
  422. must_revalidate = false
  423. ttl = "7d"
  424. }
  425. }
  426. }
  427. }
  428. data "akamai_property_rules_builder" "template-tflab_rule_fonts" {
  429. rules_v2024_10_21 {
  430. name = "Fonts"
  431. comments = "Override the default caching behavior for fonts."
  432. criteria_must_satisfy = "any"
  433. criterion {
  434. file_extension {
  435. match_case_sensitive = false
  436. match_operator = "IS_ONE_OF"
  437. values = ["eot", "woff", "woff2", "otf", "ttf", ]
  438. }
  439. }
  440. behavior {
  441. caching {
  442. behavior = "MAX_AGE"
  443. must_revalidate = false
  444. ttl = "30d"
  445. }
  446. }
  447. }
  448. }
  449. data "akamai_property_rules_builder" "template-tflab_rule_images" {
  450. rules_v2024_10_21 {
  451. name = "Images"
  452. comments = "Override the default caching behavior for images."
  453. criteria_must_satisfy = "any"
  454. criterion {
  455. file_extension {
  456. match_case_sensitive = false
  457. match_operator = "IS_ONE_OF"
  458. values = ["jpg", "jpeg", "png", "gif", "webp", "jp2", "ico", "svg", "svgz", ]
  459. }
  460. }
  461. behavior {
  462. caching {
  463. behavior = "MAX_AGE"
  464. must_revalidate = false
  465. ttl = "30d"
  466. }
  467. }
  468. }
  469. }
  470. data "akamai_property_rules_builder" "template-tflab_rule_files" {
  471. rules_v2024_10_21 {
  472. name = "Files"
  473. comments = "Override the default caching behavior for files. Files containing Personal Identified Information (PII) should require Edge authentication or not be cached at all."
  474. criteria_must_satisfy = "any"
  475. criterion {
  476. file_extension {
  477. match_case_sensitive = false
  478. match_operator = "IS_ONE_OF"
  479. values = ["pdf", "doc", "docx", "odt", ]
  480. }
  481. }
  482. behavior {
  483. caching {
  484. behavior = "MAX_AGE"
  485. must_revalidate = false
  486. ttl = "7d"
  487. }
  488. }
  489. }
  490. }
  491. data "akamai_property_rules_builder" "template-tflab_rule_other_static_objects" {
  492. rules_v2024_10_21 {
  493. name = "Other static objects"
  494. comments = "Override the default caching behavior for other static objects."
  495. criteria_must_satisfy = "any"
  496. criterion {
  497. file_extension {
  498. match_case_sensitive = false
  499. match_operator = "IS_ONE_OF"
  500. values = ["aif", "aiff", "au", "avi", "bin", "bmp", "cab", "carb", "cct", "cdf", "class", "dcr", "dtd", "exe", "flv", "gcf", "gff", "grv", "hdml", "hqx", "ini", "mov", "mp3", "nc", "pct", "ppc", "pws", "swa", "swf", "txt", "vbs", "w32", "wav", "midi", "wbmp", "wml", "wmlc", "wmls", "wmlsc", "xsd", "zip", "pict", "tif", "tiff", "mid", "jxr", "jar", ]
  501. }
  502. }
  503. behavior {
  504. caching {
  505. behavior = "MAX_AGE"
  506. must_revalidate = false
  507. ttl = "7d"
  508. }
  509. }
  510. }
  511. }
  512. data "akamai_property_rules_builder" "template-tflab_rule_html_pages" {
  513. rules_v2024_10_21 {
  514. name = "HTML pages"
  515. comments = "Override the default caching behavior for HTML pages cached on edge servers."
  516. criteria_must_satisfy = "all"
  517. criterion {
  518. file_extension {
  519. match_case_sensitive = false
  520. match_operator = "IS_ONE_OF"
  521. values = ["html", "htm", "php", "jsp", "aspx", "EMPTY_STRING", ]
  522. }
  523. }
  524. behavior {
  525. caching {
  526. behavior = "NO_STORE"
  527. }
  528. }
  529. behavior {
  530. cache_key_query_params {
  531. behavior = "IGNORE"
  532. exact_match = true
  533. parameters = ["gclid", "fbclid", "utm_source", "utm_campaign", "utm_medium", "utm_content", ]
  534. }
  535. }
  536. }
  537. }
  538. data "akamai_property_rules_builder" "template-tflab_rule_redirects" {
  539. rules_v2024_10_21 {
  540. name = "Redirects"
  541. comments = "Configure caching for HTTP redirects. The redirect is cached for the same TTL as a 200 HTTP response when this feature is enabled."
  542. criteria_must_satisfy = "all"
  543. behavior {
  544. cache_redirect {
  545. enabled = "false"
  546. }
  547. }
  548. behavior {
  549. chase_redirects {
  550. enabled = false
  551. }
  552. }
  553. }
  554. }
  555. data "akamai_property_rules_builder" "template-tflab_rule_post_responses" {
  556. rules_v2024_10_21 {
  557. name = "POST responses"
  558. comments = "Define when HTTP POST requests should be cached. You should enable it under a criteria match."
  559. criteria_must_satisfy = "all"
  560. behavior {
  561. cache_post {
  562. enabled = false
  563. }
  564. }
  565. }
  566. }
  567. data "akamai_property_rules_builder" "template-tflab_rule_graph_ql" {
  568. rules_v2024_10_21 {
  569. name = "GraphQL"
  570. comments = "Define when your GraphQL queries should be cached."
  571. criteria_must_satisfy = "all"
  572. criterion {
  573. path {
  574. match_case_sensitive = false
  575. match_operator = "MATCHES_ONE_OF"
  576. normalize = false
  577. values = ["/graphql", ]
  578. }
  579. }
  580. behavior {
  581. graphql_caching {
  582. enabled = false
  583. }
  584. }
  585. }
  586. }
  587. data "akamai_property_rules_builder" "template-tflab_rule_uncacheable_objects" {
  588. rules_v2024_10_21 {
  589. name = "Uncacheable objects"
  590. comments = "Configure the default client caching behavior for uncacheable content at the edge."
  591. criteria_must_satisfy = "any"
  592. criterion {
  593. cacheability {
  594. match_operator = "IS_NOT"
  595. value = "CACHEABLE"
  596. }
  597. }
  598. criterion {
  599. hostname {
  600. match_operator = "IS_ONE_OF"
  601. values = ["${var.UserID}${var.labname}-test.${var.hostname}", ]
  602. }
  603. }
  604. behavior {
  605. downstream_cache {
  606. behavior = "BUST"
  607. }
  608. }
  609. }
  610. }
  611. data "akamai_property_rules_builder" "template-tflab_rule_allowed_methods" {
  612. rules_v2024_10_21 {
  613. name = "Allowed methods"
  614. comments = "Allow the use of HTTP methods. Consider enabling additional methods under a path match for increased origin security."
  615. criteria_must_satisfy = "all"
  616. behavior {
  617. all_http_in_cache_hierarchy {
  618. enabled = true
  619. }
  620. }
  621. children = [
  622. data.akamai_property_rules_builder.template-tflab_rule_post.json,
  623. data.akamai_property_rules_builder.template-tflab_rule_options.json,
  624. data.akamai_property_rules_builder.template-tflab_rule_put.json,
  625. data.akamai_property_rules_builder.template-tflab_rule_delete.json,
  626. data.akamai_property_rules_builder.template-tflab_rule_patch.json,
  627. ]
  628. }
  629. }
  630. data "akamai_property_rules_builder" "template-tflab_rule_obfuscate_debug_info" {
  631. rules_v2024_10_21 {
  632. name = "Obfuscate debug info"
  633. comments = "Do not expose back-end information unless the request contains the Pragma debug header."
  634. criteria_must_satisfy = "all"
  635. behavior {
  636. cache_tag_visible {
  637. behavior = "PRAGMA_HEADER"
  638. }
  639. }
  640. }
  641. }
  642. data "akamai_property_rules_builder" "template-tflab_rule_obfuscate_backend_info" {
  643. rules_v2024_10_21 {
  644. name = "Obfuscate backend info"
  645. comments = "Do not expose back-end information unless the request contains an additional secret header. Regularly change the criteria to use a specific unique value for the secret header."
  646. criteria_must_satisfy = "all"
  647. criterion {
  648. request_header {
  649. header_name = "X-Akamai-Debug"
  650. match_case_sensitive_value = true
  651. match_operator = "IS_NOT_ONE_OF"
  652. match_wildcard_name = false
  653. match_wildcard_value = false
  654. values = ["true", ]
  655. }
  656. }
  657. behavior {
  658. modify_outgoing_response_header {
  659. action = "DELETE"
  660. custom_header_name = "X-Powered-By"
  661. standard_delete_header_name = "OTHER"
  662. }
  663. }
  664. behavior {
  665. modify_outgoing_response_header {
  666. action = "DELETE"
  667. custom_header_name = "Server"
  668. standard_delete_header_name = "OTHER"
  669. }
  670. }
  671. }
  672. }
  673. data "akamai_property_rules_builder" "template-tflab_rule_hsts" {
  674. rules_v2024_10_21 {
  675. name = "HSTS"
  676. comments = "Require all browsers to connect to your site using HTTPS."
  677. criteria_must_satisfy = "all"
  678. behavior {
  679. http_strict_transport_security {
  680. enable = false
  681. }
  682. }
  683. }
  684. }
  685. data "akamai_property_rules_builder" "template-tflab_rule_post" {
  686. rules_v2024_10_21 {
  687. name = "POST"
  688. comments = "Allow use of the POST HTTP request method."
  689. criteria_must_satisfy = "all"
  690. behavior {
  691. allow_post {
  692. allow_without_content_length = false
  693. enabled = true
  694. }
  695. }
  696. }
  697. }
  698. data "akamai_property_rules_builder" "template-tflab_rule_options" {
  699. rules_v2024_10_21 {
  700. name = "OPTIONS"
  701. comments = "Allow use of the OPTIONS HTTP request method."
  702. criteria_must_satisfy = "all"
  703. behavior {
  704. allow_options {
  705. enabled = true
  706. }
  707. }
  708. }
  709. }
  710. data "akamai_property_rules_builder" "template-tflab_rule_put" {
  711. rules_v2024_10_21 {
  712. name = "PUT"
  713. comments = "Allow use of the PUT HTTP request method."
  714. criteria_must_satisfy = "all"
  715. behavior {
  716. allow_put {
  717. enabled = false
  718. }
  719. }
  720. }
  721. }
  722. data "akamai_property_rules_builder" "template-tflab_rule_delete" {
  723. rules_v2024_10_21 {
  724. name = "DELETE"
  725. comments = "Allow use of the DELETE HTTP request method."
  726. criteria_must_satisfy = "all"
  727. behavior {
  728. allow_delete {
  729. enabled = false
  730. }
  731. }
  732. }
  733. }
  734. data "akamai_property_rules_builder" "template-tflab_rule_patch" {
  735. rules_v2024_10_21 {
  736. name = "PATCH"
  737. comments = "Allow use of the PATCH HTTP request method."
  738. criteria_must_satisfy = "all"
  739. behavior {
  740. allow_patch {
  741. enabled = false
  742. }
  743. }
  744. }
  745. }
  746. data "akamai_property_rules_builder" "template-tflab_rule_simulate_failover" {
  747. rules_v2024_10_21 {
  748. name = "Simulate failover"
  749. comments = "Simulate an origin connection problem and test the site failover configuration on the CDN staging network."
  750. criteria_must_satisfy = "all"
  751. criterion {
  752. content_delivery_network {
  753. match_operator = "IS"
  754. network = "STAGING"
  755. }
  756. }
  757. criterion {
  758. request_header {
  759. header_name = "breakconnection"
  760. match_case_sensitive_value = true
  761. match_operator = "IS_ONE_OF"
  762. match_wildcard_name = false
  763. match_wildcard_value = false
  764. values = ["Your-Secret-Here", ]
  765. }
  766. }
  767. behavior {
  768. break_connection {
  769. enabled = true
  770. }
  771. }
  772. }
  773. }
  774. data "akamai_property_rules_builder" "template-tflab_rule_site_failover" {
  775. rules_v2024_10_21 {
  776. name = "Site failover"
  777. comments = "Specify how edge servers respond when the origin is not available."
  778. criteria_must_satisfy = "any"
  779. criterion {
  780. origin_timeout {
  781. match_operator = "ORIGIN_TIMED_OUT"
  782. }
  783. }
  784. behavior {
  785. fail_action {
  786. enabled = false
  787. }
  788. }
  789. }
  790. }
  791. data "akamai_property_rules_builder" "template-tflab_rule_origin_health" {
  792. rules_v2024_10_21 {
  793. name = "Origin health"
  794. comments = "Monitor the health of your origin by tracking unsuccessful IP connection attempts."
  795. criteria_must_satisfy = "all"
  796. behavior {
  797. health_detection {
  798. maximum_reconnects = 3
  799. retry_count = 3
  800. retry_interval = "10s"
  801. }
  802. }
  803. }
  804. }
  805. data "akamai_property_rules_builder" "template-tflab_rule_script_management" {
  806. rules_v2024_10_21 {
  807. name = "Script management"
  808. comments = "Enable Script Management to minimize performance and availability impacts from third-party JavaScripts."
  809. criteria_must_satisfy = "all"
  810. behavior {
  811. script_management {
  812. enabled = false
  813. }
  814. }
  815. }
  816. }
  817. data "akamai_property_rules_builder" "template-tflab_rule_compressible_objects" {
  818. rules_v2024_10_21 {
  819. name = "Compressible objects"
  820. comments = "Serve gzip compressed content for text-based formats."
  821. criteria_must_satisfy = "all"
  822. criterion {
  823. content_type {
  824. match_case_sensitive = false
  825. match_operator = "IS_ONE_OF"
  826. match_wildcard = true
  827. values = ["application/*javascript*", "application/*json*", "application/*xml*", "application/text*", "application/vnd-ms-fontobject", "application/vnd.microsoft.icon", "application/x-font-opentype", "application/x-font-truetype", "application/x-font-ttf", "application/xml*", "font/eot*", "font/eot", "font/opentype", "font/otf", "image/svg+xml", "image/vnd.microsoft.icon", "image/x-icon", "text/*", "application/octet-stream*", "application/x-font-eot*", "font/ttf", "application/font-ttf", "application/font-sfnt", "application/x-tgif", ]
  828. }
  829. }
  830. behavior {
  831. gzip_response {
  832. behavior = "ALWAYS"
  833. }
  834. }
  835. }
  836. }