CreateDomainNameCommand

Creates a custom DomainName object.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { AppSyncClient, CreateDomainNameCommand } from "@aws-sdk/client-appsync"; // ES Modules import
// const { AppSyncClient, CreateDomainNameCommand } = require("@aws-sdk/client-appsync"); // CommonJS import
const client = new AppSyncClient(config);
const input = { // CreateDomainNameRequest
  domainName: "STRING_VALUE", // required
  certificateArn: "STRING_VALUE", // required
  description: "STRING_VALUE",
};
const command = new CreateDomainNameCommand(input);
const response = await client.send(command);
// { // CreateDomainNameResponse
//   domainNameConfig: { // DomainNameConfig
//     domainName: "STRING_VALUE",
//     description: "STRING_VALUE",
//     certificateArn: "STRING_VALUE",
//     appsyncDomainName: "STRING_VALUE",
//     hostedZoneId: "STRING_VALUE",
//   },
// };

CreateDomainNameCommand Input

See CreateDomainNameCommandInput for more details

Parameter
Type
Description
certificateArn
Required
string | undefined

The Amazon Resource Name (ARN) of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate.

domainName
Required
string | undefined

The domain name.

description
string | undefined

A description of the DomainName.

CreateDomainNameCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
domainNameConfig
DomainNameConfig | undefined

The configuration for the DomainName.

Throws

Name
Fault
Details
AccessDeniedException
client

You don't have access to perform this operation on this resource.

BadRequestException
client

The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and then try again.

InternalFailureException
server

An internal AppSync error occurred. Try your request again.

AppSyncServiceException
Base exception class for all service exceptions from AppSync service.