AWS v6.73.0 published on Wednesday, Mar 19, 2025 by Pulumi
aws.apigateway.getDomainName
Explore with Pulumi AI
Use this data source to get the custom domain name for use with AWS API Gateway.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.apigateway.getDomainName({
    domainName: "api.example.com",
});
import pulumi
import pulumi_aws as aws
example = aws.apigateway.get_domain_name(domain_name="api.example.com")
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/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
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var example = Aws.ApiGateway.GetDomainName.Invoke(new()
    {
        DomainName = "api.example.com",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigateway.ApigatewayFunctions;
import com.pulumi.aws.apigateway.inputs.GetDomainNameArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var example = ApigatewayFunctions.getDomainName(GetDomainNameArgs.builder()
            .domainName("api.example.com")
            .build());
    }
}
variables:
  example:
    fn::invoke:
      function: aws:apigateway:getDomainName
      arguments:
        domainName: api.example.com
Using getDomainName
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getDomainName(args: GetDomainNameArgs, opts?: InvokeOptions): Promise<GetDomainNameResult>
function getDomainNameOutput(args: GetDomainNameOutputArgs, opts?: InvokeOptions): Output<GetDomainNameResult>def get_domain_name(domain_name: Optional[str] = None,
                    domain_name_id: Optional[str] = None,
                    tags: Optional[Mapping[str, str]] = None,
                    opts: Optional[InvokeOptions] = None) -> GetDomainNameResult
def get_domain_name_output(domain_name: Optional[pulumi.Input[str]] = None,
                    domain_name_id: Optional[pulumi.Input[str]] = None,
                    tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetDomainNameResult]func LookupDomainName(ctx *Context, args *LookupDomainNameArgs, opts ...InvokeOption) (*LookupDomainNameResult, error)
