Skip to content

EC2  >  Operations  >  replace_iam_instance_profile_association

replace_iam_instance_profile_association

Operation

replace_iam_instance_profile_association async

replace_iam_instance_profile_association(input: ReplaceIamInstanceProfileAssociationInput, plugins: list[Plugin] | None = None) -> ReplaceIamInstanceProfileAssociationOutput

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:

Name Type Description Default
input ReplaceIamInstanceProfileAssociationInput

An instance of ReplaceIamInstanceProfileAssociationInput.

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
ReplaceIamInstanceProfileAssociationOutput

An instance of ReplaceIamInstanceProfileAssociationOutput.

Input

ReplaceIamInstanceProfileAssociationInput dataclass

Bases: _SerdeShape

Dataclass for ReplaceIamInstanceProfileAssociationInput structure.

Attributes

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

The ID of the existing IAM instance profile association.

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

The IAM instance profile.

Output

ReplaceIamInstanceProfileAssociationOutput dataclass

Bases: _SerdeShape

Dataclass for ReplaceIamInstanceProfileAssociationOutput 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.