- 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.
GetResourceShareAssociationsCommand
Retrieves the lists of resources and principals that associated for resource shares that you own.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { RAMClient, GetResourceShareAssociationsCommand } from "@aws-sdk/client-ram"; // ES Modules import
// const { RAMClient, GetResourceShareAssociationsCommand } = require("@aws-sdk/client-ram"); // CommonJS import
const client = new RAMClient(config);
const input = { // GetResourceShareAssociationsRequest
associationType: "PRINCIPAL" || "RESOURCE", // required
resourceShareArns: [ // ResourceShareArnList
"STRING_VALUE",
],
resourceArn: "STRING_VALUE",
principal: "STRING_VALUE",
associationStatus: "ASSOCIATING" || "ASSOCIATED" || "FAILED" || "DISASSOCIATING" || "DISASSOCIATED",
nextToken: "STRING_VALUE",
maxResults: Number("int"),
};
const command = new GetResourceShareAssociationsCommand(input);
const response = await client.send(command);
// { // GetResourceShareAssociationsResponse
// resourceShareAssociations: [ // ResourceShareAssociationList
// { // ResourceShareAssociation
// resourceShareArn: "STRING_VALUE",
// resourceShareName: "STRING_VALUE",
// associatedEntity: "STRING_VALUE",
// associationType: "PRINCIPAL" || "RESOURCE",
// status: "ASSOCIATING" || "ASSOCIATED" || "FAILED" || "DISASSOCIATING" || "DISASSOCIATED",
// statusMessage: "STRING_VALUE",
// creationTime: new Date("TIMESTAMP"),
// lastUpdatedTime: new Date("TIMESTAMP"),
// external: true || false,
// },
// ],
// nextToken: "STRING_VALUE",
// };
GetResourceShareAssociationsCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
associationType Required | ResourceShareAssociationType | undefined | Specifies whether you want to retrieve the associations that involve a specified resource or principal.
|
associationStatus | ResourceShareAssociationStatus | undefined | Specifies that you want to retrieve only associations that have this status. |
maxResults | number | undefined | Specifies the total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the number you specify, the |
nextToken | string | undefined | Specifies that you want to receive the next page of results. Valid only if you received a |
principal | string | undefined | Specifies the ID of the principal whose resource shares you want to retrieve. This can be an Amazon Web Services account ID, an organization ID, an organizational unit ID, or the Amazon Resource Name (ARN) of an individual IAM role or user. You cannot specify this parameter if the association type is |
resourceArn | string | undefined | Specifies the Amazon Resource Name (ARN) of a resource whose resource shares you want to retrieve. You cannot specify this parameter if the association type is |
resourceShareArns | string[] | undefined | Specifies a list of Amazon Resource Names (ARNs) of the resource share whose associations you want to retrieve. |
GetResourceShareAssociationsCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
nextToken | string | undefined | If present, this value indicates that more output is available than is included in the current response. Use this value in the |
resourceShareAssociations | ResourceShareAssociation[] | undefined | An array of objects that contain the details about the associations. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidNextTokenException | client | The operation failed because the specified value for |
InvalidParameterException | client | The operation failed because a parameter you specified isn't valid. |
MalformedArnException | client | The operation failed because the specified Amazon Resource Name (ARN) has a format that isn't valid. |
OperationNotPermittedException | client | The operation failed because the requested operation isn't permitted. |
ServerInternalException | server | The operation failed because the service could not respond to the request due to an internal problem. Try again later. |
ServiceUnavailableException | server | The operation failed because the service isn't available. Try again later. |
UnknownResourceException | client | The operation failed because a specified resource couldn't be found. |
RAMServiceException | Base exception class for all service exceptions from RAM service. |