- 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.
DescribeIamInstanceProfileAssociationsCommand
Describes your IAM instance profile associations.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { EC2Client, DescribeIamInstanceProfileAssociationsCommand } from "@aws-sdk/client-ec2"; // ES Modules import
// const { EC2Client, DescribeIamInstanceProfileAssociationsCommand } = require("@aws-sdk/client-ec2"); // CommonJS import
const client = new EC2Client(config);
const input = { // DescribeIamInstanceProfileAssociationsRequest
AssociationIds: [ // AssociationIdList
"STRING_VALUE",
],
Filters: [ // FilterList
{ // Filter
Name: "STRING_VALUE",
Values: [ // ValueStringList
"STRING_VALUE",
],
},
],
MaxResults: Number("int"),
NextToken: "STRING_VALUE",
};
const command = new DescribeIamInstanceProfileAssociationsCommand(input);
const response = await client.send(command);
// { // DescribeIamInstanceProfileAssociationsResult
// IamInstanceProfileAssociations: [ // IamInstanceProfileAssociationSet
// { // IamInstanceProfileAssociation
// AssociationId: "STRING_VALUE",
// InstanceId: "STRING_VALUE",
// IamInstanceProfile: { // IamInstanceProfile
// Arn: "STRING_VALUE",
// Id: "STRING_VALUE",
// },
// State: "associating" || "associated" || "disassociating" || "disassociated",
// Timestamp: new Date("TIMESTAMP"),
// },
// ],
// NextToken: "STRING_VALUE",
// };
Example Usage
DescribeIamInstanceProfileAssociationsCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
AssociationIds | string[] | undefined | The IAM instance profile associations. |
Filters | Filter[] | undefined | The filters.
|
MaxResults | number | undefined | The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination . |
NextToken | string | undefined | The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request. |
DescribeIamInstanceProfileAssociationsCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
IamInstanceProfileAssociations | IamInstanceProfileAssociation[] | undefined | Information about the IAM instance profile associations. |
NextToken | string | undefined | The token to include in another request to get the next page of items. This value is |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
EC2ServiceException | Base exception class for all service exceptions from EC2 service. |