Associates an IAM instance profile with a running or stopped instance. You cannot associate more than one IAM instance profile with an instance.
Use a bare-bones client and the command you need to make an API call.
import { EC2Client, AssociateIamInstanceProfileCommand } from "@aws-sdk/client-ec2"; // ES Modules import // const { EC2Client, AssociateIamInstanceProfileCommand } = require("@aws-sdk/client-ec2"); // CommonJS import const client = new EC2Client(config); const command = new AssociateIamInstanceProfileCommand(input); const response = await client.send(command);
AssociateIamInstanceProfileCommandInput for command's input shape.
input
AssociateIamInstanceProfileCommandOutput for command's response shape.
response
config for EC2Client's config shape.
config
Associates an IAM instance profile with a running or stopped instance. You cannot associate more than one IAM instance profile with an instance.
Use a bare-bones client and the command you need to make an API call.
import { EC2Client, AssociateIamInstanceProfileCommand } from "@aws-sdk/client-ec2"; // ES Modules import // const { EC2Client, AssociateIamInstanceProfileCommand } = require("@aws-sdk/client-ec2"); // CommonJS import const client = new EC2Client(config); const command = new AssociateIamInstanceProfileCommand(input); const response = await client.send(command);
AssociateIamInstanceProfileCommandInput for command's
input
shape.AssociateIamInstanceProfileCommandOutput for command's
response
shape.config for EC2Client's
config
shape.