iam_instance_profile_associations
Creates, updates, deletes, gets or lists an iam_instance_profile_associations resource.
Overview
| Name | iam_instance_profile_associations |
| Type | Resource |
| Id | aws.ec2.iam_instance_profile_associations |
Fields
The following fields are returned by SELECT queries:
- describe_iam_instance_profile_associations
| Name | Datatype | Description |
|---|---|---|
association_id | string | The ID of the association. |
iam_instance_profile | string | The IAM instance profile. |
instance_id | string | The ID of the instance. |
state | string | The state of the association. |
timestamp | string | The time the IAM instance profile was associated with the instance. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_iam_instance_profile_associations | select | region | AssociationId, Filter, MaxResults, NextToken | Describes your IAM instance profile associations. |
replace_iam_instance_profile_association | replace | IamInstanceProfile, AssociationId, region | Replaces an IAM instance profile for the specified running instance. You can use this action to change the IAM instance profile that's associated with an instance without having to disassociate the existing IAM instance profile first. Use DescribeIamInstanceProfileAssociations to get the association ID. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
AssociationId | string | The ID of the existing IAM instance profile association. |
IamInstanceProfile | object | The IAM instance profile. |
region | string | AWS region (default: us-east-1) |
AssociationId | array | The IAM instance profile associations. |
Filter | array | The filters. instance-id - The ID of the instance. state - The state of the association (associating | associated | disassociating). |
MaxResults | integer | 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 | The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request. |
SELECT examples
- describe_iam_instance_profile_associations
Describes your IAM instance profile associations.
SELECT
association_id,
iam_instance_profile,
instance_id,
state,
timestamp
FROM aws.ec2.iam_instance_profile_associations
WHERE region = '{{ region }}' -- required
AND AssociationId = '{{ AssociationId }}'
AND Filter = '{{ Filter }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
;
REPLACE examples
- replace_iam_instance_profile_association
Replaces an IAM instance profile for the specified running instance. You can use this action to change the IAM instance profile that's associated with an instance without having to disassociate the existing IAM instance profile first. Use DescribeIamInstanceProfileAssociations to get the association ID.
REPLACE aws.ec2.iam_instance_profile_associations
SET
-- No updatable properties
WHERE
IamInstanceProfile = '{{ IamInstanceProfile }}' --required
AND AssociationId = '{{ AssociationId }}' --required
AND region = '{{ region }}' --required
RETURNING
association_id,
iam_instance_profile,
instance_id,
state,
timestamp;