AWS v7.10.0 published on Friday, Oct 24, 2025 by Pulumi
aws.apigateway.getDomainName
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/v7/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,
region: 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,
region: 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:
- Domain
Name string - Fully-qualified domain name to look up. If no domain name is found, an error will be returned.
- Domain
Name stringId - The identifier for the domain name resource. Supported only for private custom domain names.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Dictionary<string, string>
- Key-value map of tags for the resource.
- Domain
Name string - Fully-qualified domain name to look up. If no domain name is found, an error will be returned.
- Domain
Name stringId - The identifier for the domain name resource. Supported only for private custom domain names.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- map[string]string
- Key-value map of tags for the resource.
- domain
Name String - Fully-qualified domain name to look up. If no domain name is found, an error will be returned.
- domain
Name StringId - The identifier for the domain name resource. Supported only for private custom domain names.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Map<String,String>
- Key-value map of tags for the resource.
- domain
Name string - Fully-qualified domain name to look up. If no domain name is found, an error will be returned.
- domain
Name stringId - The identifier for the domain name resource. Supported only for private custom domain names.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- {[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.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Mapping[str, str]
- Key-value map of tags for the resource.
- domain
Name String - Fully-qualified domain name to look up. If no domain name is found, an error will be returned.
- domain
Name StringId - The identifier for the domain name resource. Supported only for private custom domain names.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- 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.
- Certificate
Arn string - ARN for an AWS-managed certificate that is used by edge-optimized endpoint for this domain name.
- Certificate
Name string - Name of the certificate that is used by edge-optimized endpoint for this domain name.
- Certificate
Upload stringDate - Upload date associated with the domain certificate.
- Cloudfront
Domain stringName - Hostname created by Cloudfront to represent the distribution that implements this domain name mapping.
- Cloudfront
Zone stringId - For convenience, the hosted zone ID (
Z2FDTNDATAQYW2) that can be used to create a Route53 alias record for the distribution. - Domain
Name string - Domain
Name stringId - Endpoint
Configurations 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.
- Region string
- Regional
Certificate stringArn - ARN for an AWS-managed certificate that is used for validating the regional domain name.
- Regional
Certificate stringName - User-friendly name of the certificate that is used by regional endpoint for this domain name.
- Regional
Domain stringName - Hostname for the custom domain's regional endpoint.
- Regional
Zone stringId - Hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
- Security
Policy 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.
- Certificate
Arn string - ARN for an AWS-managed certificate that is used by edge-optimized endpoint for this domain name.
- Certificate
Name string - Name of the certificate that is used by edge-optimized endpoint for this domain name.
- Certificate
Upload stringDate - Upload date associated with the domain certificate.
- Cloudfront
Domain stringName - Hostname created by Cloudfront to represent the distribution that implements this domain name mapping.
- Cloudfront
Zone stringId - For convenience, the hosted zone ID (
Z2FDTNDATAQYW2) that can be used to create a Route53 alias record for the distribution. - Domain
Name string - Domain
Name stringId - Endpoint
Configurations []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.
- Region string
- Regional
Certificate stringArn - ARN for an AWS-managed certificate that is used for validating the regional domain name.
- Regional
Certificate stringName - User-friendly name of the certificate that is used by regional endpoint for this domain name.
- Regional
Domain stringName - Hostname for the custom domain's regional endpoint.
- Regional
Zone stringId - Hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
- Security
Policy 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.
- certificate
Arn String - ARN for an AWS-managed certificate that is used by edge-optimized endpoint for this domain name.
- certificate
Name String - Name of the certificate that is used by edge-optimized endpoint for this domain name.
- certificate
Upload StringDate - Upload date associated with the domain certificate.
- cloudfront
Domain StringName - Hostname created by Cloudfront to represent the distribution that implements this domain name mapping.
- cloudfront
Zone StringId - For convenience, the hosted zone ID (
Z2FDTNDATAQYW2) that can be used to create a Route53 alias record for the distribution. - domain
Name String - domain
Name StringId - endpoint
Configurations 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.
- region String
- regional
Certificate StringArn - ARN for an AWS-managed certificate that is used for validating the regional domain name.
- regional
Certificate StringName - User-friendly name of the certificate that is used by regional endpoint for this domain name.
- regional
Domain StringName - Hostname for the custom domain's regional endpoint.
- regional
Zone StringId - Hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
- security
Policy 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.
- certificate
Arn string - ARN for an AWS-managed certificate that is used by edge-optimized endpoint for this domain name.
- certificate
Name string - Name of the certificate that is used by edge-optimized endpoint for this domain name.
- certificate
Upload stringDate - Upload date associated with the domain certificate.
- cloudfront
Domain stringName - Hostname created by Cloudfront to represent the distribution that implements this domain name mapping.
- cloudfront
Zone stringId - For convenience, the hosted zone ID (
Z2FDTNDATAQYW2) that can be used to create a Route53 alias record for the distribution. - domain
Name string - domain
Name stringId - endpoint
Configurations 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.
- region string
- regional
Certificate stringArn - ARN for an AWS-managed certificate that is used for validating the regional domain name.
- regional
Certificate stringName - User-friendly name of the certificate that is used by regional endpoint for this domain name.
- regional
Domain stringName - Hostname for the custom domain's regional endpoint.
- regional
Zone stringId - Hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
- security
Policy 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.
- region str
- 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.
- certificate
Arn String - ARN for an AWS-managed certificate that is used by edge-optimized endpoint for this domain name.
- certificate
Name String - Name of the certificate that is used by edge-optimized endpoint for this domain name.
- certificate
Upload StringDate - Upload date associated with the domain certificate.
- cloudfront
Domain StringName - Hostname created by Cloudfront to represent the distribution that implements this domain name mapping.
- cloudfront
Zone StringId - For convenience, the hosted zone ID (
Z2FDTNDATAQYW2) that can be used to create a Route53 alias record for the distribution. - domain
Name String - domain
Name StringId - endpoint
Configurations 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.
- region String
- regional
Certificate StringArn - ARN for an AWS-managed certificate that is used for validating the regional domain name.
- regional
Certificate StringName - User-friendly name of the certificate that is used by regional endpoint for this domain name.
- regional
Domain StringName - Hostname for the custom domain's regional endpoint.
- regional
Zone StringId - Hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
- security
Policy String - Security policy for the domain name.
- Map<String>
- Key-value map of tags for the resource.
Supporting Types
GetDomainNameEndpointConfiguration
- Ip
Address stringType - The IP address types that can invoke an API (RestApi).
- Types List<string>
- List of endpoint types.
- Ip
Address stringType - The IP address types that can invoke an API (RestApi).
- Types []string
- List of endpoint types.
- ip
Address StringType - The IP address types that can invoke an API (RestApi).
- types List<String>
- List of endpoint types.
- ip
Address stringType - The IP address types that can invoke an API (RestApi).
- types string[]
- List of endpoint types.
- ip_
address_ strtype - The IP address types that can invoke an API (RestApi).
- types Sequence[str]
- List of endpoint types.
- ip
Address StringType - The IP address types that can invoke an API (RestApi).
- 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.
