aws::cloudfront-cache-policy

Create a cloudfront cache policy.

Example

aws::cloudfront-cache-policy cache-policy-example
    cache-policy-config
        default-ttl: 3600
        max-ttl: 86400
        min-ttl: 0
        name: "cache-policy-example"

        key-param
            accept-encoding-brotli: true
            accept-encoding-gzip: true

            headers-config
                header-behavior: "whitelist"
                headers: [
                    "example-header1",
                    "example-header2"
                ]
            end

            query-strings-config
                query-string-behavior: "whitelist"
                query-strings: [
                    "example-query1",
                    "example-query2"
                ]
            end

            cookies-config
                cookie-behavior: "whitelist"
                cookies: [
                    "example-cookie1",
                    "example-cookie2"
                ]
            end
        end
    end
end

Attributes

Attribute Description
cache-policy-config subresource

The cache policy configuration. (Required)

comment
The comment for the cache policy.
default-ttl
The default time to live for the cache policy.
name
The name for the cache policy. (Required)
max-ttl
The maximum time to live for the cache policy.
min-ttl
The minimum time to live for the cache policy.
key-param subresource

The key param for the cache policy.

cookies-config subresource

The cookies configuration for the cache policy.

cookie-behavior
The cookie behavior for the cache policy. Valid values are none, whitelist, allExcept or all. (Required)
cookies set
The cookies for the cache policy.
headers-config subresource

The headers configuration for the cache policy.

header-behavior
The header behavior for the cache policy. Valid values are none or whitelist. (Required)
headers set
The headers for the cache policy.
query-strings-config subresource

The query strings configuration for the cache policy.

query-string-behavior
The query string behavior for this cache policy. Valid values are none, whitelist, allExcept or all. (Required)
query-strings set
The query strings for this cache policy.
accept-encoding-brotli
Enable accept encoding brotli. (Required)
accept-encoding-gzip
Enable accept encoding gzip. (Required)

Outputs

Attribute Description
id The ID for the cache policy.