DomainName
Registers a custom domain name for use with AWS API Gateway. Additional information about this functionality can be found in the API Gateway Developer Guide.
This resource just establishes ownership of and the TLS settings for
a particular domain name. An API can be attached to a particular path
under the registered domain name using
the aws.apigateway.BasePathMapping resource.
API Gateway domains can be defined as either ‘edge-optimized’ or ‘regional’. In an edge-optimized configuration,
API Gateway internally creates and manages a CloudFront distribution to route requests on the given hostname. In
addition to this resource it’s necessary to create a DNS record corresponding to the given domain name which is an alias
(either Route53 alias or traditional CNAME) to the Cloudfront domain name exported in the cloudfront_domain_name
attribute.
In a regional configuration, API Gateway does not create a CloudFront distribution to route requests to the API, though
a distribution can be created if needed. In either case, it is necessary to create a DNS record corresponding to the
given domain name which is an alias (either Route53 alias or traditional CNAME) to the regional domain name exported in
the regional_domain_name attribute.
Note: API Gateway requires the use of AWS Certificate Manager (ACM) certificates instead of Identity and Access Management (IAM) certificates in regions that support ACM. Regions that support ACM can be found in the Regions and Endpoints Documentation. To import an existing private key and certificate into ACM or request an ACM certificate, see the
aws.acm.Certificateresource.Note: The
aws.apigateway.DomainNameresource expects dependency on theaws.acm.CertificateValidationas only verified certificates can be used. This can be made either explicitly by adding thedepends_on = [aws_acm_certificate_validation.cert]attribute. Or implicitly by referring certificate ARN from the validation resource where it will be available after the resource creation:regional_certificate_arn = aws_acm_certificate_validation.cert.certificate_arn.Note: All arguments including the private key will be stored in the raw state as plain-text.
Example Usage
Edge Optimized (ACM Certificate)
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var exampleDomainName = new Aws.ApiGateway.DomainName("exampleDomainName", new Aws.ApiGateway.DomainNameArgs
{
CertificateArn = aws_acm_certificate_validation.Example.Certificate_arn,
DomainName = "api.example.com",
});
// Example DNS record using Route53.
// Route53 is not specifically required; any DNS host can be used.
var exampleRecord = new Aws.Route53.Record("exampleRecord", new Aws.Route53.RecordArgs
{
Aliases =
{
new Aws.Route53.Inputs.RecordAliasArgs
{
EvaluateTargetHealth = true,
Name = exampleDomainName.CloudfrontDomainName,
ZoneId = exampleDomainName.CloudfrontZoneId,
},
},
Name = exampleDomainName.Domain,
Type = "A",
ZoneId = aws_route53_zone.Example.Id,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/apigateway"
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/route53"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleDomainName, err := apigateway.NewDomainName(ctx, "exampleDomainName", &apigateway.DomainNameArgs{
CertificateArn: pulumi.String(aws_acm_certificate_validation.Example.Certificate_arn),
DomainName: pulumi.String("api.example.com"),
})
if err != nil {
return err
}
_, err = route53.NewRecord(ctx, "exampleRecord", &route53.RecordArgs{
Aliases: route53.RecordAliasArray{
&route53.RecordAliasArgs{
EvaluateTargetHealth: pulumi.Bool(true),
Name: exampleDomainName.CloudfrontDomainName,
ZoneId: exampleDomainName.CloudfrontZoneId,
},
},
Name: exampleDomainName.DomainName,
Type: pulumi.String("A"),
ZoneId: pulumi.String(aws_route53_zone.Example.Id),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
example_domain_name = aws.apigateway.DomainName("exampleDomainName",
certificate_arn=aws_acm_certificate_validation["example"]["certificate_arn"],
domain_name="api.example.com")
# Example DNS record using Route53.
# Route53 is not specifically required; any DNS host can be used.
example_record = aws.route53.Record("exampleRecord",
aliases=[{
"evaluateTargetHealth": True,
"name": example_domain_name.cloudfront_domain_name,
"zone_id": example_domain_name.cloudfront_zone_id,
}],
name=example_domain_name.domain_name,
type="A",
zone_id=aws_route53_zone["example"]["id"])import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const exampleDomainName = new aws.apigateway.DomainName("example", {
certificateArn: aws_acm_certificate_validation_example.certificateArn,
domainName: "api.example.com",
});
// Example DNS record using Route53.
// Route53 is not specifically required; any DNS host can be used.
const exampleRecord = new aws.route53.Record("example", {
aliases: [{
evaluateTargetHealth: true,
name: exampleDomainName.cloudfrontDomainName,
zoneId: exampleDomainName.cloudfrontZoneId,
}],
name: exampleDomainName.domainName,
type: "A",
zoneId: aws_route53_zone_example.id,
});Edge Optimized (IAM Certificate)
using System.IO;
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var exampleDomainName = new Aws.ApiGateway.DomainName("exampleDomainName", new Aws.ApiGateway.DomainNameArgs
{
CertificateBody = File.ReadAllText($"{path.Module}/example.com/example.crt"),
CertificateChain = File.ReadAllText($"{path.Module}/example.com/ca.crt"),
CertificateName = "example-api",
CertificatePrivateKey = File.ReadAllText($"{path.Module}/example.com/example.key"),
DomainName = "api.example.com",
});
// Example DNS record using Route53.
// Route53 is not specifically required; any DNS host can be used.
var exampleRecord = new Aws.Route53.Record("exampleRecord", new Aws.Route53.RecordArgs
{
Aliases =
{
new Aws.Route53.Inputs.RecordAliasArgs
{
EvaluateTargetHealth = true,
Name = exampleDomainName.CloudfrontDomainName,
ZoneId = exampleDomainName.CloudfrontZoneId,
},
},
Name = exampleDomainName.Domain,
Type = "A",
ZoneId = aws_route53_zone.Example.Id,
});
// See aws_route53_zone for how to create this
}
}
Coming soon!
import pulumi
import pulumi_aws as aws
example_domain_name = aws.apigateway.DomainName("exampleDomainName",
certificate_body=(lambda path: open(path).read())(f"{path['module']}/example.com/example.crt"),
certificate_chain=(lambda path: open(path).read())(f"{path['module']}/example.com/ca.crt"),
certificate_name="example-api",
certificate_private_key=(lambda path: open(path).read())(f"{path['module']}/example.com/example.key"),
domain_name="api.example.com")
# Example DNS record using Route53.
# Route53 is not specifically required; any DNS host can be used.
example_record = aws.route53.Record("exampleRecord",
aliases=[{
"evaluateTargetHealth": True,
"name": example_domain_name.cloudfront_domain_name,
"zone_id": example_domain_name.cloudfront_zone_id,
}],
name=example_domain_name.domain_name,
type="A",
zone_id=aws_route53_zone["example"]["id"])
# See aws_route53_zone for how to create thisimport * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as fs from "fs";
const exampleDomainName = new aws.apigateway.DomainName("example", {
certificateBody: fs.readFileSync(`./example.com/example.crt`, "utf-8"),
certificateChain: fs.readFileSync(`./example.com/ca.crt`, "utf-8"),
certificateName: "example-api",
certificatePrivateKey: fs.readFileSync(`./example.com/example.key`, "utf-8"),
domainName: "api.example.com",
});
// Example DNS record using Route53.
// Route53 is not specifically required; any DNS host can be used.
const exampleRecord = new aws.route53.Record("example", {
aliases: [{
evaluateTargetHealth: true,
name: exampleDomainName.cloudfrontDomainName,
zoneId: exampleDomainName.cloudfrontZoneId,
}],
name: exampleDomainName.domainName,
type: "A",
zoneId: aws_route53_zone_example.id, // See aws_route53_zone for how to create this
});Regional (ACM Certificate)
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var exampleDomainName = new Aws.ApiGateway.DomainName("exampleDomainName", new Aws.ApiGateway.DomainNameArgs
{
DomainName = "api.example.com",
EndpointConfiguration = new Aws.ApiGateway.Inputs.DomainNameEndpointConfigurationArgs
{
Types = "REGIONAL",
},
RegionalCertificateArn = aws_acm_certificate_validation.Example.Certificate_arn,
});
// Example DNS record using Route53.
// Route53 is not specifically required; any DNS host can be used.
var exampleRecord = new Aws.Route53.Record("exampleRecord", new Aws.Route53.RecordArgs
{
Aliases =
{
new Aws.Route53.Inputs.RecordAliasArgs
{
EvaluateTargetHealth = true,
Name = exampleDomainName.RegionalDomainName,
ZoneId = exampleDomainName.RegionalZoneId,
},
},
Name = exampleDomainName.Domain,
Type = "A",
ZoneId = aws_route53_zone.Example.Id,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/apigateway"
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/route53"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleDomainName, err := apigateway.NewDomainName(ctx, "exampleDomainName", &apigateway.DomainNameArgs{
DomainName: pulumi.String("api.example.com"),
EndpointConfiguration: &apigateway.DomainNameEndpointConfigurationArgs{
Types: pulumi.String("REGIONAL"),
},
RegionalCertificateArn: pulumi.String(aws_acm_certificate_validation.Example.Certificate_arn),
})
if err != nil {
return err
}
_, err = route53.NewRecord(ctx, "exampleRecord", &route53.RecordArgs{
Aliases: route53.RecordAliasArray{
&route53.RecordAliasArgs{
EvaluateTargetHealth: pulumi.Bool(true),
Name: exampleDomainName.RegionalDomainName,
ZoneId: exampleDomainName.RegionalZoneId,
},
},
Name: exampleDomainName.DomainName,
Type: pulumi.String("A"),
ZoneId: pulumi.String(aws_route53_zone.Example.Id),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
example_domain_name = aws.apigateway.DomainName("exampleDomainName",
domain_name="api.example.com",
endpoint_configuration={
"types": "REGIONAL",
},
regional_certificate_arn=aws_acm_certificate_validation["example"]["certificate_arn"])
# Example DNS record using Route53.
# Route53 is not specifically required; any DNS host can be used.
example_record = aws.route53.Record("exampleRecord",
aliases=[{
"evaluateTargetHealth": True,
"name": example_domain_name.regional_domain_name,
"zone_id": example_domain_name.regional_zone_id,
}],
name=example_domain_name.domain_name,
type="A",
zone_id=aws_route53_zone["example"]["id"])import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const exampleDomainName = new aws.apigateway.DomainName("example", {
domainName: "api.example.com",
endpointConfiguration: {
types: "REGIONAL",
},
regionalCertificateArn: aws_acm_certificate_validation_example.certificateArn,
});
// Example DNS record using Route53.
// Route53 is not specifically required; any DNS host can be used.
const exampleRecord = new aws.route53.Record("example", {
aliases: [{
evaluateTargetHealth: true,
name: exampleDomainName.regionalDomainName,
zoneId: exampleDomainName.regionalZoneId,
}],
name: exampleDomainName.domainName,
type: "A",
zoneId: aws_route53_zone_example.id,
});Regional (IAM Certificate)
using System.IO;
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var exampleDomainName = new Aws.ApiGateway.DomainName("exampleDomainName", new Aws.ApiGateway.DomainNameArgs
{
CertificateBody = File.ReadAllText($"{path.Module}/example.com/example.crt"),
CertificateChain = File.ReadAllText($"{path.Module}/example.com/ca.crt"),
CertificatePrivateKey = File.ReadAllText($"{path.Module}/example.com/example.key"),
DomainName = "api.example.com",
EndpointConfiguration = new Aws.ApiGateway.Inputs.DomainNameEndpointConfigurationArgs
{
Types = "REGIONAL",
},
RegionalCertificateName = "example-api",
});
// Example DNS record using Route53.
// Route53 is not specifically required; any DNS host can be used.
var exampleRecord = new Aws.Route53.Record("exampleRecord", new Aws.Route53.RecordArgs
{
Aliases =
{
new Aws.Route53.Inputs.RecordAliasArgs
{
EvaluateTargetHealth = true,
Name = exampleDomainName.RegionalDomainName,
ZoneId = exampleDomainName.RegionalZoneId,
},
},
Name = exampleDomainName.Domain,
Type = "A",
ZoneId = aws_route53_zone.Example.Id,
});
}
}
Coming soon!
import pulumi
import pulumi_aws as aws
example_domain_name = aws.apigateway.DomainName("exampleDomainName",
certificate_body=(lambda path: open(path).read())(f"{path['module']}/example.com/example.crt"),
certificate_chain=(lambda path: open(path).read())(f"{path['module']}/example.com/ca.crt"),
certificate_private_key=(lambda path: open(path).read())(f"{path['module']}/example.com/example.key"),
domain_name="api.example.com",
endpoint_configuration={
"types": "REGIONAL",
},
regional_certificate_name="example-api")
# Example DNS record using Route53.
# Route53 is not specifically required; any DNS host can be used.
example_record = aws.route53.Record("exampleRecord",
aliases=[{
"evaluateTargetHealth": True,
"name": example_domain_name.regional_domain_name,
"zone_id": example_domain_name.regional_zone_id,
}],
name=example_domain_name.domain_name,
type="A",
zone_id=aws_route53_zone["example"]["id"])import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as fs from "fs";
const exampleDomainName = new aws.apigateway.DomainName("example", {
certificateBody: fs.readFileSync(`./example.com/example.crt`, "utf-8"),
certificateChain: fs.readFileSync(`./example.com/ca.crt`, "utf-8"),
certificatePrivateKey: fs.readFileSync(`./example.com/example.key`, "utf-8"),
domainName: "api.example.com",
endpointConfiguration: {
types: "REGIONAL",
},
regionalCertificateName: "example-api",
});
// Example DNS record using Route53.
// Route53 is not specifically required; any DNS host can be used.
const exampleRecord = new aws.route53.Record("example", {
aliases: [{
evaluateTargetHealth: true,
name: exampleDomainName.regionalDomainName,
zoneId: exampleDomainName.regionalZoneId,
}],
name: exampleDomainName.domainName,
type: "A",
zoneId: aws_route53_zone_example.id,
});Create a DomainName Resource
new DomainName(name: string, args: DomainNameArgs, opts?: CustomResourceOptions);def DomainName(resource_name, opts=None, certificate_arn=None, certificate_body=None, certificate_chain=None, certificate_name=None, certificate_private_key=None, domain_name=None, endpoint_configuration=None, regional_certificate_arn=None, regional_certificate_name=None, security_policy=None, tags=None, __props__=None);func NewDomainName(ctx *Context, name string, args DomainNameArgs, opts ...ResourceOption) (*DomainName, error)public DomainName(string name, DomainNameArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args DomainNameArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DomainNameArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DomainNameArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
DomainName Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The DomainName resource accepts the following input properties:
- Domain string
The fully-qualified domain name to register
- Certificate
Arn string The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when an edge-optimized domain name is desired. Conflicts with
certificate_name,certificate_body,certificate_chain,certificate_private_key,regional_certificate_arn, andregional_certificate_name.- Certificate
Body string The certificate issued for the domain name being registered, in PEM format. Only valid for
EDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- Certificate
Chain string The certificate for the CA that issued the certificate, along with any intermediate CA certificates required to create an unbroken chain to a certificate trusted by the intended API clients. Only valid for
EDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- Certificate
Name string The unique name to use when registering this certificate as an IAM server certificate. Conflicts with
certificate_arn,regional_certificate_arn, andregional_certificate_name. Required ifcertificate_arnis not set.- Certificate
Private stringKey The private key associated with the domain certificate given in
certificate_body. Only valid forEDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- Endpoint
Configuration DomainName Endpoint Configuration Args Configuration block defining API endpoint information including type. Defined below.
- Regional
Certificate stringArn The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when a regional domain name is desired. Conflicts with
certificate_arn,certificate_name,certificate_body,certificate_chain, andcertificate_private_key.- Regional
Certificate stringName The user-friendly name of the certificate that will be used by regional endpoint for this domain name. Conflicts with
certificate_arn,certificate_name,certificate_body,certificate_chain, andcertificate_private_key.- Security
Policy string The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are
TLS_1_0andTLS_1_2. Must be configured to perform drift detection.- Dictionary<string, string>
Key-value map of resource tags
- Domain
Name string The fully-qualified domain name to register
- Certificate
Arn string The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when an edge-optimized domain name is desired. Conflicts with
certificate_name,certificate_body,certificate_chain,certificate_private_key,regional_certificate_arn, andregional_certificate_name.- Certificate
Body string The certificate issued for the domain name being registered, in PEM format. Only valid for
EDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- Certificate
Chain string The certificate for the CA that issued the certificate, along with any intermediate CA certificates required to create an unbroken chain to a certificate trusted by the intended API clients. Only valid for
EDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- Certificate
Name string The unique name to use when registering this certificate as an IAM server certificate. Conflicts with
certificate_arn,regional_certificate_arn, andregional_certificate_name. Required ifcertificate_arnis not set.- Certificate
Private stringKey The private key associated with the domain certificate given in
certificate_body. Only valid forEDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- Endpoint
Configuration DomainName Endpoint Configuration Configuration block defining API endpoint information including type. Defined below.
- Regional
Certificate stringArn The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when a regional domain name is desired. Conflicts with
certificate_arn,certificate_name,certificate_body,certificate_chain, andcertificate_private_key.- Regional
Certificate stringName The user-friendly name of the certificate that will be used by regional endpoint for this domain name. Conflicts with
certificate_arn,certificate_name,certificate_body,certificate_chain, andcertificate_private_key.- Security
Policy string The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are
TLS_1_0andTLS_1_2. Must be configured to perform drift detection.- map[string]string
Key-value map of resource tags
- domain
Name string The fully-qualified domain name to register
- certificate
Arn string The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when an edge-optimized domain name is desired. Conflicts with
certificate_name,certificate_body,certificate_chain,certificate_private_key,regional_certificate_arn, andregional_certificate_name.- certificate
Body string The certificate issued for the domain name being registered, in PEM format. Only valid for
EDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- certificate
Chain string The certificate for the CA that issued the certificate, along with any intermediate CA certificates required to create an unbroken chain to a certificate trusted by the intended API clients. Only valid for
EDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- certificate
Name string The unique name to use when registering this certificate as an IAM server certificate. Conflicts with
certificate_arn,regional_certificate_arn, andregional_certificate_name. Required ifcertificate_arnis not set.- certificate
Private stringKey The private key associated with the domain certificate given in
certificate_body. Only valid forEDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- endpoint
Configuration DomainName Endpoint Configuration Configuration block defining API endpoint information including type. Defined below.
- regional
Certificate stringArn The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when a regional domain name is desired. Conflicts with
certificate_arn,certificate_name,certificate_body,certificate_chain, andcertificate_private_key.- regional
Certificate stringName The user-friendly name of the certificate that will be used by regional endpoint for this domain name. Conflicts with
certificate_arn,certificate_name,certificate_body,certificate_chain, andcertificate_private_key.- security
Policy string The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are
TLS_1_0andTLS_1_2. Must be configured to perform drift detection.- {[key: string]: string}
Key-value map of resource tags
- domain_
name str The fully-qualified domain name to register
- certificate_
arn str The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when an edge-optimized domain name is desired. Conflicts with
certificate_name,certificate_body,certificate_chain,certificate_private_key,regional_certificate_arn, andregional_certificate_name.- certificate_
body str The certificate issued for the domain name being registered, in PEM format. Only valid for
EDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- certificate_
chain str The certificate for the CA that issued the certificate, along with any intermediate CA certificates required to create an unbroken chain to a certificate trusted by the intended API clients. Only valid for
EDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- certificate_
name str The unique name to use when registering this certificate as an IAM server certificate. Conflicts with
certificate_arn,regional_certificate_arn, andregional_certificate_name. Required ifcertificate_arnis not set.- certificate_
private_ strkey The private key associated with the domain certificate given in
certificate_body. Only valid forEDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- endpoint_
configuration Dict[DomainName Endpoint Configuration] Configuration block defining API endpoint information including type. Defined below.
- regional_
certificate_ strarn The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when a regional domain name is desired. Conflicts with
certificate_arn,certificate_name,certificate_body,certificate_chain, andcertificate_private_key.- regional_
certificate_ strname The user-friendly name of the certificate that will be used by regional endpoint for this domain name. Conflicts with
certificate_arn,certificate_name,certificate_body,certificate_chain, andcertificate_private_key.- security_
policy str The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are
TLS_1_0andTLS_1_2. Must be configured to perform drift detection.- Dict[str, str]
Key-value map of resource tags
Outputs
All input properties are implicitly available as output properties. Additionally, the DomainName resource produces the following output properties:
- Arn string
Amazon Resource Name (ARN)
- Certificate
Upload stringDate The upload date associated with the domain certificate.
- Cloudfront
Domain stringName The 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.- Id string
- The provider-assigned unique ID for this managed resource.
- Regional
Domain stringName The hostname for the custom domain’s regional endpoint.
- Regional
Zone stringId The hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
- Arn string
Amazon Resource Name (ARN)
- Certificate
Upload stringDate The upload date associated with the domain certificate.
- Cloudfront
Domain stringName The 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.- Id string
- The provider-assigned unique ID for this managed resource.
- Regional
Domain stringName The hostname for the custom domain’s regional endpoint.
- Regional
Zone stringId The hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
- arn string
Amazon Resource Name (ARN)
- certificate
Upload stringDate The upload date associated with the domain certificate.
- cloudfront
Domain stringName The 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.- id string
- The provider-assigned unique ID for this managed resource.
- regional
Domain stringName The hostname for the custom domain’s regional endpoint.
- regional
Zone stringId The hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
- arn str
Amazon Resource Name (ARN)
- certificate_
upload_ strdate The upload date associated with the domain certificate.
- cloudfront_
domain_ strname The 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.- id str
- The provider-assigned unique ID for this managed resource.
- regional_
domain_ strname The hostname for the custom domain’s regional endpoint.
- regional_
zone_ strid The hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
Look up an Existing DomainName Resource
Get an existing DomainName resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: DomainNameState, opts?: CustomResourceOptions): DomainNamestatic get(resource_name, id, opts=None, arn=None, certificate_arn=None, certificate_body=None, certificate_chain=None, certificate_name=None, certificate_private_key=None, certificate_upload_date=None, cloudfront_domain_name=None, cloudfront_zone_id=None, domain_name=None, endpoint_configuration=None, regional_certificate_arn=None, regional_certificate_name=None, regional_domain_name=None, regional_zone_id=None, security_policy=None, tags=None, __props__=None);func GetDomainName(ctx *Context, name string, id IDInput, state *DomainNameState, opts ...ResourceOption) (*DomainName, error)public static DomainName Get(string name, Input<string> id, DomainNameState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Arn string
Amazon Resource Name (ARN)
- Certificate
Arn string The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when an edge-optimized domain name is desired. Conflicts with
certificate_name,certificate_body,certificate_chain,certificate_private_key,regional_certificate_arn, andregional_certificate_name.- Certificate
Body string The certificate issued for the domain name being registered, in PEM format. Only valid for
EDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- Certificate
Chain string The certificate for the CA that issued the certificate, along with any intermediate CA certificates required to create an unbroken chain to a certificate trusted by the intended API clients. Only valid for
EDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- Certificate
Name string The unique name to use when registering this certificate as an IAM server certificate. Conflicts with
certificate_arn,regional_certificate_arn, andregional_certificate_name. Required ifcertificate_arnis not set.- Certificate
Private stringKey The private key associated with the domain certificate given in
certificate_body. Only valid forEDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- Certificate
Upload stringDate The upload date associated with the domain certificate.
- Cloudfront
Domain stringName The 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 string
The fully-qualified domain name to register
- Endpoint
Configuration DomainName Endpoint Configuration Args Configuration block defining API endpoint information including type. Defined below.
- Regional
Certificate stringArn The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when a regional domain name is desired. Conflicts with
certificate_arn,certificate_name,certificate_body,certificate_chain, andcertificate_private_key.- Regional
Certificate stringName The user-friendly name of the certificate that will be used by regional endpoint for this domain name. Conflicts with
certificate_arn,certificate_name,certificate_body,certificate_chain, andcertificate_private_key.- Regional
Domain stringName The hostname for the custom domain’s regional endpoint.
- Regional
Zone stringId The hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
- Security
Policy string The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are
TLS_1_0andTLS_1_2. Must be configured to perform drift detection.- Dictionary<string, string>
Key-value map of resource tags
- Arn string
Amazon Resource Name (ARN)
- Certificate
Arn string The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when an edge-optimized domain name is desired. Conflicts with
certificate_name,certificate_body,certificate_chain,certificate_private_key,regional_certificate_arn, andregional_certificate_name.- Certificate
Body string The certificate issued for the domain name being registered, in PEM format. Only valid for
EDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- Certificate
Chain string The certificate for the CA that issued the certificate, along with any intermediate CA certificates required to create an unbroken chain to a certificate trusted by the intended API clients. Only valid for
EDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- Certificate
Name string The unique name to use when registering this certificate as an IAM server certificate. Conflicts with
certificate_arn,regional_certificate_arn, andregional_certificate_name. Required ifcertificate_arnis not set.- Certificate
Private stringKey The private key associated with the domain certificate given in
certificate_body. Only valid forEDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- Certificate
Upload stringDate The upload date associated with the domain certificate.
- Cloudfront
Domain stringName The 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 The fully-qualified domain name to register
- Endpoint
Configuration DomainName Endpoint Configuration Configuration block defining API endpoint information including type. Defined below.
- Regional
Certificate stringArn The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when a regional domain name is desired. Conflicts with
certificate_arn,certificate_name,certificate_body,certificate_chain, andcertificate_private_key.- Regional
Certificate stringName The user-friendly name of the certificate that will be used by regional endpoint for this domain name. Conflicts with
certificate_arn,certificate_name,certificate_body,certificate_chain, andcertificate_private_key.- Regional
Domain stringName The hostname for the custom domain’s regional endpoint.
- Regional
Zone stringId The hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
- Security
Policy string The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are
TLS_1_0andTLS_1_2. Must be configured to perform drift detection.- map[string]string
Key-value map of resource tags
- arn string
Amazon Resource Name (ARN)
- certificate
Arn string The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when an edge-optimized domain name is desired. Conflicts with
certificate_name,certificate_body,certificate_chain,certificate_private_key,regional_certificate_arn, andregional_certificate_name.- certificate
Body string The certificate issued for the domain name being registered, in PEM format. Only valid for
EDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- certificate
Chain string The certificate for the CA that issued the certificate, along with any intermediate CA certificates required to create an unbroken chain to a certificate trusted by the intended API clients. Only valid for
EDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- certificate
Name string The unique name to use when registering this certificate as an IAM server certificate. Conflicts with
certificate_arn,regional_certificate_arn, andregional_certificate_name. Required ifcertificate_arnis not set.- certificate
Private stringKey The private key associated with the domain certificate given in
certificate_body. Only valid forEDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- certificate
Upload stringDate The upload date associated with the domain certificate.
- cloudfront
Domain stringName The 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 The fully-qualified domain name to register
- endpoint
Configuration DomainName Endpoint Configuration Configuration block defining API endpoint information including type. Defined below.
- regional
Certificate stringArn The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when a regional domain name is desired. Conflicts with
certificate_arn,certificate_name,certificate_body,certificate_chain, andcertificate_private_key.- regional
Certificate stringName The user-friendly name of the certificate that will be used by regional endpoint for this domain name. Conflicts with
certificate_arn,certificate_name,certificate_body,certificate_chain, andcertificate_private_key.- regional
Domain stringName The hostname for the custom domain’s regional endpoint.
- regional
Zone stringId The hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
- security
Policy string The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are
TLS_1_0andTLS_1_2. Must be configured to perform drift detection.- {[key: string]: string}
Key-value map of resource tags
- arn str
Amazon Resource Name (ARN)
- certificate_
arn str The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when an edge-optimized domain name is desired. Conflicts with
certificate_name,certificate_body,certificate_chain,certificate_private_key,regional_certificate_arn, andregional_certificate_name.- certificate_
body str The certificate issued for the domain name being registered, in PEM format. Only valid for
EDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- certificate_
chain str The certificate for the CA that issued the certificate, along with any intermediate CA certificates required to create an unbroken chain to a certificate trusted by the intended API clients. Only valid for
EDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- certificate_
name str The unique name to use when registering this certificate as an IAM server certificate. Conflicts with
certificate_arn,regional_certificate_arn, andregional_certificate_name. Required ifcertificate_arnis not set.- certificate_
private_ strkey The private key associated with the domain certificate given in
certificate_body. Only valid forEDGEendpoint configuration type. Conflicts withcertificate_arn,regional_certificate_arn, andregional_certificate_name.- certificate_
upload_ strdate The upload date associated with the domain certificate.
- cloudfront_
domain_ strname The 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 The fully-qualified domain name to register
- endpoint_
configuration Dict[DomainName Endpoint Configuration] Configuration block defining API endpoint information including type. Defined below.
- regional_
certificate_ strarn The ARN for an AWS-managed certificate. AWS Certificate Manager is the only supported source. Used when a regional domain name is desired. Conflicts with
certificate_arn,certificate_name,certificate_body,certificate_chain, andcertificate_private_key.- regional_
certificate_ strname The user-friendly name of the certificate that will be used by regional endpoint for this domain name. Conflicts with
certificate_arn,certificate_name,certificate_body,certificate_chain, andcertificate_private_key.- regional_
domain_ strname The hostname for the custom domain’s regional endpoint.
- regional_
zone_ strid The hosted zone ID that can be used to create a Route53 alias record for the regional endpoint.
- security_
policy str The Transport Layer Security (TLS) version + cipher suite for this DomainName. The valid values are
TLS_1_0andTLS_1_2. Must be configured to perform drift detection.- Dict[str, str]
Key-value map of resource tags
Supporting Types
DomainNameEndpointConfiguration
- Types string
A list of endpoint types. This resource currently only supports managing a single value. Valid values:
EDGEorREGIONAL. If unspecified, defaults toEDGE. Must be declared asREGIONALin non-Commercial partitions. Refer to the documentation for more information on the difference between edge-optimized and regional APIs.
- Types string
A list of endpoint types. This resource currently only supports managing a single value. Valid values:
EDGEorREGIONAL. If unspecified, defaults toEDGE. Must be declared asREGIONALin non-Commercial partitions. Refer to the documentation for more information on the difference between edge-optimized and regional APIs.
- types string
A list of endpoint types. This resource currently only supports managing a single value. Valid values:
EDGEorREGIONAL. If unspecified, defaults toEDGE. Must be declared asREGIONALin non-Commercial partitions. Refer to the documentation for more information on the difference between edge-optimized and regional APIs.
- types str
A list of endpoint types. This resource currently only supports managing a single value. Valid values:
EDGEorREGIONAL. If unspecified, defaults toEDGE. Must be declared asREGIONALin non-Commercial partitions. Refer to the documentation for more information on the difference between edge-optimized and regional APIs.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.