-
Notifications
You must be signed in to change notification settings - Fork 150
/
getCachePolicy.go
68 lines (63 loc) · 2.56 KB
/
getCachePolicy.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package cloudfront
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ## Example Usage
//
// The following example below creates a CloudFront cache policy.
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/cloudfront"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// opt0 := "example-policy"
// _, err := cloudfront.LookupCachePolicy(ctx, &cloudfront.LookupCachePolicyArgs{
// Name: &opt0,
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func LookupCachePolicy(ctx *pulumi.Context, args *LookupCachePolicyArgs, opts ...pulumi.InvokeOption) (*LookupCachePolicyResult, error) {
var rv LookupCachePolicyResult
err := ctx.Invoke("aws:cloudfront/getCachePolicy:getCachePolicy", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getCachePolicy.
type LookupCachePolicyArgs struct {
// The identifier for the cache policy.
Id *string `pulumi:"id"`
// A unique name to identify the cache policy.
Name *string `pulumi:"name"`
}
// A collection of values returned by getCachePolicy.
type LookupCachePolicyResult struct {
// A comment to describe the cache policy.
Comment string `pulumi:"comment"`
// The default amount of time, in seconds, that you want objects to stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated.
DefaultTtl int `pulumi:"defaultTtl"`
// The current version of the cache policy.
Etag string `pulumi:"etag"`
Id *string `pulumi:"id"`
// The 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 int `pulumi:"maxTtl"`
// The minimum amount of time, in seconds, that you want objects to stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated.
MinTtl int `pulumi:"minTtl"`
Name *string `pulumi:"name"`
// The HTTP headers, cookies, and URL query strings to include in the cache key. See Parameters In Cache Key And Forwarded To Origin for more information.
ParametersInCacheKeyAndForwardedToOrigins []GetCachePolicyParametersInCacheKeyAndForwardedToOrigin `pulumi:"parametersInCacheKeyAndForwardedToOrigins"`
}