GetDomainAssociationCommand

Returns the domain information for an Amplify app.

Example Syntax

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

import { AmplifyClient, GetDomainAssociationCommand } from "@aws-sdk/client-amplify"; // ES Modules import
// const { AmplifyClient, GetDomainAssociationCommand } = require("@aws-sdk/client-amplify"); // CommonJS import
const client = new AmplifyClient(config);
const input = { // GetDomainAssociationRequest
  appId: "STRING_VALUE", // required
  domainName: "STRING_VALUE", // required
};
const command = new GetDomainAssociationCommand(input);
const response = await client.send(command);
// { // GetDomainAssociationResult
//   domainAssociation: { // DomainAssociation
//     domainAssociationArn: "STRING_VALUE", // required
//     domainName: "STRING_VALUE", // required
//     enableAutoSubDomain: true || false, // required
//     autoSubDomainCreationPatterns: [ // AutoSubDomainCreationPatterns
//       "STRING_VALUE",
//     ],
//     autoSubDomainIAMRole: "STRING_VALUE",
//     domainStatus: "PENDING_VERIFICATION" || "IN_PROGRESS" || "AVAILABLE" || "IMPORTING_CUSTOM_CERTIFICATE" || "PENDING_DEPLOYMENT" || "AWAITING_APP_CNAME" || "FAILED" || "CREATING" || "REQUESTING_CERTIFICATE" || "UPDATING", // required
//     updateStatus: "REQUESTING_CERTIFICATE" || "PENDING_VERIFICATION" || "IMPORTING_CUSTOM_CERTIFICATE" || "PENDING_DEPLOYMENT" || "AWAITING_APP_CNAME" || "UPDATE_COMPLETE" || "UPDATE_FAILED",
//     statusReason: "STRING_VALUE", // required
//     certificateVerificationDNSRecord: "STRING_VALUE",
//     subDomains: [ // SubDomains // required
//       { // SubDomain
//         subDomainSetting: { // SubDomainSetting
//           prefix: "STRING_VALUE", // required
//           branchName: "STRING_VALUE", // required
//         },
//         verified: true || false, // required
//         dnsRecord: "STRING_VALUE", // required
//       },
//     ],
//     certificate: { // Certificate
//       type: "AMPLIFY_MANAGED" || "CUSTOM", // required
//       customCertificateArn: "STRING_VALUE",
//       certificateVerificationDNSRecord: "STRING_VALUE",
//     },
//   },
// };

GetDomainAssociationCommand Input

Parameter
Type
Description
appId
Required
string | undefined

The unique id for an Amplify app.

domainName
Required
string | undefined

The name of the domain.

GetDomainAssociationCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
domainAssociation
Required
DomainAssociation | undefined

Describes the structure of a domain association, which associates a custom domain with an Amplify app.

Throws

Name
Fault
Details
BadRequestException
client

A request contains unexpected data.

InternalFailureException
server

The service failed to perform an operation due to an internal issue.

NotFoundException
client

An entity was not found during an operation.

UnauthorizedException
client

An operation failed due to a lack of access.

AmplifyServiceException
Base exception class for all service exceptions from Amplify service.