iam_instance_profiles
Creates, updates, deletes, gets or lists an iam_instance_profiles resource.
Overview
| Name | iam_instance_profiles |
| Type | Resource |
| Id | aws.ec2.iam_instance_profiles |
Fields
The following fields are returned by SELECT queries:
SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
associate_iam_instance_profile | update | IamInstanceProfile, InstanceId, region | Associates an IAM instance profile with a running or stopped instance. You cannot associate more than one IAM instance profile with an instance. | |
disassociate_iam_instance_profile | update | AssociationId, region | Disassociates an IAM instance profile from a running or stopped instance. 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 IAM instance profile association. |
IamInstanceProfile | object | The IAM instance profile. |
InstanceId | string | The ID of the instance. |
region | string | AWS region (default: us-east-1) |
UPDATE examples
- associate_iam_instance_profile
- disassociate_iam_instance_profile
Associates an IAM instance profile with a running or stopped instance. You cannot associate more than one IAM instance profile with an instance.
UPDATE aws.ec2.iam_instance_profiles
SET
-- No updatable properties
WHERE
IamInstanceProfile = '{{ IamInstanceProfile }}' --required
AND InstanceId = '{{ InstanceId }}' --required
AND region = '{{ region }}' --required
RETURNING
association_id,
iam_instance_profile,
instance_id,
state,
timestamp;
Disassociates an IAM instance profile from a running or stopped instance. Use DescribeIamInstanceProfileAssociations to get the association ID.
UPDATE aws.ec2.iam_instance_profiles
SET
-- No updatable properties
WHERE
AssociationId = '{{ AssociationId }}' --required
AND region = '{{ region }}' --required
RETURNING
association_id,
iam_instance_profile,
instance_id,
state,
timestamp;