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.
Use a bare-bones client and the command you need to make an API call.
import { EC2Client, ReplaceIamInstanceProfileAssociationCommand } from "@aws-sdk/client-ec2"; // ES Modules import // const { EC2Client, ReplaceIamInstanceProfileAssociationCommand } = require("@aws-sdk/client-ec2"); // CommonJS import const client = new EC2Client(config); const command = new ReplaceIamInstanceProfileAssociationCommand(input); const response = await client.send(command);
ReplaceIamInstanceProfileAssociationCommandInput for command's input shape.
input
ReplaceIamInstanceProfileAssociationCommandOutput for command's response shape.
response
config for EC2Client's config shape.
config
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.
Use a bare-bones client and the command you need to make an API call.
import { EC2Client, ReplaceIamInstanceProfileAssociationCommand } from "@aws-sdk/client-ec2"; // ES Modules import // const { EC2Client, ReplaceIamInstanceProfileAssociationCommand } = require("@aws-sdk/client-ec2"); // CommonJS import const client = new EC2Client(config); const command = new ReplaceIamInstanceProfileAssociationCommand(input); const response = await client.send(command);
ReplaceIamInstanceProfileAssociationCommandInput for command's
input
shape.ReplaceIamInstanceProfileAssociationCommandOutput for command's
response
shape.config for EC2Client's
config
shape.