UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

173 lines (172 loc) 7.06 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * ## Example Usage * * Use the `aws.cloudfront.CachePolicy` resource to create a cache policy for CloudFront. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.cloudfront.CachePolicy("example", { * name: "example-policy", * comment: "test comment", * defaultTtl: 50, * maxTtl: 100, * minTtl: 1, * parametersInCacheKeyAndForwardedToOrigin: { * cookiesConfig: { * cookieBehavior: "whitelist", * cookies: { * items: ["example"], * }, * }, * headersConfig: { * headerBehavior: "whitelist", * headers: { * items: ["example"], * }, * }, * queryStringsConfig: { * queryStringBehavior: "whitelist", * queryStrings: { * items: ["example"], * }, * }, * }, * }); * ``` * * ## Import * * Using `pulumi import`, import CloudFront cache policies using the `id` of the cache policy. For example: * * ```sh * $ pulumi import aws:cloudfront/cachePolicy:CachePolicy policy 658327ea-f89d-4fab-a63d-7e88639e58f6 * ``` */ export declare class CachePolicy extends pulumi.CustomResource { /** * Get an existing CachePolicy resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: CachePolicyState, opts?: pulumi.CustomResourceOptions): CachePolicy; /** * Returns true if the given object is an instance of CachePolicy. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is CachePolicy; /** * The cache policy ARN. */ readonly arn: pulumi.Output<string>; /** * Description for the cache policy. */ readonly comment: pulumi.Output<string | undefined>; /** * Amount of time, in seconds, that objects are allowed to remain in the CloudFront cache before CloudFront sends a new request to the origin server to check if the object has been updated. */ readonly defaultTtl: pulumi.Output<number | undefined>; /** * Current version of the cache policy. */ readonly etag: pulumi.Output<string>; /** * Maximum amount of time, in seconds, that objects stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated. */ readonly maxTtl: pulumi.Output<number | undefined>; /** * Minimum amount of time, in seconds, that objects should remain in the CloudFront cache before a new request is sent to the origin to check for updates. */ readonly minTtl: pulumi.Output<number | undefined>; /** * Unique name used to identify the cache policy. */ readonly name: pulumi.Output<string>; /** * Configuration for including HTTP headers, cookies, and URL query strings in the cache key. For more information, refer to the Parameters In Cache Key And Forwarded To Origin section. */ readonly parametersInCacheKeyAndForwardedToOrigin: pulumi.Output<outputs.cloudfront.CachePolicyParametersInCacheKeyAndForwardedToOrigin>; /** * Create a CachePolicy resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: CachePolicyArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering CachePolicy resources. */ export interface CachePolicyState { /** * The cache policy ARN. */ arn?: pulumi.Input<string>; /** * Description for the cache policy. */ comment?: pulumi.Input<string>; /** * Amount of time, in seconds, that objects are allowed to remain in the CloudFront cache before CloudFront sends a new request to the origin server to check if the object has been updated. */ defaultTtl?: pulumi.Input<number>; /** * Current version of the cache policy. */ etag?: pulumi.Input<string>; /** * Maximum amount of time, in seconds, that objects stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated. */ maxTtl?: pulumi.Input<number>; /** * Minimum amount of time, in seconds, that objects should remain in the CloudFront cache before a new request is sent to the origin to check for updates. */ minTtl?: pulumi.Input<number>; /** * Unique name used to identify the cache policy. */ name?: pulumi.Input<string>; /** * Configuration for including HTTP headers, cookies, and URL query strings in the cache key. For more information, refer to the Parameters In Cache Key And Forwarded To Origin section. */ parametersInCacheKeyAndForwardedToOrigin?: pulumi.Input<inputs.cloudfront.CachePolicyParametersInCacheKeyAndForwardedToOrigin>; } /** * The set of arguments for constructing a CachePolicy resource. */ export interface CachePolicyArgs { /** * Description for the cache policy. */ comment?: pulumi.Input<string>; /** * Amount of time, in seconds, that objects are allowed to remain in the CloudFront cache before CloudFront sends a new request to the origin server to check if the object has been updated. */ defaultTtl?: pulumi.Input<number>; /** * Maximum amount of time, in seconds, that objects stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated. */ maxTtl?: pulumi.Input<number>; /** * Minimum amount of time, in seconds, that objects should remain in the CloudFront cache before a new request is sent to the origin to check for updates. */ minTtl?: pulumi.Input<number>; /** * Unique name used to identify the cache policy. */ name?: pulumi.Input<string>; /** * Configuration for including HTTP headers, cookies, and URL query strings in the cache key. For more information, refer to the Parameters In Cache Key And Forwarded To Origin section. */ parametersInCacheKeyAndForwardedToOrigin: pulumi.Input<inputs.cloudfront.CachePolicyParametersInCacheKeyAndForwardedToOrigin>; }