/
getDomainName.go
206 lines (177 loc) · 8.73 KB
/
getDomainName.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
// 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 apigateway
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to get the custom domain name for use with AWS API Gateway.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/apigateway"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := apigateway.LookupDomainName(ctx, &apigateway.LookupDomainNameArgs{
// DomainName: "api.example.com",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupDomainName(ctx *pulumi.Context, args *LookupDomainNameArgs, opts ...pulumi.InvokeOption) (*LookupDomainNameResult, error) {
var rv LookupDomainNameResult
err := ctx.Invoke("aws:apigateway/getDomainName:getDomainName", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getDomainName.
type LookupDomainNameArgs struct {
// Fully-qualified domain name to look up. If no domain name is found, an error will be returned.
DomainName string `pulumi:"domainName"`
// Key-value map of tags for the resource.
Tags map[string]string `pulumi:"tags"`
}
// A collection of values returned by getDomainName.
type LookupDomainNameResult struct {
// ARN of the found custom domain name.
Arn string `pulumi:"arn"`
// ARN for an AWS-managed certificate that is used by edge-optimized endpoint for this domain name.
CertificateArn string `pulumi:"certificateArn"`
// Name of the certificate that is used by edge-optimized endpoint for this domain name.
CertificateName string `pulumi:"certificateName"`
// Upload date associated with the domain certificate.
CertificateUploadDate string `pulumi:"certificateUploadDate"`
// Hostname created by Cloudfront to represent the distribution that implements this domain name mapping.
CloudfrontDomainName string `pulumi:"cloudfrontDomainName"`
// For convenience, the hosted zone ID (`Z2FDTNDATAQYW2`) that can be used to create a Route53 alias record for the distribution.
CloudfrontZoneId string `pulumi:"cloudfrontZoneId"`
DomainName string `pulumi:"domainName"`
// List of objects with the endpoint configuration of this domain name.
EndpointConfigurations []GetDomainNameEndpointConfiguration `pulumi:"endpointConfigurations"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// ARN for an AWS-managed certificate that is used for validating the regional domain name.
RegionalCertificateArn string `pulumi:"regionalCertificateArn"`
// User-friendly name of the certificate that is used by regional endpoint for this domain name.
RegionalCertificateName string `pulumi:"regionalCertificateName"`
// Hostname for the custom domain's regional endpoint.
RegionalDomainName string `pulumi:"regionalDomainName"`
// Hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
RegionalZoneId string `pulumi:"regionalZoneId"`
// Security policy for the domain name.
SecurityPolicy string `pulumi:"securityPolicy"`
// Key-value map of tags for the resource.
Tags map[string]string `pulumi:"tags"`
}
func LookupDomainNameOutput(ctx *pulumi.Context, args LookupDomainNameOutputArgs, opts ...pulumi.InvokeOption) LookupDomainNameResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupDomainNameResult, error) {
args := v.(LookupDomainNameArgs)
r, err := LookupDomainName(ctx, &args, opts...)
var s LookupDomainNameResult
if r != nil {
s = *r
}
return s, err
}).(LookupDomainNameResultOutput)
}
// A collection of arguments for invoking getDomainName.
type LookupDomainNameOutputArgs struct {
// Fully-qualified domain name to look up. If no domain name is found, an error will be returned.
DomainName pulumi.StringInput `pulumi:"domainName"`
// Key-value map of tags for the resource.
Tags pulumi.StringMapInput `pulumi:"tags"`
}
func (LookupDomainNameOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDomainNameArgs)(nil)).Elem()
}
// A collection of values returned by getDomainName.
type LookupDomainNameResultOutput struct{ *pulumi.OutputState }
func (LookupDomainNameResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDomainNameResult)(nil)).Elem()
}
func (o LookupDomainNameResultOutput) ToLookupDomainNameResultOutput() LookupDomainNameResultOutput {
return o
}
func (o LookupDomainNameResultOutput) ToLookupDomainNameResultOutputWithContext(ctx context.Context) LookupDomainNameResultOutput {
return o
}
// ARN of the found custom domain name.
func (o LookupDomainNameResultOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v LookupDomainNameResult) string { return v.Arn }).(pulumi.StringOutput)
}
// ARN for an AWS-managed certificate that is used by edge-optimized endpoint for this domain name.
func (o LookupDomainNameResultOutput) CertificateArn() pulumi.StringOutput {
return o.ApplyT(func(v LookupDomainNameResult) string { return v.CertificateArn }).(pulumi.StringOutput)
}
// Name of the certificate that is used by edge-optimized endpoint for this domain name.
func (o LookupDomainNameResultOutput) CertificateName() pulumi.StringOutput {
return o.ApplyT(func(v LookupDomainNameResult) string { return v.CertificateName }).(pulumi.StringOutput)
}
// Upload date associated with the domain certificate.
func (o LookupDomainNameResultOutput) CertificateUploadDate() pulumi.StringOutput {
return o.ApplyT(func(v LookupDomainNameResult) string { return v.CertificateUploadDate }).(pulumi.StringOutput)
}
// Hostname created by Cloudfront to represent the distribution that implements this domain name mapping.
func (o LookupDomainNameResultOutput) CloudfrontDomainName() pulumi.StringOutput {
return o.ApplyT(func(v LookupDomainNameResult) string { return v.CloudfrontDomainName }).(pulumi.StringOutput)
}
// For convenience, the hosted zone ID (`Z2FDTNDATAQYW2`) that can be used to create a Route53 alias record for the distribution.
func (o LookupDomainNameResultOutput) CloudfrontZoneId() pulumi.StringOutput {
return o.ApplyT(func(v LookupDomainNameResult) string { return v.CloudfrontZoneId }).(pulumi.StringOutput)
}
func (o LookupDomainNameResultOutput) DomainName() pulumi.StringOutput {
return o.ApplyT(func(v LookupDomainNameResult) string { return v.DomainName }).(pulumi.StringOutput)
}
// List of objects with the endpoint configuration of this domain name.
func (o LookupDomainNameResultOutput) EndpointConfigurations() GetDomainNameEndpointConfigurationArrayOutput {
return o.ApplyT(func(v LookupDomainNameResult) []GetDomainNameEndpointConfiguration { return v.EndpointConfigurations }).(GetDomainNameEndpointConfigurationArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupDomainNameResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupDomainNameResult) string { return v.Id }).(pulumi.StringOutput)
}
// ARN for an AWS-managed certificate that is used for validating the regional domain name.
func (o LookupDomainNameResultOutput) RegionalCertificateArn() pulumi.StringOutput {
return o.ApplyT(func(v LookupDomainNameResult) string { return v.RegionalCertificateArn }).(pulumi.StringOutput)
}
// User-friendly name of the certificate that is used by regional endpoint for this domain name.
func (o LookupDomainNameResultOutput) RegionalCertificateName() pulumi.StringOutput {
return o.ApplyT(func(v LookupDomainNameResult) string { return v.RegionalCertificateName }).(pulumi.StringOutput)
}
// Hostname for the custom domain's regional endpoint.
func (o LookupDomainNameResultOutput) RegionalDomainName() pulumi.StringOutput {
return o.ApplyT(func(v LookupDomainNameResult) string { return v.RegionalDomainName }).(pulumi.StringOutput)
}
// Hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
func (o LookupDomainNameResultOutput) RegionalZoneId() pulumi.StringOutput {
return o.ApplyT(func(v LookupDomainNameResult) string { return v.RegionalZoneId }).(pulumi.StringOutput)
}
// Security policy for the domain name.
func (o LookupDomainNameResultOutput) SecurityPolicy() pulumi.StringOutput {
return o.ApplyT(func(v LookupDomainNameResult) string { return v.SecurityPolicy }).(pulumi.StringOutput)
}
// Key-value map of tags for the resource.
func (o LookupDomainNameResultOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupDomainNameResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(LookupDomainNameResultOutput{})
}