UpdateDomainAssociationCommand

Creates a new domain association for an Amplify app.

Example Syntax

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

import { AmplifyClient, UpdateDomainAssociationCommand } from "@aws-sdk/client-amplify"; // ES Modules import
// const { AmplifyClient, UpdateDomainAssociationCommand } = require("@aws-sdk/client-amplify"); // CommonJS import
const client = new AmplifyClient(config);
const input = { // UpdateDomainAssociationRequest
  appId: "STRING_VALUE", // required
  domainName: "STRING_VALUE", // required
  enableAutoSubDomain: true || false,
  subDomainSettings: [ // SubDomainSettings
    { // SubDomainSetting
      prefix: "STRING_VALUE", // required
      branchName: "STRING_VALUE", // required
    },
  ],
  autoSubDomainCreationPatterns: [ // AutoSubDomainCreationPatterns
    "STRING_VALUE",
  ],
  autoSubDomainIAMRole: "STRING_VALUE",
  certificateSettings: { // CertificateSettings
    type: "AMPLIFY_MANAGED" || "CUSTOM", // required
    customCertificateArn: "STRING_VALUE",
  },
};
const command = new UpdateDomainAssociationCommand(input);
const response = await client.send(command);
// { // UpdateDomainAssociationResult
//   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",
//     },
//   },
// };

UpdateDomainAssociationCommand Input

Parameter
Type
Description
appId
Required
string | undefined

The unique ID for an Amplify app.

domainName
Required
string | undefined

The name of the domain.

autoSubDomainCreationPatterns
string[] | undefined

Sets the branch patterns for automatic subdomain creation.

autoSubDomainIAMRole
string | undefined

The required AWS Identity and Access Management (IAM) service role for the Amazon Resource Name (ARN) for automatically creating subdomains.

certificateSettings
CertificateSettings | undefined

The type of SSL/TLS certificate to use for your custom domain.

enableAutoSubDomain
boolean | undefined

Enables the automated creation of subdomains for branches.

subDomainSettings
SubDomainSetting[] | undefined

Describes the settings for the subdomain.

UpdateDomainAssociationCommand Output

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

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

Throws

Name
Fault
Details
BadRequestException
client

A request contains unexpected data.

DependentServiceFailureException
server

An operation failed because a dependent service threw an exception.

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.