/
getOriginAccessIdentity.go
166 lines (145 loc) · 6.35 KB
/
getOriginAccessIdentity.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package cloudfront
import (
"context"
"reflect"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to retrieve information for an Amazon CloudFront origin access identity.
//
// ## Example Usage
//
// The following example below creates a CloudFront origin access identity.
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudfront"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := cloudfront.LookupOriginAccessIdentity(ctx, &cloudfront.LookupOriginAccessIdentityArgs{
// Id: "E1ZAKK699EOLAL",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
func LookupOriginAccessIdentity(ctx *pulumi.Context, args *LookupOriginAccessIdentityArgs, opts ...pulumi.InvokeOption) (*LookupOriginAccessIdentityResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupOriginAccessIdentityResult
err := ctx.Invoke("aws:cloudfront/getOriginAccessIdentity:getOriginAccessIdentity", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getOriginAccessIdentity.
type LookupOriginAccessIdentityArgs struct {
// The identifier for the origin access identity. For example: `E1ZAKK699EOLAL`.
Id string `pulumi:"id"`
}
// A collection of values returned by getOriginAccessIdentity.
type LookupOriginAccessIdentityResult struct {
// Internal value used by CloudFront to allow future
// updates to the origin access identity.
CallerReference string `pulumi:"callerReference"`
// A shortcut to the full path for the
// origin access identity to use in CloudFront, see below.
CloudfrontAccessIdentityPath string `pulumi:"cloudfrontAccessIdentityPath"`
// An optional comment for the origin access identity.
Comment string `pulumi:"comment"`
// Current version of the origin access identity's information.
// For example: `E2QWRUHAPOMQZL`.
Etag string `pulumi:"etag"`
// Pre-generated ARN for use in S3 bucket policies (see below).
// Example: `arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity
// E2QWRUHAPOMQZL`.
IamArn string `pulumi:"iamArn"`
Id string `pulumi:"id"`
// The Amazon S3 canonical user ID for the origin
// access identity, which you use when giving the origin access identity read
// permission to an object in Amazon S3.
S3CanonicalUserId string `pulumi:"s3CanonicalUserId"`
}
func LookupOriginAccessIdentityOutput(ctx *pulumi.Context, args LookupOriginAccessIdentityOutputArgs, opts ...pulumi.InvokeOption) LookupOriginAccessIdentityResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupOriginAccessIdentityResult, error) {
args := v.(LookupOriginAccessIdentityArgs)
r, err := LookupOriginAccessIdentity(ctx, &args, opts...)
var s LookupOriginAccessIdentityResult
if r != nil {
s = *r
}
return s, err
}).(LookupOriginAccessIdentityResultOutput)
}
// A collection of arguments for invoking getOriginAccessIdentity.
type LookupOriginAccessIdentityOutputArgs struct {
// The identifier for the origin access identity. For example: `E1ZAKK699EOLAL`.
Id pulumi.StringInput `pulumi:"id"`
}
func (LookupOriginAccessIdentityOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupOriginAccessIdentityArgs)(nil)).Elem()
}
// A collection of values returned by getOriginAccessIdentity.
type LookupOriginAccessIdentityResultOutput struct{ *pulumi.OutputState }
func (LookupOriginAccessIdentityResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupOriginAccessIdentityResult)(nil)).Elem()
}
func (o LookupOriginAccessIdentityResultOutput) ToLookupOriginAccessIdentityResultOutput() LookupOriginAccessIdentityResultOutput {
return o
}
func (o LookupOriginAccessIdentityResultOutput) ToLookupOriginAccessIdentityResultOutputWithContext(ctx context.Context) LookupOriginAccessIdentityResultOutput {
return o
}
// Internal value used by CloudFront to allow future
// updates to the origin access identity.
func (o LookupOriginAccessIdentityResultOutput) CallerReference() pulumi.StringOutput {
return o.ApplyT(func(v LookupOriginAccessIdentityResult) string { return v.CallerReference }).(pulumi.StringOutput)
}
// A shortcut to the full path for the
// origin access identity to use in CloudFront, see below.
func (o LookupOriginAccessIdentityResultOutput) CloudfrontAccessIdentityPath() pulumi.StringOutput {
return o.ApplyT(func(v LookupOriginAccessIdentityResult) string { return v.CloudfrontAccessIdentityPath }).(pulumi.StringOutput)
}
// An optional comment for the origin access identity.
func (o LookupOriginAccessIdentityResultOutput) Comment() pulumi.StringOutput {
return o.ApplyT(func(v LookupOriginAccessIdentityResult) string { return v.Comment }).(pulumi.StringOutput)
}
// Current version of the origin access identity's information.
// For example: `E2QWRUHAPOMQZL`.
func (o LookupOriginAccessIdentityResultOutput) Etag() pulumi.StringOutput {
return o.ApplyT(func(v LookupOriginAccessIdentityResult) string { return v.Etag }).(pulumi.StringOutput)
}
// Pre-generated ARN for use in S3 bucket policies (see below).
// Example: `arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity
// E2QWRUHAPOMQZL`.
func (o LookupOriginAccessIdentityResultOutput) IamArn() pulumi.StringOutput {
return o.ApplyT(func(v LookupOriginAccessIdentityResult) string { return v.IamArn }).(pulumi.StringOutput)
}
func (o LookupOriginAccessIdentityResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupOriginAccessIdentityResult) string { return v.Id }).(pulumi.StringOutput)
}
// The Amazon S3 canonical user ID for the origin
// access identity, which you use when giving the origin access identity read
// permission to an object in Amazon S3.
func (o LookupOriginAccessIdentityResultOutput) S3CanonicalUserId() pulumi.StringOutput {
return o.ApplyT(func(v LookupOriginAccessIdentityResult) string { return v.S3CanonicalUserId }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupOriginAccessIdentityResultOutput{})
}