-
Notifications
You must be signed in to change notification settings - Fork 151
/
getDistribution.go
174 lines (150 loc) · 6.76 KB
/
getDistribution.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
167
168
169
170
171
172
173
174
// *** 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 distribution.
//
// ## 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 {
// _, err := cloudfront.LookupDistribution(ctx, &cloudfront.LookupDistributionArgs{
// Id: "EDFDVBD632BHDS5",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func LookupDistribution(ctx *pulumi.Context, args *LookupDistributionArgs, opts ...pulumi.InvokeOption) (*LookupDistributionResult, error) {
var rv LookupDistributionResult
err := ctx.Invoke("aws:cloudfront/getDistribution:getDistribution", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getDistribution.
type LookupDistributionArgs struct {
// The identifier for the distribution. For example: `EDFDVBD632BHDS5`.
Id string `pulumi:"id"`
Tags map[string]string `pulumi:"tags"`
}
// A collection of values returned by getDistribution.
type LookupDistributionResult struct {
// The ARN (Amazon Resource Name) for the distribution. For example: arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5, where 123456789012 is your AWS account ID.
Arn string `pulumi:"arn"`
// The domain name corresponding to the distribution. For
// example: `d604721fxaaqy9.cloudfront.net`.
DomainName string `pulumi:"domainName"`
Enabled bool `pulumi:"enabled"`
// The current version of the distribution's information. For example:
// `E2QWRUHAPOMQZL`.
Etag string `pulumi:"etag"`
// The CloudFront Route 53 zone ID that can be used to
// route an [Alias Resource Record Set][7] to. This attribute is simply an
// alias for the zone ID `Z2FDTNDATAQYW2`.
HostedZoneId string `pulumi:"hostedZoneId"`
// The identifier for the distribution. For example: `EDFDVBD632BHDS5`.
Id string `pulumi:"id"`
// The number of invalidation batches
// currently in progress.
InProgressValidationBatches int `pulumi:"inProgressValidationBatches"`
// The date and time the distribution was last modified.
LastModifiedTime string `pulumi:"lastModifiedTime"`
// The current status of the distribution. `Deployed` if the
// distribution's information is fully propagated throughout the Amazon
// CloudFront system.
Status string `pulumi:"status"`
Tags map[string]string `pulumi:"tags"`
}
func LookupDistributionOutput(ctx *pulumi.Context, args LookupDistributionOutputArgs, opts ...pulumi.InvokeOption) LookupDistributionResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupDistributionResult, error) {
args := v.(LookupDistributionArgs)
r, err := LookupDistribution(ctx, &args, opts...)
return *r, err
}).(LookupDistributionResultOutput)
}
// A collection of arguments for invoking getDistribution.
type LookupDistributionOutputArgs struct {
// The identifier for the distribution. For example: `EDFDVBD632BHDS5`.
Id pulumi.StringInput `pulumi:"id"`
Tags pulumi.StringMapInput `pulumi:"tags"`
}
func (LookupDistributionOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDistributionArgs)(nil)).Elem()
}
// A collection of values returned by getDistribution.
type LookupDistributionResultOutput struct{ *pulumi.OutputState }
func (LookupDistributionResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDistributionResult)(nil)).Elem()
}
func (o LookupDistributionResultOutput) ToLookupDistributionResultOutput() LookupDistributionResultOutput {
return o
}
func (o LookupDistributionResultOutput) ToLookupDistributionResultOutputWithContext(ctx context.Context) LookupDistributionResultOutput {
return o
}
// The ARN (Amazon Resource Name) for the distribution. For example: arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5, where 123456789012 is your AWS account ID.
func (o LookupDistributionResultOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v LookupDistributionResult) string { return v.Arn }).(pulumi.StringOutput)
}
// The domain name corresponding to the distribution. For
// example: `d604721fxaaqy9.cloudfront.net`.
func (o LookupDistributionResultOutput) DomainName() pulumi.StringOutput {
return o.ApplyT(func(v LookupDistributionResult) string { return v.DomainName }).(pulumi.StringOutput)
}
func (o LookupDistributionResultOutput) Enabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupDistributionResult) bool { return v.Enabled }).(pulumi.BoolOutput)
}
// The current version of the distribution's information. For example:
// `E2QWRUHAPOMQZL`.
func (o LookupDistributionResultOutput) Etag() pulumi.StringOutput {
return o.ApplyT(func(v LookupDistributionResult) string { return v.Etag }).(pulumi.StringOutput)
}
// The CloudFront Route 53 zone ID that can be used to
// route an [Alias Resource Record Set][7] to. This attribute is simply an
// alias for the zone ID `Z2FDTNDATAQYW2`.
func (o LookupDistributionResultOutput) HostedZoneId() pulumi.StringOutput {
return o.ApplyT(func(v LookupDistributionResult) string { return v.HostedZoneId }).(pulumi.StringOutput)
}
// The identifier for the distribution. For example: `EDFDVBD632BHDS5`.
func (o LookupDistributionResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupDistributionResult) string { return v.Id }).(pulumi.StringOutput)
}
// The number of invalidation batches
// currently in progress.
func (o LookupDistributionResultOutput) InProgressValidationBatches() pulumi.IntOutput {
return o.ApplyT(func(v LookupDistributionResult) int { return v.InProgressValidationBatches }).(pulumi.IntOutput)
}
// The date and time the distribution was last modified.
func (o LookupDistributionResultOutput) LastModifiedTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupDistributionResult) string { return v.LastModifiedTime }).(pulumi.StringOutput)
}
// The current status of the distribution. `Deployed` if the
// distribution's information is fully propagated throughout the Amazon
// CloudFront system.
func (o LookupDistributionResultOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v LookupDistributionResult) string { return v.Status }).(pulumi.StringOutput)
}
func (o LookupDistributionResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupDistributionResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(LookupDistributionResultOutput{})
}