-
Notifications
You must be signed in to change notification settings - Fork 150
/
getResponseHeadersPolicy.go
146 lines (125 loc) · 6.35 KB
/
getResponseHeadersPolicy.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// *** 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 (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to retrieve information about a CloudFront cache policy.
//
// ## Example Usage
//
// ```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.LookupResponseHeadersPolicy(ctx, &cloudfront.LookupResponseHeadersPolicyArgs{
// Name: &opt0,
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func LookupResponseHeadersPolicy(ctx *pulumi.Context, args *LookupResponseHeadersPolicyArgs, opts ...pulumi.InvokeOption) (*LookupResponseHeadersPolicyResult, error) {
var rv LookupResponseHeadersPolicyResult
err := ctx.Invoke("aws:cloudfront/getResponseHeadersPolicy:getResponseHeadersPolicy", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getResponseHeadersPolicy.
type LookupResponseHeadersPolicyArgs struct {
// The identifier for the response headers policy.
Id *string `pulumi:"id"`
// A unique name to identify the response headers policy.
Name *string `pulumi:"name"`
}
// A collection of values returned by getResponseHeadersPolicy.
type LookupResponseHeadersPolicyResult struct {
// A comment to describe the response headers policy. The comment cannot be longer than 128 characters.
Comment string `pulumi:"comment"`
// A configuration for a set of HTTP response headers that are used for Cross-Origin Resource Sharing (CORS). See Cors Config for more information.
CorsConfigs []GetResponseHeadersPolicyCorsConfig `pulumi:"corsConfigs"`
// Object that contains an attribute `items` that contains a list of Custom Headers See Custom Header for more information.
CustomHeadersConfigs []GetResponseHeadersPolicyCustomHeadersConfig `pulumi:"customHeadersConfigs"`
// The current version of the response headers policy.
Etag string `pulumi:"etag"`
Id string `pulumi:"id"`
Name string `pulumi:"name"`
// A configuration for a set of security-related HTTP response headers. See Security Headers Config for more information.
SecurityHeadersConfigs []GetResponseHeadersPolicySecurityHeadersConfig `pulumi:"securityHeadersConfigs"`
}
func LookupResponseHeadersPolicyOutput(ctx *pulumi.Context, args LookupResponseHeadersPolicyOutputArgs, opts ...pulumi.InvokeOption) LookupResponseHeadersPolicyResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupResponseHeadersPolicyResult, error) {
args := v.(LookupResponseHeadersPolicyArgs)
r, err := LookupResponseHeadersPolicy(ctx, &args, opts...)
return *r, err
}).(LookupResponseHeadersPolicyResultOutput)
}
// A collection of arguments for invoking getResponseHeadersPolicy.
type LookupResponseHeadersPolicyOutputArgs struct {
// The identifier for the response headers policy.
Id pulumi.StringPtrInput `pulumi:"id"`
// A unique name to identify the response headers policy.
Name pulumi.StringPtrInput `pulumi:"name"`
}
func (LookupResponseHeadersPolicyOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupResponseHeadersPolicyArgs)(nil)).Elem()
}
// A collection of values returned by getResponseHeadersPolicy.
type LookupResponseHeadersPolicyResultOutput struct{ *pulumi.OutputState }
func (LookupResponseHeadersPolicyResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupResponseHeadersPolicyResult)(nil)).Elem()
}
func (o LookupResponseHeadersPolicyResultOutput) ToLookupResponseHeadersPolicyResultOutput() LookupResponseHeadersPolicyResultOutput {
return o
}
func (o LookupResponseHeadersPolicyResultOutput) ToLookupResponseHeadersPolicyResultOutputWithContext(ctx context.Context) LookupResponseHeadersPolicyResultOutput {
return o
}
// A comment to describe the response headers policy. The comment cannot be longer than 128 characters.
func (o LookupResponseHeadersPolicyResultOutput) Comment() pulumi.StringOutput {
return o.ApplyT(func(v LookupResponseHeadersPolicyResult) string { return v.Comment }).(pulumi.StringOutput)
}
// A configuration for a set of HTTP response headers that are used for Cross-Origin Resource Sharing (CORS). See Cors Config for more information.
func (o LookupResponseHeadersPolicyResultOutput) CorsConfigs() GetResponseHeadersPolicyCorsConfigArrayOutput {
return o.ApplyT(func(v LookupResponseHeadersPolicyResult) []GetResponseHeadersPolicyCorsConfig { return v.CorsConfigs }).(GetResponseHeadersPolicyCorsConfigArrayOutput)
}
// Object that contains an attribute `items` that contains a list of Custom Headers See Custom Header for more information.
func (o LookupResponseHeadersPolicyResultOutput) CustomHeadersConfigs() GetResponseHeadersPolicyCustomHeadersConfigArrayOutput {
return o.ApplyT(func(v LookupResponseHeadersPolicyResult) []GetResponseHeadersPolicyCustomHeadersConfig {
return v.CustomHeadersConfigs
}).(GetResponseHeadersPolicyCustomHeadersConfigArrayOutput)
}
// The current version of the response headers policy.
func (o LookupResponseHeadersPolicyResultOutput) Etag() pulumi.StringOutput {
return o.ApplyT(func(v LookupResponseHeadersPolicyResult) string { return v.Etag }).(pulumi.StringOutput)
}
func (o LookupResponseHeadersPolicyResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupResponseHeadersPolicyResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupResponseHeadersPolicyResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupResponseHeadersPolicyResult) string { return v.Name }).(pulumi.StringOutput)
}
// A configuration for a set of security-related HTTP response headers. See Security Headers Config for more information.
func (o LookupResponseHeadersPolicyResultOutput) SecurityHeadersConfigs() GetResponseHeadersPolicySecurityHeadersConfigArrayOutput {
return o.ApplyT(func(v LookupResponseHeadersPolicyResult) []GetResponseHeadersPolicySecurityHeadersConfig {
return v.SecurityHeadersConfigs
}).(GetResponseHeadersPolicySecurityHeadersConfigArrayOutput)
}
func init() {
pulumi.RegisterOutputType(LookupResponseHeadersPolicyResultOutput{})
}