func LookupDomainNameOutput(ctx *Context, args *LookupDomainNameOutputArgs, opts ...InvokeOption) LookupDomainNameResultOutput> Note: This function is named LookupDomainName in the Go SDK.
public static class GetDomainName 
{
    public static Task<GetDomainNameResult> InvokeAsync(GetDomainNameArgs args, InvokeOptions? opts = null)
    public static Output<GetDomainNameResult> Invoke(GetDomainNameInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetDomainNameResult> getDomainName(GetDomainNameArgs args, InvokeOptions options)
public static Output<GetDomainNameResult> getDomainName(GetDomainNameArgs args, InvokeOptions options)
fn::invoke:
  function: aws:apigateway/getDomainName:getDomainName
  arguments:
    # arguments dictionaryThe following arguments are supported:
- DomainName string
- Fully-qualified domain name to look up. If no domain name is found, an error will be returned.
- DomainName stringId 
- The identifier for the domain name resource. Supported only for private custom domain names.
- Dictionary<string, string>
- Key-value map of tags for the resource.
- DomainName string
- Fully-qualified domain name to look up. If no domain name is found, an error will be returned.
- DomainName stringId 
- The identifier for the domain name resource. Supported only for private custom domain names.
- map[string]string
- Key-value map of tags for the resource.
- domainName String
- Fully-qualified domain name to look up. If no domain name is found, an error will be returned.
- domainName StringId 
- The identifier for the domain name resource. Supported only for private custom domain names.
- Map<String,String>
- Key-value map of tags for the resource.
- domainName string
- Fully-qualified domain name to look up. If no domain name is found, an error will be returned.
- domainName stringId 
- The identifier for the domain name resource. Supported only for private custom domain names.
- {[key: string]: string}
- Key-value map of tags for the resource.
- domain_name str
- Fully-qualified domain name to look up. If no domain name is found, an error will be returned.
- domain_name_ strid 
- The identifier for the domain name resource. Supported only for private custom domain names.
- Mapping[str, str]
- Key-value map of tags for the resource.
- domainName String
- Fully-qualified domain name to look up. If no domain name is found, an error will be returned.
- domainName StringId 
- The identifier for the domain name resource. Supported only for private custom domain names.
- Map<String>
- Key-value map of tags for the resource.
getDomainName Result
The following output properties are available:
- Arn string
- ARN of the found custom domain name.
- CertificateArn string
- ARN for an AWS-managed certificate that is used by edge-optimized endpoint for this domain name.
- CertificateName string
- Name of the certificate that is used by edge-optimized endpoint for this domain name.
- CertificateUpload stringDate 
- Upload date associated with the domain certificate.
- CloudfrontDomain stringName 
- Hostname created by Cloudfront to represent the distribution that implements this domain name mapping.
- CloudfrontZone stringId 
- For convenience, the hosted zone ID (Z2FDTNDATAQYW2) that can be used to create a Route53 alias record for the distribution.
- DomainName string
- DomainName stringId 
- EndpointConfigurations List<GetDomain Name Endpoint Configuration> 
- List of objects with the endpoint configuration of this domain name.
- Id string
- The provider-assigned unique ID for this managed resource.
- Policy string
- A stringified JSON policy document that applies to the execute-api service for this DomainName regardless of the caller and Method configuration. Supported only for private custom domain names.
- RegionalCertificate stringArn 
- ARN for an AWS-managed certificate that is used for validating the regional domain name.
- RegionalCertificate stringName 
- User-friendly name of the certificate that is used by regional endpoint for this domain name.
- RegionalDomain stringName 
- Hostname for the custom domain's regional endpoint.
- RegionalZone stringId 
- Hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
- SecurityPolicy string
- Security policy for the domain name.
- Dictionary<string, string>
- Key-value map of tags for the resource.
- Arn string
- ARN of the found custom domain name.
- CertificateArn string
- ARN for an AWS-managed certificate that is used by edge-optimized endpoint for this domain name.
- CertificateName string
- Name of the certificate that is used by edge-optimized endpoint for this domain name.
- CertificateUpload stringDate 
- Upload date associated with the domain certificate.
- CloudfrontDomain stringName 
- Hostname created by Cloudfront to represent the distribution that implements this domain name mapping.
- CloudfrontZone stringId 
- For convenience, the hosted zone ID (Z2FDTNDATAQYW2) that can be used to create a Route53 alias record for the distribution.
- DomainName string
- DomainName stringId 
- EndpointConfigurations []GetDomain Name Endpoint Configuration 
- List of objects with the endpoint configuration of this domain name.
- Id string
- The provider-assigned unique ID for this managed resource.
- Policy string
- A stringified JSON policy document that applies to the execute-api service for this DomainName regardless of the caller and Method configuration. Supported only for private custom domain names.
- RegionalCertificate stringArn 
- ARN for an AWS-managed certificate that is used for validating the regional domain name.
- RegionalCertificate stringName 
- User-friendly name of the certificate that is used by regional endpoint for this domain name.
- RegionalDomain stringName 
- Hostname for the custom domain's regional endpoint.
- RegionalZone stringId 
- Hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
- SecurityPolicy string
- Security policy for the domain name.
- map[string]string
- Key-value map of tags for the resource.
- arn String
- ARN of the found custom domain name.
- certificateArn String
- ARN for an AWS-managed certificate that is used by edge-optimized endpoint for this domain name.
- certificateName String
- Name of the certificate that is used by edge-optimized endpoint for this domain name.
- certificateUpload StringDate 
- Upload date associated with the domain certificate.
- cloudfrontDomain StringName 
- Hostname created by Cloudfront to represent the distribution that implements this domain name mapping.
- cloudfrontZone StringId 
- For convenience, the hosted zone ID (Z2FDTNDATAQYW2) that can be used to create a Route53 alias record for the distribution.
- domainName String
- domainName StringId 
- endpointConfigurations List<GetDomain Name Endpoint Configuration> 
- List of objects with the endpoint configuration of this domain name.
- id String
- The provider-assigned unique ID for this managed resource.
- policy String
- A stringified JSON policy document that applies to the execute-api service for this DomainName regardless of the caller and Method configuration. Supported only for private custom domain names.
- regionalCertificate StringArn 
- ARN for an AWS-managed certificate that is used for validating the regional domain name.
- regionalCertificate StringName 
- User-friendly name of the certificate that is used by regional endpoint for this domain name.
- regionalDomain StringName 
- Hostname for the custom domain's regional endpoint.
- regionalZone StringId 
- Hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
- securityPolicy String
- Security policy for the domain name.
- Map<String,String>
- Key-value map of tags for the resource.
- arn string
- ARN of the found custom domain name.
- certificateArn string
- ARN for an AWS-managed certificate that is used by edge-optimized endpoint for this domain name.
- certificateName string
- Name of the certificate that is used by edge-optimized endpoint for this domain name.
- certificateUpload stringDate 
- Upload date associated with the domain certificate.
- cloudfrontDomain stringName 
- Hostname created by Cloudfront to represent the distribution that implements this domain name mapping.
- cloudfrontZone stringId 
- For convenience, the hosted zone ID (Z2FDTNDATAQYW2) that can be used to create a Route53 alias record for the distribution.
- domainName string
- domainName stringId 
- endpointConfigurations GetDomain Name Endpoint Configuration[] 
- List of objects with the endpoint configuration of this domain name.
- id string
- The provider-assigned unique ID for this managed resource.
- policy string
- A stringified JSON policy document that applies to the execute-api service for this DomainName regardless of the caller and Method configuration. Supported only for private custom domain names.
- regionalCertificate stringArn 
- ARN for an AWS-managed certificate that is used for validating the regional domain name.
- regionalCertificate stringName 
- User-friendly name of the certificate that is used by regional endpoint for this domain name.
- regionalDomain stringName 
- Hostname for the custom domain's regional endpoint.
- regionalZone stringId 
- Hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
- securityPolicy string
- Security policy for the domain name.
- {[key: string]: string}
- Key-value map of tags for the resource.
- arn str
- ARN of the found custom domain name.
- certificate_arn str
- ARN for an AWS-managed certificate that is used by edge-optimized endpoint for this domain name.
- certificate_name str
- Name of the certificate that is used by edge-optimized endpoint for this domain name.
- certificate_upload_ strdate 
- Upload date associated with the domain certificate.
- cloudfront_domain_ strname 
- Hostname created by Cloudfront to represent the distribution that implements this domain name mapping.
- cloudfront_zone_ strid 
- For convenience, the hosted zone ID (Z2FDTNDATAQYW2) that can be used to create a Route53 alias record for the distribution.
- domain_name str
- domain_name_ strid 
- endpoint_configurations Sequence[GetDomain Name Endpoint Configuration] 
- List of objects with the endpoint configuration of this domain name.
- id str
- The provider-assigned unique ID for this managed resource.
- policy str
- A stringified JSON policy document that applies to the execute-api service for this DomainName regardless of the caller and Method configuration. Supported only for private custom domain names.
- regional_certificate_ strarn 
- ARN for an AWS-managed certificate that is used for validating the regional domain name.
- regional_certificate_ strname 
- User-friendly name of the certificate that is used by regional endpoint for this domain name.
- regional_domain_ strname 
- Hostname for the custom domain's regional endpoint.
- regional_zone_ strid 
- Hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
- security_policy str
- Security policy for the domain name.
- Mapping[str, str]
- Key-value map of tags for the resource.
- arn String
- ARN of the found custom domain name.
- certificateArn String
- ARN for an AWS-managed certificate that is used by edge-optimized endpoint for this domain name.
- certificateName String
- Name of the certificate that is used by edge-optimized endpoint for this domain name.
- certificateUpload StringDate 
- Upload date associated with the domain certificate.
- cloudfrontDomain StringName 
- Hostname created by Cloudfront to represent the distribution that implements this domain name mapping.
- cloudfrontZone StringId 
- For convenience, the hosted zone ID (Z2FDTNDATAQYW2) that can be used to create a Route53 alias record for the distribution.
- domainName String
- domainName StringId 
- endpointConfigurations List<Property Map>
- List of objects with the endpoint configuration of this domain name.
- id String
- The provider-assigned unique ID for this managed resource.
- policy String
- A stringified JSON policy document that applies to the execute-api service for this DomainName regardless of the caller and Method configuration. Supported only for private custom domain names.
- regionalCertificate StringArn 
- ARN for an AWS-managed certificate that is used for validating the regional domain name.
- regionalCertificate StringName 
- User-friendly name of the certificate that is used by regional endpoint for this domain name.
- regionalDomain StringName 
- Hostname for the custom domain's regional endpoint.
- regionalZone StringId 
- Hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
- securityPolicy String
- Security policy for the domain name.
- Map<String>
- Key-value map of tags for the resource.
Supporting Types
GetDomainNameEndpointConfiguration    
- Types List<string>
- List of endpoint types.
- Types []string
- List of endpoint types.
- types List<String>
- List of endpoint types.
- types string[]
- List of endpoint types.
- types Sequence[str]
- List of endpoint types.
- types List<String>
- List of endpoint types.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.