alicloud.esa.CacheRule
Explore with Pulumi AI
Provides a ESA Cache Rule resource.
For information about ESA Cache Rule and how to use it, see What is Cache Rule.
NOTE: Available since v1.244.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const _default = alicloud.esa.getSites({
planSubscribeType: "enterpriseplan",
});
const defaultCacheRule = new alicloud.esa.CacheRule("default", {
userDeviceType: "off",
browserCacheMode: "no_cache",
userLanguage: "off",
checkPresenceHeader: "headername",
includeCookie: "cookie_exapmle",
edgeCacheMode: "follow_origin",
additionalCacheablePorts: "2053",
ruleName: "rule_example",
edgeStatusCodeCacheTtl: "300",
browserCacheTtl: "300",
queryString: "example",
userGeo: "off",
sortQueryStringForCache: "off",
checkPresenceCookie: "cookiename",
cacheReserveEligibility: "bypass_cache_reserve",
queryStringMode: "ignore_all",
rule: "http.host eq \"video.example.com\"",
cacheDeceptionArmor: "off",
siteId: _default.then(_default => _default.sites?.[0]?.id),
bypassCache: "cache_all",
edgeCacheTtl: "300",
ruleEnable: "off",
siteVersion: 0,
includeHeader: "example",
serveStale: "off",
});
import pulumi
import pulumi_alicloud as alicloud
default = alicloud.esa.get_sites(plan_subscribe_type="enterpriseplan")
default_cache_rule = alicloud.esa.CacheRule("default",
user_device_type="off",
browser_cache_mode="no_cache",
user_language="off",
check_presence_header="headername",
include_cookie="cookie_exapmle",
edge_cache_mode="follow_origin",
additional_cacheable_ports="2053",
rule_name="rule_example",
edge_status_code_cache_ttl="300",
browser_cache_ttl="300",
query_string="example",
user_geo="off",
sort_query_string_for_cache="off",
check_presence_cookie="cookiename",
cache_reserve_eligibility="bypass_cache_reserve",
query_string_mode="ignore_all",
rule="http.host eq \"video.example.com\"",
cache_deception_armor="off",
site_id=default.sites[0].id,
bypass_cache="cache_all",
edge_cache_ttl="300",
rule_enable="off",
site_version=0,
include_header="example",
serve_stale="off")
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/esa"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, err := esa.GetSites(ctx, &esa.GetSitesArgs{
PlanSubscribeType: pulumi.StringRef("enterpriseplan"),
}, nil)
if err != nil {
return err
}
_, err = esa.NewCacheRule(ctx, "default", &esa.CacheRuleArgs{
UserDeviceType: pulumi.String("off"),
BrowserCacheMode: pulumi.String("no_cache"),
UserLanguage: pulumi.String("off"),
CheckPresenceHeader: pulumi.String("headername"),
IncludeCookie: pulumi.String("cookie_exapmle"),
EdgeCacheMode: pulumi.String("follow_origin"),
AdditionalCacheablePorts: pulumi.String("2053"),
RuleName: pulumi.String("rule_example"),
EdgeStatusCodeCacheTtl: pulumi.String("300"),
BrowserCacheTtl: pulumi.String("300"),
QueryString: pulumi.String("example"),
UserGeo: pulumi.String("off"),
SortQueryStringForCache: pulumi.String("off"),
CheckPresenceCookie: pulumi.String("cookiename"),
CacheReserveEligibility: pulumi.String("bypass_cache_reserve"),
QueryStringMode: pulumi.String("ignore_all"),
Rule: pulumi.String("http.host eq \"video.example.com\""),
CacheDeceptionArmor: pulumi.String("off"),
SiteId: pulumi.Int(_default.Sites[0].Id),
BypassCache: pulumi.String("cache_all"),
EdgeCacheTtl: pulumi.String("300"),
RuleEnable: pulumi.String("off"),
SiteVersion: pulumi.Int(0),
IncludeHeader: pulumi.String("example"),
ServeStale: pulumi.String("off"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var @default = AliCloud.Esa.GetSites.Invoke(new()
{
PlanSubscribeType = "enterpriseplan",
});
var defaultCacheRule = new AliCloud.Esa.CacheRule("default", new()
{
UserDeviceType = "off",
BrowserCacheMode = "no_cache",
UserLanguage = "off",
CheckPresenceHeader = "headername",
IncludeCookie = "cookie_exapmle",
EdgeCacheMode = "follow_origin",
AdditionalCacheablePorts = "2053",
RuleName = "rule_example",
EdgeStatusCodeCacheTtl = "300",
BrowserCacheTtl = "300",
QueryString = "example",
UserGeo = "off",
SortQueryStringForCache = "off",
CheckPresenceCookie = "cookiename",
CacheReserveEligibility = "bypass_cache_reserve",
QueryStringMode = "ignore_all",
Rule = "http.host eq \"video.example.com\"",
CacheDeceptionArmor = "off",
SiteId = @default.Apply(@default => @default.Apply(getSitesResult => getSitesResult.Sites[0]?.Id)),
BypassCache = "cache_all",
EdgeCacheTtl = "300",
RuleEnable = "off",
SiteVersion = 0,
IncludeHeader = "example",
ServeStale = "off",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.esa.EsaFunctions;
import com.pulumi.alicloud.esa.inputs.GetSitesArgs;
import com.pulumi.alicloud.esa.CacheRule;
import com.pulumi.alicloud.esa.CacheRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var default = EsaFunctions.getSites(GetSitesArgs.builder()
.planSubscribeType("enterpriseplan")
.build());
var defaultCacheRule = new CacheRule("defaultCacheRule", CacheRuleArgs.builder()
.userDeviceType("off")
.browserCacheMode("no_cache")
.userLanguage("off")
.checkPresenceHeader("headername")
.includeCookie("cookie_exapmle")
.edgeCacheMode("follow_origin")
.additionalCacheablePorts("2053")
.ruleName("rule_example")
.edgeStatusCodeCacheTtl("300")
.browserCacheTtl("300")
.queryString("example")
.userGeo("off")
.sortQueryStringForCache("off")
.checkPresenceCookie("cookiename")
.cacheReserveEligibility("bypass_cache_reserve")
.queryStringMode("ignore_all")
.rule("http.host eq \"video.example.com\"")
.cacheDeceptionArmor("off")
.siteId(default_.sites()[0].id())
.bypassCache("cache_all")
.edgeCacheTtl("300")
.ruleEnable("off")
.siteVersion("0")
.includeHeader("example")
.serveStale("off")
.build());
}
}
resources:
defaultCacheRule:
type: alicloud:esa:CacheRule
name: default
properties:
userDeviceType: off
browserCacheMode: no_cache
userLanguage: off
checkPresenceHeader: headername
includeCookie: cookie_exapmle
edgeCacheMode: follow_origin
additionalCacheablePorts: '2053'
ruleName: rule_example
edgeStatusCodeCacheTtl: '300'
browserCacheTtl: '300'
queryString: example
userGeo: off
sortQueryStringForCache: off
checkPresenceCookie: cookiename
cacheReserveEligibility: bypass_cache_reserve
queryStringMode: ignore_all
rule: http.host eq "video.example.com"
cacheDeceptionArmor: off
siteId: ${default.sites[0].id}
bypassCache: cache_all
edgeCacheTtl: '300'
ruleEnable: off
siteVersion: '0'
includeHeader: example
serveStale: off
variables:
default:
fn::invoke:
function: alicloud:esa:getSites
arguments:
planSubscribeType: enterpriseplan
Create CacheRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CacheRule(name: string, args: CacheRuleArgs, opts?: CustomResourceOptions);
@overload
def CacheRule(resource_name: str,
args: CacheRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CacheRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
site_id: Optional[int] = None,
include_header: Optional[str] = None,
check_presence_header: Optional[str] = None,
bypass_cache: Optional[str] = None,
cache_deception_armor: Optional[str] = None,
cache_reserve_eligibility: Optional[str] = None,
check_presence_cookie: Optional[str] = None,
additional_cacheable_ports: Optional[str] = None,
edge_cache_mode: Optional[str] = None,
edge_cache_ttl: Optional[str] = None,
edge_status_code_cache_ttl: Optional[str] = None,
browser_cache_ttl: Optional[str] = None,
include_cookie: Optional[str] = None,
rule_name: Optional[str] = None,
query_string_mode: Optional[str] = None,
rule: Optional[str] = None,
rule_enable: Optional[str] = None,
query_string: Optional[str] = None,
serve_stale: Optional[str] = None,
browser_cache_mode: Optional[str] = None,
site_version: Optional[int] = None,
sort_query_string_for_cache: Optional[str] = None,
user_device_type: Optional[str] = None,
user_geo: Optional[str] = None,
user_language: Optional[str] = None)
func NewCacheRule(ctx *Context, name string, args CacheRuleArgs, opts ...ResourceOption) (*CacheRule, error)
public CacheRule(string name, CacheRuleArgs args, CustomResourceOptions? opts = null)
public CacheRule(String name, CacheRuleArgs args)
public CacheRule(String name, CacheRuleArgs args, CustomResourceOptions options)
type: alicloud:esa:CacheRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args CacheRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args CacheRuleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args CacheRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CacheRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CacheRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var cacheRuleResource = new AliCloud.Esa.CacheRule("cacheRuleResource", new()
{
SiteId = 0,
IncludeHeader = "string",
CheckPresenceHeader = "string",
BypassCache = "string",
CacheDeceptionArmor = "string",
CacheReserveEligibility = "string",
CheckPresenceCookie = "string",
AdditionalCacheablePorts = "string",
EdgeCacheMode = "string",
EdgeCacheTtl = "string",
EdgeStatusCodeCacheTtl = "string",
BrowserCacheTtl = "string",
IncludeCookie = "string",
RuleName = "string",
QueryStringMode = "string",
Rule = "string",
RuleEnable = "string",
QueryString = "string",
ServeStale = "string",
BrowserCacheMode = "string",
SiteVersion = 0,
SortQueryStringForCache = "string",
UserDeviceType = "string",
UserGeo = "string",
UserLanguage = "string",
});
example, err := esa.NewCacheRule(ctx, "cacheRuleResource", &esa.CacheRuleArgs{
SiteId: pulumi.Int(0),
IncludeHeader: pulumi.String("string"),
CheckPresenceHeader: pulumi.String("string"),
BypassCache: pulumi.String("string"),
CacheDeceptionArmor: pulumi.String("string"),
CacheReserveEligibility: pulumi.String("string"),
CheckPresenceCookie: pulumi.String("string"),
AdditionalCacheablePorts: pulumi.String("string"),
EdgeCacheMode: pulumi.String("string"),
EdgeCacheTtl: pulumi.String("string"),
EdgeStatusCodeCacheTtl: pulumi.String("string"),
BrowserCacheTtl: pulumi.String("string"),
IncludeCookie: pulumi.String("string"),
RuleName: pulumi.String("string"),
QueryStringMode: pulumi.String("string"),
Rule: pulumi.String("string"),
RuleEnable: pulumi.String("string"),
QueryString: pulumi.String("string"),
ServeStale: pulumi.String("string"),
BrowserCacheMode: pulumi.String("string"),
SiteVersion: pulumi.Int(0),
SortQueryStringForCache: pulumi.String("string"),
UserDeviceType: pulumi.String("string"),
UserGeo: pulumi.String("string"),
UserLanguage: pulumi.String("string"),
})
var cacheRuleResource = new CacheRule("cacheRuleResource", CacheRuleArgs.builder()
.siteId(0)
.includeHeader("string")
.checkPresenceHeader("string")
.bypassCache("string")
.cacheDeceptionArmor("string")
.cacheReserveEligibility("string")
.checkPresenceCookie("string")
.additionalCacheablePorts("string")
.edgeCacheMode("string")
.edgeCacheTtl("string")
.edgeStatusCodeCacheTtl("string")
.browserCacheTtl("string")
.includeCookie("string")
.ruleName("string")
.queryStringMode("string")
.rule("string")
.ruleEnable("string")
.queryString("string")
.serveStale("string")
.browserCacheMode("string")
.siteVersion(0)
.sortQueryStringForCache("string")
.userDeviceType("string")
.userGeo("string")
.userLanguage("string")
.build());
cache_rule_resource = alicloud.esa.CacheRule("cacheRuleResource",
site_id=0,
include_header="string",
check_presence_header="string",
bypass_cache="string",
cache_deception_armor="string",
cache_reserve_eligibility="string",
check_presence_cookie="string",
additional_cacheable_ports="string",
edge_cache_mode="string",
edge_cache_ttl="string",
edge_status_code_cache_ttl="string",
browser_cache_ttl="string",
include_cookie="string",
rule_name="string",
query_string_mode="string",
rule="string",
rule_enable="string",
query_string="string",
serve_stale="string",
browser_cache_mode="string",
site_version=0,
sort_query_string_for_cache="string",
user_device_type="string",
user_geo="string",
user_language="string")
const cacheRuleResource = new alicloud.esa.CacheRule("cacheRuleResource", {
siteId: 0,
includeHeader: "string",
checkPresenceHeader: "string",
bypassCache: "string",
cacheDeceptionArmor: "string",
cacheReserveEligibility: "string",
checkPresenceCookie: "string",
additionalCacheablePorts: "string",
edgeCacheMode: "string",
edgeCacheTtl: "string",
edgeStatusCodeCacheTtl: "string",
browserCacheTtl: "string",
includeCookie: "string",
ruleName: "string",
queryStringMode: "string",
rule: "string",
ruleEnable: "string",
queryString: "string",
serveStale: "string",
browserCacheMode: "string",
siteVersion: 0,
sortQueryStringForCache: "string",
userDeviceType: "string",
userGeo: "string",
userLanguage: "string",
});
type: alicloud:esa:CacheRule
properties:
additionalCacheablePorts: string
browserCacheMode: string
browserCacheTtl: string
bypassCache: string
cacheDeceptionArmor: string
cacheReserveEligibility: string
checkPresenceCookie: string
checkPresenceHeader: string
edgeCacheMode: string
edgeCacheTtl: string
edgeStatusCodeCacheTtl: string
includeCookie: string
includeHeader: string
queryString: string
queryStringMode: string
rule: string
ruleEnable: string
ruleName: string
serveStale: string
siteId: 0
siteVersion: 0
sortQueryStringForCache: string
userDeviceType: string
userGeo: string
userLanguage: string
CacheRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The CacheRule resource accepts the following input properties:
- Site
Id int - The site ID, which can be obtained by calling the [ListSites] API.
- Additional
Cacheable stringPorts - Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
- Browser
Cache stringMode - Browser cache mode. Possible values:
- Browser
Cache stringTtl - Browser cache expiration time in seconds.
- Bypass
Cache string - Set the bypass cache mode. Possible values:
- Cache
Deception stringArmor - Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
- Cache
Reserve stringEligibility - Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
- string
- When generating the cache key, check if the cookie exists. If it does, add the cookie name (case-insensitive) to the cache key. Multiple cookie names are supported, separated by spaces.
- Check
Presence stringHeader - When generating the cache key, check if the header exists. If it does, add the header name (case-insensitive) to the cache key. Multiple header names are supported, separated by spaces.
- Edge
Cache stringMode - Edge cache mode. Possible values:
- Edge
Cache stringTtl - Edge cache expiration time in seconds.
- Edge
Status stringCode Cache Ttl - Status code cache expiration time in seconds.
- string
- When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
- Include
Header string - When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
- Query
String string - Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
- Query
String stringMode - The processing mode for query strings when generating the cache key. Possible values:
- Rule string
- Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:
- Match all incoming requests: value set to true.
- Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com").
- Rule
Enable string - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- Rule
Name string - Rule name. When adding global configuration, this parameter does not need to be set.
- Serve
Stale string - Serve stale cache. When enabled, the node can still respond to user requests with expired cached files when the origin server is unavailable. Value range:
- Site
Version int - The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
- Sort
Query stringString For Cache - Query string sorting, disabled by default. Possible values:
- User
Device stringType - When generating the cache key, add the client device type. Possible values:
- User
Geo string - When generating the cache key, add the client's geographic location. Possible values:
- User
Language string - When generating cache keys, include the client's language type. Possible values:
- Site
Id int - The site ID, which can be obtained by calling the [ListSites] API.
- Additional
Cacheable stringPorts - Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
- Browser
Cache stringMode - Browser cache mode. Possible values:
- Browser
Cache stringTtl - Browser cache expiration time in seconds.
- Bypass
Cache string - Set the bypass cache mode. Possible values:
- Cache
Deception stringArmor - Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
- Cache
Reserve stringEligibility - Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
- string
- When generating the cache key, check if the cookie exists. If it does, add the cookie name (case-insensitive) to the cache key. Multiple cookie names are supported, separated by spaces.
- Check
Presence stringHeader - When generating the cache key, check if the header exists. If it does, add the header name (case-insensitive) to the cache key. Multiple header names are supported, separated by spaces.
- Edge
Cache stringMode - Edge cache mode. Possible values:
- Edge
Cache stringTtl - Edge cache expiration time in seconds.
- Edge
Status stringCode Cache Ttl - Status code cache expiration time in seconds.
- string
- When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
- Include
Header string - When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
- Query
String string - Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
- Query
String stringMode - The processing mode for query strings when generating the cache key. Possible values:
- Rule string
- Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:
- Match all incoming requests: value set to true.
- Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com").
- Rule
Enable string - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- Rule
Name string - Rule name. When adding global configuration, this parameter does not need to be set.
- Serve
Stale string - Serve stale cache. When enabled, the node can still respond to user requests with expired cached files when the origin server is unavailable. Value range:
- Site
Version int - The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
- Sort
Query stringString For Cache - Query string sorting, disabled by default. Possible values:
- User
Device stringType - When generating the cache key, add the client device type. Possible values:
- User
Geo string - When generating the cache key, add the client's geographic location. Possible values:
- User
Language string - When generating cache keys, include the client's language type. Possible values:
- site
Id Integer - The site ID, which can be obtained by calling the [ListSites] API.
- additional
Cacheable StringPorts - Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
- browser
Cache StringMode - Browser cache mode. Possible values:
- browser
Cache StringTtl - Browser cache expiration time in seconds.
- bypass
Cache String - Set the bypass cache mode. Possible values:
- cache
Deception StringArmor - Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
- cache
Reserve StringEligibility - Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
- String
- When generating the cache key, check if the cookie exists. If it does, add the cookie name (case-insensitive) to the cache key. Multiple cookie names are supported, separated by spaces.
- check
Presence StringHeader - When generating the cache key, check if the header exists. If it does, add the header name (case-insensitive) to the cache key. Multiple header names are supported, separated by spaces.
- edge
Cache StringMode - Edge cache mode. Possible values:
- edge
Cache StringTtl - Edge cache expiration time in seconds.
- edge
Status StringCode Cache Ttl - Status code cache expiration time in seconds.
- String
- When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
- include
Header String - When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
- query
String String - Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
- query
String StringMode - The processing mode for query strings when generating the cache key. Possible values:
- rule String
- Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:
- Match all incoming requests: value set to true.
- Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com").
- rule
Enable String - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- rule
Name String - Rule name. When adding global configuration, this parameter does not need to be set.
- serve
Stale String - Serve stale cache. When enabled, the node can still respond to user requests with expired cached files when the origin server is unavailable. Value range:
- site
Version Integer - The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
- sort
Query StringString For Cache - Query string sorting, disabled by default. Possible values:
- user
Device StringType - When generating the cache key, add the client device type. Possible values:
- user
Geo String - When generating the cache key, add the client's geographic location. Possible values:
- user
Language String - When generating cache keys, include the client's language type. Possible values:
- site
Id number - The site ID, which can be obtained by calling the [ListSites] API.
- additional
Cacheable stringPorts - Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
- browser
Cache stringMode - Browser cache mode. Possible values:
- browser
Cache stringTtl - Browser cache expiration time in seconds.
- bypass
Cache string - Set the bypass cache mode. Possible values:
- cache
Deception stringArmor - Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
- cache
Reserve stringEligibility - Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
- string
- When generating the cache key, check if the cookie exists. If it does, add the cookie name (case-insensitive) to the cache key. Multiple cookie names are supported, separated by spaces.
- check
Presence stringHeader - When generating the cache key, check if the header exists. If it does, add the header name (case-insensitive) to the cache key. Multiple header names are supported, separated by spaces.
- edge
Cache stringMode - Edge cache mode. Possible values:
- edge
Cache stringTtl - Edge cache expiration time in seconds.
- edge
Status stringCode Cache Ttl - Status code cache expiration time in seconds.
- string
- When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
- include
Header string - When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
- query
String string - Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
- query
String stringMode - The processing mode for query strings when generating the cache key. Possible values:
- rule string
- Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:
- Match all incoming requests: value set to true.
- Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com").
- rule
Enable string - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- rule
Name string - Rule name. When adding global configuration, this parameter does not need to be set.
- serve
Stale string - Serve stale cache. When enabled, the node can still respond to user requests with expired cached files when the origin server is unavailable. Value range:
- site
Version number - The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
- sort
Query stringString For Cache - Query string sorting, disabled by default. Possible values:
- user
Device stringType - When generating the cache key, add the client device type. Possible values:
- user
Geo string - When generating the cache key, add the client's geographic location. Possible values:
- user
Language string - When generating cache keys, include the client's language type. Possible values:
- site_
id int - The site ID, which can be obtained by calling the [ListSites] API.
- additional_
cacheable_ strports - Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
- browser_
cache_ strmode - Browser cache mode. Possible values:
- browser_
cache_ strttl - Browser cache expiration time in seconds.
- bypass_
cache str - Set the bypass cache mode. Possible values:
- cache_
deception_ strarmor - Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
- cache_
reserve_ streligibility - Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
- str
- When generating the cache key, check if the cookie exists. If it does, add the cookie name (case-insensitive) to the cache key. Multiple cookie names are supported, separated by spaces.
- check_
presence_ strheader - When generating the cache key, check if the header exists. If it does, add the header name (case-insensitive) to the cache key. Multiple header names are supported, separated by spaces.
- edge_
cache_ strmode - Edge cache mode. Possible values:
- edge_
cache_ strttl - Edge cache expiration time in seconds.
- edge_
status_ strcode_ cache_ ttl - Status code cache expiration time in seconds.
- str
- When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
- include_
header str - When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
- query_
string str - Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
- query_
string_ strmode - The processing mode for query strings when generating the cache key. Possible values:
- rule str
- Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:
- Match all incoming requests: value set to true.
- Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com").
- rule_
enable str - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- rule_
name str - Rule name. When adding global configuration, this parameter does not need to be set.
- serve_
stale str - Serve stale cache. When enabled, the node can still respond to user requests with expired cached files when the origin server is unavailable. Value range:
- site_
version int - The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
- sort_
query_ strstring_ for_ cache - Query string sorting, disabled by default. Possible values:
- user_
device_ strtype - When generating the cache key, add the client device type. Possible values:
- user_
geo str - When generating the cache key, add the client's geographic location. Possible values:
- user_
language str - When generating cache keys, include the client's language type. Possible values:
- site
Id Number - The site ID, which can be obtained by calling the [ListSites] API.
- additional
Cacheable StringPorts - Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
- browser
Cache StringMode - Browser cache mode. Possible values:
- browser
Cache StringTtl - Browser cache expiration time in seconds.
- bypass
Cache String - Set the bypass cache mode. Possible values:
- cache
Deception StringArmor - Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
- cache
Reserve StringEligibility - Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
- String
- When generating the cache key, check if the cookie exists. If it does, add the cookie name (case-insensitive) to the cache key. Multiple cookie names are supported, separated by spaces.
- check
Presence StringHeader - When generating the cache key, check if the header exists. If it does, add the header name (case-insensitive) to the cache key. Multiple header names are supported, separated by spaces.
- edge
Cache StringMode - Edge cache mode. Possible values:
- edge
Cache StringTtl - Edge cache expiration time in seconds.
- edge
Status StringCode Cache Ttl - Status code cache expiration time in seconds.
- String
- When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
- include
Header String - When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
- query
String String - Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
- query
String StringMode - The processing mode for query strings when generating the cache key. Possible values:
- rule String
- Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:
- Match all incoming requests: value set to true.
- Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com").
- rule
Enable String - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- rule
Name String - Rule name. When adding global configuration, this parameter does not need to be set.
- serve
Stale String - Serve stale cache. When enabled, the node can still respond to user requests with expired cached files when the origin server is unavailable. Value range:
- site
Version Number - The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
- sort
Query StringString For Cache - Query string sorting, disabled by default. Possible values:
- user
Device StringType - When generating the cache key, add the client device type. Possible values:
- user
Geo String - When generating the cache key, add the client's geographic location. Possible values:
- user
Language String - When generating cache keys, include the client's language type. Possible values:
Outputs
All input properties are implicitly available as output properties. Additionally, the CacheRule resource produces the following output properties:
- Cache
Rule intId - Cache Rule Id.
- Id string
- The provider-assigned unique ID for this managed resource.
- Cache
Rule intId - Cache Rule Id.
- Id string
- The provider-assigned unique ID for this managed resource.
- cache
Rule IntegerId - Cache Rule Id.
- id String
- The provider-assigned unique ID for this managed resource.
- cache
Rule numberId - Cache Rule Id.
- id string
- The provider-assigned unique ID for this managed resource.
- cache_
rule_ intid - Cache Rule Id.
- id str
- The provider-assigned unique ID for this managed resource.
- cache
Rule NumberId - Cache Rule Id.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing CacheRule Resource
Get an existing CacheRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: CacheRuleState, opts?: CustomResourceOptions): CacheRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
additional_cacheable_ports: Optional[str] = None,
browser_cache_mode: Optional[str] = None,
browser_cache_ttl: Optional[str] = None,
bypass_cache: Optional[str] = None,
cache_deception_armor: Optional[str] = None,
cache_reserve_eligibility: Optional[str] = None,
cache_rule_id: Optional[int] = None,
check_presence_cookie: Optional[str] = None,
check_presence_header: Optional[str] = None,
edge_cache_mode: Optional[str] = None,
edge_cache_ttl: Optional[str] = None,
edge_status_code_cache_ttl: Optional[str] = None,
include_cookie: Optional[str] = None,
include_header: Optional[str] = None,
query_string: Optional[str] = None,
query_string_mode: Optional[str] = None,
rule: Optional[str] = None,
rule_enable: Optional[str] = None,
rule_name: Optional[str] = None,
serve_stale: Optional[str] = None,
site_id: Optional[int] = None,
site_version: Optional[int] = None,
sort_query_string_for_cache: Optional[str] = None,
user_device_type: Optional[str] = None,
user_geo: Optional[str] = None,
user_language: Optional[str] = None) -> CacheRule
func GetCacheRule(ctx *Context, name string, id IDInput, state *CacheRuleState, opts ...ResourceOption) (*CacheRule, error)
public static CacheRule Get(string name, Input<string> id, CacheRuleState? state, CustomResourceOptions? opts = null)
public static CacheRule get(String name, Output<String> id, CacheRuleState state, CustomResourceOptions options)
resources: _: type: alicloud:esa:CacheRule get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Additional
Cacheable stringPorts - Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
- Browser
Cache stringMode - Browser cache mode. Possible values:
- Browser
Cache stringTtl - Browser cache expiration time in seconds.
- Bypass
Cache string - Set the bypass cache mode. Possible values:
- Cache
Deception stringArmor - Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
- Cache
Reserve stringEligibility - Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
- Cache
Rule intId - Cache Rule Id.
- string
- When generating the cache key, check if the cookie exists. If it does, add the cookie name (case-insensitive) to the cache key. Multiple cookie names are supported, separated by spaces.
- Check
Presence stringHeader - When generating the cache key, check if the header exists. If it does, add the header name (case-insensitive) to the cache key. Multiple header names are supported, separated by spaces.
- Edge
Cache stringMode - Edge cache mode. Possible values:
- Edge
Cache stringTtl - Edge cache expiration time in seconds.
- Edge
Status stringCode Cache Ttl - Status code cache expiration time in seconds.
- string
- When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
- Include
Header string - When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
- Query
String string - Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
- Query
String stringMode - The processing mode for query strings when generating the cache key. Possible values:
- Rule string
- Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:
- Match all incoming requests: value set to true.
- Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com").
- Rule
Enable string - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- Rule
Name string - Rule name. When adding global configuration, this parameter does not need to be set.
- Serve
Stale string - Serve stale cache. When enabled, the node can still respond to user requests with expired cached files when the origin server is unavailable. Value range:
- Site
Id int - The site ID, which can be obtained by calling the [ListSites] API.
- Site
Version int - The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
- Sort
Query stringString For Cache - Query string sorting, disabled by default. Possible values:
- User
Device stringType - When generating the cache key, add the client device type. Possible values:
- User
Geo string - When generating the cache key, add the client's geographic location. Possible values:
- User
Language string - When generating cache keys, include the client's language type. Possible values:
- Additional
Cacheable stringPorts - Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
- Browser
Cache stringMode - Browser cache mode. Possible values:
- Browser
Cache stringTtl - Browser cache expiration time in seconds.
- Bypass
Cache string - Set the bypass cache mode. Possible values:
- Cache
Deception stringArmor - Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
- Cache
Reserve stringEligibility - Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
- Cache
Rule intId - Cache Rule Id.
- string
- When generating the cache key, check if the cookie exists. If it does, add the cookie name (case-insensitive) to the cache key. Multiple cookie names are supported, separated by spaces.
- Check
Presence stringHeader - When generating the cache key, check if the header exists. If it does, add the header name (case-insensitive) to the cache key. Multiple header names are supported, separated by spaces.
- Edge
Cache stringMode - Edge cache mode. Possible values:
- Edge
Cache stringTtl - Edge cache expiration time in seconds.
- Edge
Status stringCode Cache Ttl - Status code cache expiration time in seconds.
- string
- When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
- Include
Header string - When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
- Query
String string - Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
- Query
String stringMode - The processing mode for query strings when generating the cache key. Possible values:
- Rule string
- Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:
- Match all incoming requests: value set to true.
- Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com").
- Rule
Enable string - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- Rule
Name string - Rule name. When adding global configuration, this parameter does not need to be set.
- Serve
Stale string - Serve stale cache. When enabled, the node can still respond to user requests with expired cached files when the origin server is unavailable. Value range:
- Site
Id int - The site ID, which can be obtained by calling the [ListSites] API.
- Site
Version int - The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
- Sort
Query stringString For Cache - Query string sorting, disabled by default. Possible values:
- User
Device stringType - When generating the cache key, add the client device type. Possible values:
- User
Geo string - When generating the cache key, add the client's geographic location. Possible values:
- User
Language string - When generating cache keys, include the client's language type. Possible values:
- additional
Cacheable StringPorts - Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
- browser
Cache StringMode - Browser cache mode. Possible values:
- browser
Cache StringTtl - Browser cache expiration time in seconds.
- bypass
Cache String - Set the bypass cache mode. Possible values:
- cache
Deception StringArmor - Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
- cache
Reserve StringEligibility - Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
- cache
Rule IntegerId - Cache Rule Id.
- String
- When generating the cache key, check if the cookie exists. If it does, add the cookie name (case-insensitive) to the cache key. Multiple cookie names are supported, separated by spaces.
- check
Presence StringHeader - When generating the cache key, check if the header exists. If it does, add the header name (case-insensitive) to the cache key. Multiple header names are supported, separated by spaces.
- edge
Cache StringMode - Edge cache mode. Possible values:
- edge
Cache StringTtl - Edge cache expiration time in seconds.
- edge
Status StringCode Cache Ttl - Status code cache expiration time in seconds.
- String
- When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
- include
Header String - When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
- query
String String - Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
- query
String StringMode - The processing mode for query strings when generating the cache key. Possible values:
- rule String
- Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:
- Match all incoming requests: value set to true.
- Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com").
- rule
Enable String - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- rule
Name String - Rule name. When adding global configuration, this parameter does not need to be set.
- serve
Stale String - Serve stale cache. When enabled, the node can still respond to user requests with expired cached files when the origin server is unavailable. Value range:
- site
Id Integer - The site ID, which can be obtained by calling the [ListSites] API.
- site
Version Integer - The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
- sort
Query StringString For Cache - Query string sorting, disabled by default. Possible values:
- user
Device StringType - When generating the cache key, add the client device type. Possible values:
- user
Geo String - When generating the cache key, add the client's geographic location. Possible values:
- user
Language String - When generating cache keys, include the client's language type. Possible values:
- additional
Cacheable stringPorts - Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
- browser
Cache stringMode - Browser cache mode. Possible values:
- browser
Cache stringTtl - Browser cache expiration time in seconds.
- bypass
Cache string - Set the bypass cache mode. Possible values:
- cache
Deception stringArmor - Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
- cache
Reserve stringEligibility - Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
- cache
Rule numberId - Cache Rule Id.
- string
- When generating the cache key, check if the cookie exists. If it does, add the cookie name (case-insensitive) to the cache key. Multiple cookie names are supported, separated by spaces.
- check
Presence stringHeader - When generating the cache key, check if the header exists. If it does, add the header name (case-insensitive) to the cache key. Multiple header names are supported, separated by spaces.
- edge
Cache stringMode - Edge cache mode. Possible values:
- edge
Cache stringTtl - Edge cache expiration time in seconds.
- edge
Status stringCode Cache Ttl - Status code cache expiration time in seconds.
- string
- When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
- include
Header string - When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
- query
String string - Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
- query
String stringMode - The processing mode for query strings when generating the cache key. Possible values:
- rule string
- Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:
- Match all incoming requests: value set to true.
- Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com").
- rule
Enable string - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- rule
Name string - Rule name. When adding global configuration, this parameter does not need to be set.
- serve
Stale string - Serve stale cache. When enabled, the node can still respond to user requests with expired cached files when the origin server is unavailable. Value range:
- site
Id number - The site ID, which can be obtained by calling the [ListSites] API.
- site
Version number - The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
- sort
Query stringString For Cache - Query string sorting, disabled by default. Possible values:
- user
Device stringType - When generating the cache key, add the client device type. Possible values:
- user
Geo string - When generating the cache key, add the client's geographic location. Possible values:
- user
Language string - When generating cache keys, include the client's language type. Possible values:
- additional_
cacheable_ strports - Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
- browser_
cache_ strmode - Browser cache mode. Possible values:
- browser_
cache_ strttl - Browser cache expiration time in seconds.
- bypass_
cache str - Set the bypass cache mode. Possible values:
- cache_
deception_ strarmor - Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
- cache_
reserve_ streligibility - Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
- cache_
rule_ intid - Cache Rule Id.
- str
- When generating the cache key, check if the cookie exists. If it does, add the cookie name (case-insensitive) to the cache key. Multiple cookie names are supported, separated by spaces.
- check_
presence_ strheader - When generating the cache key, check if the header exists. If it does, add the header name (case-insensitive) to the cache key. Multiple header names are supported, separated by spaces.
- edge_
cache_ strmode - Edge cache mode. Possible values:
- edge_
cache_ strttl - Edge cache expiration time in seconds.
- edge_
status_ strcode_ cache_ ttl - Status code cache expiration time in seconds.
- str
- When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
- include_
header str - When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
- query_
string str - Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
- query_
string_ strmode - The processing mode for query strings when generating the cache key. Possible values:
- rule str
- Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:
- Match all incoming requests: value set to true.
- Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com").
- rule_
enable str - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- rule_
name str - Rule name. When adding global configuration, this parameter does not need to be set.
- serve_
stale str - Serve stale cache. When enabled, the node can still respond to user requests with expired cached files when the origin server is unavailable. Value range:
- site_
id int - The site ID, which can be obtained by calling the [ListSites] API.
- site_
version int - The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
- sort_
query_ strstring_ for_ cache - Query string sorting, disabled by default. Possible values:
- user_
device_ strtype - When generating the cache key, add the client device type. Possible values:
- user_
geo str - When generating the cache key, add the client's geographic location. Possible values:
- user_
language str - When generating cache keys, include the client's language type. Possible values:
- additional
Cacheable StringPorts - Enable caching on specified ports. Value range: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096
- browser
Cache StringMode - Browser cache mode. Possible values:
- browser
Cache StringTtl - Browser cache expiration time in seconds.
- bypass
Cache String - Set the bypass cache mode. Possible values:
- cache
Deception StringArmor - Cache deception protection. Used to defend against web cache deception attacks, only the cache content that passes the validation will be cached. Value range:
- cache
Reserve StringEligibility - Cache retention eligibility. Used to control whether user requests bypass the cache retention node when returning to the origin. Possible values:
- cache
Rule NumberId - Cache Rule Id.
- String
- When generating the cache key, check if the cookie exists. If it does, add the cookie name (case-insensitive) to the cache key. Multiple cookie names are supported, separated by spaces.
- check
Presence StringHeader - When generating the cache key, check if the header exists. If it does, add the header name (case-insensitive) to the cache key. Multiple header names are supported, separated by spaces.
- edge
Cache StringMode - Edge cache mode. Possible values:
- edge
Cache StringTtl - Edge cache expiration time in seconds.
- edge
Status StringCode Cache Ttl - Status code cache expiration time in seconds.
- String
- When generating the cache key, add the specified cookie names and their values. Multiple values are supported, separated by spaces.
- include
Header String - When generating the cache key, add the specified header names and their values. Multiple values are supported, separated by spaces.
- query
String String - Query strings to be reserved or excluded. Multiple values are supported, separated by spaces.
- query
String StringMode - The processing mode for query strings when generating the cache key. Possible values:
- rule String
- Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:
- Match all incoming requests: value set to true.
- Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com").
- rule
Enable String - Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
- rule
Name String - Rule name. When adding global configuration, this parameter does not need to be set.
- serve
Stale String - Serve stale cache. When enabled, the node can still respond to user requests with expired cached files when the origin server is unavailable. Value range:
- site
Id Number - The site ID, which can be obtained by calling the [ListSites] API.
- site
Version Number - The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
- sort
Query StringString For Cache - Query string sorting, disabled by default. Possible values:
- user
Device StringType - When generating the cache key, add the client device type. Possible values:
- user
Geo String - When generating the cache key, add the client's geographic location. Possible values:
- user
Language String - When generating cache keys, include the client's language type. Possible values:
Import
ESA Cache Rule can be imported using the id, e.g.
$ pulumi import alicloud:esa/cacheRule:CacheRule example <site_id>:<cache_rule_id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.