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

// This example describes the specified IAM instance profile association.
const input = {
"AssociationIds": [
"iip-assoc-0db249b1f25fa24b8"
]
};
const command = new DescribeIamInstanceProfileAssociationsCommand(input);
const response = await client.send(command);
/* response ==
{
"IamInstanceProfileAssociations": [
{
"AssociationId": "iip-assoc-0db249b1f25fa24b8",
"IamInstanceProfile": {
"Arn": "arn:aws:iam::123456789012:instance-profile/admin-role",
"Id": "AIPAJVQN4F5WVLGCJDRGM"
},
"InstanceId": "i-09eb09efa73ec1dee",
"State": "associated"
}
]
}
*\/
// example id: to-describe-an-iam-instance-profile-association-1529025123918
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
JavaScriptLn 1, Col 1
Errors: 0 Warnings: 0

DescribeIamInstanceProfileAssociationsCommand Input

Parameter
Type
Description
AssociationIds
string[] | undefined

The IAM instance profile associations.

Filters
Filter[] | undefined

The filters.

  • instance-id - The ID of the instance.

  • state - The state of the association (associating | associated | disassociating).

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
$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 null when there are no more items to return.

Throws

Name
Fault
Details
EC2ServiceException
Base exception class for all service exceptions from EC2 service.