- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
AssociatePackageCommand
Associates a package with an Amazon OpenSearch Service domain. For more information, see Custom packages for Amazon OpenSearch Service .
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { OpenSearchClient, AssociatePackageCommand } from "@aws-sdk/client-opensearch"; // ES Modules import
// const { OpenSearchClient, AssociatePackageCommand } = require("@aws-sdk/client-opensearch"); // CommonJS import
const client = new OpenSearchClient(config);
const input = { // AssociatePackageRequest
PackageID: "STRING_VALUE", // required
DomainName: "STRING_VALUE", // required
PrerequisitePackageIDList: [ // PackageIDList
"STRING_VALUE",
],
AssociationConfiguration: { // PackageAssociationConfiguration
KeyStoreAccessOption: { // KeyStoreAccessOption
KeyAccessRoleArn: "STRING_VALUE",
KeyStoreAccessEnabled: true || false, // required
},
},
};
const command = new AssociatePackageCommand(input);
const response = await client.send(command);
// { // AssociatePackageResponse
// DomainPackageDetails: { // DomainPackageDetails
// PackageID: "STRING_VALUE",
// PackageName: "STRING_VALUE",
// PackageType: "TXT-DICTIONARY" || "ZIP-PLUGIN" || "PACKAGE-LICENSE" || "PACKAGE-CONFIG",
// LastUpdated: new Date("TIMESTAMP"),
// DomainName: "STRING_VALUE",
// DomainPackageStatus: "ASSOCIATING" || "ASSOCIATION_FAILED" || "ACTIVE" || "DISSOCIATING" || "DISSOCIATION_FAILED",
// PackageVersion: "STRING_VALUE",
// PrerequisitePackageIDList: [ // PackageIDList
// "STRING_VALUE",
// ],
// ReferencePath: "STRING_VALUE",
// ErrorDetails: { // ErrorDetails
// ErrorType: "STRING_VALUE",
// ErrorMessage: "STRING_VALUE",
// },
// AssociationConfiguration: { // PackageAssociationConfiguration
// KeyStoreAccessOption: { // KeyStoreAccessOption
// KeyAccessRoleArn: "STRING_VALUE",
// KeyStoreAccessEnabled: true || false, // required
// },
// },
// },
// };
AssociatePackageCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
DomainName Required | string | undefined | Name of the domain to associate the package with. |
PackageID Required | string | undefined | Internal ID of the package to associate with a domain. Use |
AssociationConfiguration | PackageAssociationConfiguration | undefined | The configuration for associating a package with an Amazon OpenSearch Service domain. |
PrerequisitePackageIDList | string[] | undefined | A list of package IDs that must be associated with the domain before the package specified in the request can be associated. |
AssociatePackageCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
DomainPackageDetails | DomainPackageDetails | undefined | Information about a package that is associated with a domain. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | An error occurred because you don't have permissions to access the resource. |
BaseException | client | An error occurred while processing the request. |
ConflictException | client | An error occurred because the client attempts to remove a resource that is currently in use. |
InternalException | server | Request processing failed because of an unknown error, exception, or internal failure. |
ResourceNotFoundException | client | An exception for accessing or deleting a resource that doesn't exist. |
ValidationException | client | An exception for accessing or deleting a resource that doesn't exist. |
OpenSearchServiceException | Base exception class for all service exceptions from OpenSearch service. |