Skip to main content

iam_instance_profiles

Creates, updates, deletes, gets or lists an iam_instance_profiles resource.

Overview

Nameiam_instance_profiles
TypeResource
Idaws.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:

NameAccessible byRequired ParamsOptional ParamsDescription
associate_iam_instance_profileupdateIamInstanceProfile, InstanceId, regionAssociates 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_profileupdateAssociationId, regionDisassociates 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.

NameDatatypeDescription
AssociationIdstringThe ID of the IAM instance profile association.
IamInstanceProfileobjectThe IAM instance profile.
InstanceIdstringThe ID of the instance.
regionstringAWS region (default: us-east-1)

UPDATE examples

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;