github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/apigateway/getDomainName.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package apigateway 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Use this data source to get the custom domain name for use with AWS API Gateway. 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigateway" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // _, err := apigateway.LookupDomainName(ctx, &apigateway.LookupDomainNameArgs{ 32 // DomainName: "api.example.com", 33 // }, nil) 34 // if err != nil { 35 // return err 36 // } 37 // return nil 38 // }) 39 // } 40 // 41 // ``` 42 // <!--End PulumiCodeChooser --> 43 func LookupDomainName(ctx *pulumi.Context, args *LookupDomainNameArgs, opts ...pulumi.InvokeOption) (*LookupDomainNameResult, error) { 44 opts = internal.PkgInvokeDefaultOpts(opts) 45 var rv LookupDomainNameResult 46 err := ctx.Invoke("aws:apigateway/getDomainName:getDomainName", args, &rv, opts...) 47 if err != nil { 48 return nil, err 49 } 50 return &rv, nil 51 } 52 53 // A collection of arguments for invoking getDomainName. 54 type LookupDomainNameArgs struct { 55 // Fully-qualified domain name to look up. If no domain name is found, an error will be returned. 56 DomainName string `pulumi:"domainName"` 57 // Key-value map of tags for the resource. 58 Tags map[string]string `pulumi:"tags"` 59 } 60 61 // A collection of values returned by getDomainName. 62 type LookupDomainNameResult struct { 63 // ARN of the found custom domain name. 64 Arn string `pulumi:"arn"` 65 // ARN for an AWS-managed certificate that is used by edge-optimized endpoint for this domain name. 66 CertificateArn string `pulumi:"certificateArn"` 67 // Name of the certificate that is used by edge-optimized endpoint for this domain name. 68 CertificateName string `pulumi:"certificateName"` 69 // Upload date associated with the domain certificate. 70 CertificateUploadDate string `pulumi:"certificateUploadDate"` 71 // Hostname created by Cloudfront to represent the distribution that implements this domain name mapping. 72 CloudfrontDomainName string `pulumi:"cloudfrontDomainName"` 73 // For convenience, the hosted zone ID (`Z2FDTNDATAQYW2`) that can be used to create a Route53 alias record for the distribution. 74 CloudfrontZoneId string `pulumi:"cloudfrontZoneId"` 75 DomainName string `pulumi:"domainName"` 76 // List of objects with the endpoint configuration of this domain name. 77 EndpointConfigurations []GetDomainNameEndpointConfiguration `pulumi:"endpointConfigurations"` 78 // The provider-assigned unique ID for this managed resource. 79 Id string `pulumi:"id"` 80 // ARN for an AWS-managed certificate that is used for validating the regional domain name. 81 RegionalCertificateArn string `pulumi:"regionalCertificateArn"` 82 // User-friendly name of the certificate that is used by regional endpoint for this domain name. 83 RegionalCertificateName string `pulumi:"regionalCertificateName"` 84 // Hostname for the custom domain's regional endpoint. 85 RegionalDomainName string `pulumi:"regionalDomainName"` 86 // Hosted zone ID that can be used to create a Route53 alias record for the regional endpoint. 87 RegionalZoneId string `pulumi:"regionalZoneId"` 88 // Security policy for the domain name. 89 SecurityPolicy string `pulumi:"securityPolicy"` 90 // Key-value map of tags for the resource. 91 Tags map[string]string `pulumi:"tags"` 92 } 93 94 func LookupDomainNameOutput(ctx *pulumi.Context, args LookupDomainNameOutputArgs, opts ...pulumi.InvokeOption) LookupDomainNameResultOutput { 95 return pulumi.ToOutputWithContext(context.Background(), args). 96 ApplyT(func(v interface{}) (LookupDomainNameResult, error) { 97 args := v.(LookupDomainNameArgs) 98 r, err := LookupDomainName(ctx, &args, opts...) 99 var s LookupDomainNameResult 100 if r != nil { 101 s = *r 102 } 103 return s, err 104 }).(LookupDomainNameResultOutput) 105 } 106 107 // A collection of arguments for invoking getDomainName. 108 type LookupDomainNameOutputArgs struct { 109 // Fully-qualified domain name to look up. If no domain name is found, an error will be returned. 110 DomainName pulumi.StringInput `pulumi:"domainName"` 111 // Key-value map of tags for the resource. 112 Tags pulumi.StringMapInput `pulumi:"tags"` 113 } 114 115 func (LookupDomainNameOutputArgs) ElementType() reflect.Type { 116 return reflect.TypeOf((*LookupDomainNameArgs)(nil)).Elem() 117 } 118 119 // A collection of values returned by getDomainName. 120 type LookupDomainNameResultOutput struct{ *pulumi.OutputState } 121 122 func (LookupDomainNameResultOutput) ElementType() reflect.Type { 123 return reflect.TypeOf((*LookupDomainNameResult)(nil)).Elem() 124 } 125 126 func (o LookupDomainNameResultOutput) ToLookupDomainNameResultOutput() LookupDomainNameResultOutput { 127 return o 128 } 129 130 func (o LookupDomainNameResultOutput) ToLookupDomainNameResultOutputWithContext(ctx context.Context) LookupDomainNameResultOutput { 131 return o 132 } 133 134 // ARN of the found custom domain name. 135 func (o LookupDomainNameResultOutput) Arn() pulumi.StringOutput { 136 return o.ApplyT(func(v LookupDomainNameResult) string { return v.Arn }).(pulumi.StringOutput) 137 } 138 139 // ARN for an AWS-managed certificate that is used by edge-optimized endpoint for this domain name. 140 func (o LookupDomainNameResultOutput) CertificateArn() pulumi.StringOutput { 141 return o.ApplyT(func(v LookupDomainNameResult) string { return v.CertificateArn }).(pulumi.StringOutput) 142 } 143 144 // Name of the certificate that is used by edge-optimized endpoint for this domain name. 145 func (o LookupDomainNameResultOutput) CertificateName() pulumi.StringOutput { 146 return o.ApplyT(func(v LookupDomainNameResult) string { return v.CertificateName }).(pulumi.StringOutput) 147 } 148 149 // Upload date associated with the domain certificate. 150 func (o LookupDomainNameResultOutput) CertificateUploadDate() pulumi.StringOutput { 151 return o.ApplyT(func(v LookupDomainNameResult) string { return v.CertificateUploadDate }).(pulumi.StringOutput) 152 } 153 154 // Hostname created by Cloudfront to represent the distribution that implements this domain name mapping. 155 func (o LookupDomainNameResultOutput) CloudfrontDomainName() pulumi.StringOutput { 156 return o.ApplyT(func(v LookupDomainNameResult) string { return v.CloudfrontDomainName }).(pulumi.StringOutput) 157 } 158 159 // For convenience, the hosted zone ID (`Z2FDTNDATAQYW2`) that can be used to create a Route53 alias record for the distribution. 160 func (o LookupDomainNameResultOutput) CloudfrontZoneId() pulumi.StringOutput { 161 return o.ApplyT(func(v LookupDomainNameResult) string { return v.CloudfrontZoneId }).(pulumi.StringOutput) 162 } 163 164 func (o LookupDomainNameResultOutput) DomainName() pulumi.StringOutput { 165 return o.ApplyT(func(v LookupDomainNameResult) string { return v.DomainName }).(pulumi.StringOutput) 166 } 167 168 // List of objects with the endpoint configuration of this domain name. 169 func (o LookupDomainNameResultOutput) EndpointConfigurations() GetDomainNameEndpointConfigurationArrayOutput { 170 return o.ApplyT(func(v LookupDomainNameResult) []GetDomainNameEndpointConfiguration { return v.EndpointConfigurations }).(GetDomainNameEndpointConfigurationArrayOutput) 171 } 172 173 // The provider-assigned unique ID for this managed resource. 174 func (o LookupDomainNameResultOutput) Id() pulumi.StringOutput { 175 return o.ApplyT(func(v LookupDomainNameResult) string { return v.Id }).(pulumi.StringOutput) 176 } 177 178 // ARN for an AWS-managed certificate that is used for validating the regional domain name. 179 func (o LookupDomainNameResultOutput) RegionalCertificateArn() pulumi.StringOutput { 180 return o.ApplyT(func(v LookupDomainNameResult) string { return v.RegionalCertificateArn }).(pulumi.StringOutput) 181 } 182 183 // User-friendly name of the certificate that is used by regional endpoint for this domain name. 184 func (o LookupDomainNameResultOutput) RegionalCertificateName() pulumi.StringOutput { 185 return o.ApplyT(func(v LookupDomainNameResult) string { return v.RegionalCertificateName }).(pulumi.StringOutput) 186 } 187 188 // Hostname for the custom domain's regional endpoint. 189 func (o LookupDomainNameResultOutput) RegionalDomainName() pulumi.StringOutput { 190 return o.ApplyT(func(v LookupDomainNameResult) string { return v.RegionalDomainName }).(pulumi.StringOutput) 191 } 192 193 // Hosted zone ID that can be used to create a Route53 alias record for the regional endpoint. 194 func (o LookupDomainNameResultOutput) RegionalZoneId() pulumi.StringOutput { 195 return o.ApplyT(func(v LookupDomainNameResult) string { return v.RegionalZoneId }).(pulumi.StringOutput) 196 } 197 198 // Security policy for the domain name. 199 func (o LookupDomainNameResultOutput) SecurityPolicy() pulumi.StringOutput { 200 return o.ApplyT(func(v LookupDomainNameResult) string { return v.SecurityPolicy }).(pulumi.StringOutput) 201 } 202 203 // Key-value map of tags for the resource. 204 func (o LookupDomainNameResultOutput) Tags() pulumi.StringMapOutput { 205 return o.ApplyT(func(v LookupDomainNameResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput) 206 } 207 208 func init() { 209 pulumi.RegisterOutputType(LookupDomainNameResultOutput{}) 210 }