Skip to content

EC2  >  Operations  >  associate_iam_instance_profile

associate_iam_instance_profile

Operation

associate_iam_instance_profile async

associate_iam_instance_profile(input: AssociateIamInstanceProfileInput, plugins: list[Plugin] | None = None) -> AssociateIamInstanceProfileOutput

Associates an IAM instance profile with a running or stopped instance. You cannot associate more than one IAM instance profile with an instance.

Parameters:

Name Type Description Default
input AssociateIamInstanceProfileInput

An instance of AssociateIamInstanceProfileInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
AssociateIamInstanceProfileOutput

An instance of AssociateIamInstanceProfileOutput.

Input

AssociateIamInstanceProfileInput dataclass

Bases: _SerdeShape

Dataclass for AssociateIamInstanceProfileInput structure.

Attributes

iam_instance_profile class-attribute instance-attribute
iam_instance_profile: IamInstanceProfileSpecification | None = ...

The IAM instance profile.

instance_id class-attribute instance-attribute
instance_id: str | None = ...

The ID of the instance.

Output

AssociateIamInstanceProfileOutput dataclass

Bases: _SerdeShape

Dataclass for AssociateIamInstanceProfileOutput structure.

Attributes

iam_instance_profile_association class-attribute instance-attribute
iam_instance_profile_association: IamInstanceProfileAssociation | None = ...

Information about the IAM instance profile association.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.